/* ============================================================
   BunBun Lương – UI ver2.1 "light teal"
   Tone mới: teal/ngọc lục bảo trên nền sáng phẳng – gọn, nhẹ, sạch.
   (ver1: style-v1.css · ver2 tone cam: style-v2-cam.css)
   ============================================================ */
:root {
  --bg: #f7f8fa;
  --bg-2: #f1f3f6;
  --surface: #ffffff;
  --border: #e8ebf0;
  --text: #1c2433;
  --muted: #6b7686;
  --accent: #0ea5a3;          /* teal chính */
  --accent-2: #2dd4bf;
  --accent-dark: #0b8583;
  --accent-soft: #e6f7f5;
  --green: #0e9f6e;
  --green-soft: #e4f7ef;
  --red: #dc2626;
  --red-soft: #fdeded;
  --amber: #b45309;
  --amber-soft: #fdf3dd;
  --blue: #4f6bd8;
  --blue-soft: #edf0fc;
  --radius: 12px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(28, 36, 51, .05);
  --shadow-lift: 0 2px 4px rgba(28, 36, 51, .05), 0 10px 22px -12px rgba(28, 36, 51, .14);
  --sidebar-w: 204px;
}
* { box-sizing: border-box; }
html { font-size: 14.5px; scroll-behavior: smooth; }
body {
  margin: 0; color: var(--text);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  line-height: 1.5;
  min-height: 100vh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
::selection { background: #bdeeea; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d2d8e1; border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b4bdcb; border: 2px solid transparent; background-clip: content-box; }

/* ---------------- khung app: sidebar + nội dung ---------------- */
.app-shell { display: flex; flex: 1; min-height: 100vh; }

.topbar {
  width: var(--sidebar-w); flex-shrink: 0;
  position: sticky; top: 0; height: 100vh; z-index: 50;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(8px);
  border-right: 1px solid var(--border);
  display: flex;
}
.topbar-inner { display: flex; flex-direction: column; width: 100%; padding: 16px 12px; gap: 4px; }
.brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 1rem; color: var(--text);
  padding: 2px 8px 12px; letter-spacing: -.01em;
}
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--accent);
  color: #fff; display: grid; place-items: center; font-size: 15px; font-weight: 700;
}
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 9px;
  color: var(--muted); font-weight: 600; font-size: .92rem;
  transition: background .15s, color .15s;
}
.nav a::before { font-size: 1rem; width: 20px; text-align: center; }
.nav a[href="/admin"]::before { content: "📅"; }
.nav a[href="/admin/nhan-vien"]::before { content: "👥"; }
.nav a[href="/admin/users"]::before { content: "🔑"; }
.nav a[href="/admin/nhat-ky"]::before { content: "📜"; }
.nav a[href="/me"]::before { content: "💳"; }
.nav a[href="/huong-dan"]::before { content: "📖"; }
.nav a:hover { background: var(--accent-soft); color: var(--accent-dark); text-decoration: none; }
.nav a.active { background: var(--accent); color: #fff; }
.userbox {
  display: flex; flex-direction: column; gap: 8px;
  font-size: .86rem; color: var(--muted);
  border-top: 1px solid var(--border); padding-top: 12px; margin-top: 8px;
}
.userbox b { color: var(--text); }
.userbox .btn { width: 100%; text-align: center; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 20px 20px 54px; }
.container.narrow { max-width: 800px; }

h2 { letter-spacing: -.015em; }

/* ---------------- cards ---------------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 20px; margin-bottom: 16px;
  transition: box-shadow .18s;
}
.card h2 { margin: 0 0 3px; font-size: 1.05rem; }
.card h3 { margin: 14px 0 7px; font-size: .96rem; }
.card .sub { color: var(--muted); font-size: .87rem; margin-bottom: 12px; }

.cards-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; box-shadow: var(--shadow);
  transition: box-shadow .16s;
}
.stat:hover { box-shadow: var(--shadow-lift); }
.stat .label { color: var(--muted); font-size: .78rem; font-weight: 600; }
.stat .value { font-size: 1.3rem; font-weight: 700; margin-top: 2px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .value.money { color: var(--green); }
.stat .value.warn { color: var(--amber); }

/* ---------------- bảng ---------------- */
.table-wrap {
  overflow: auto; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
  /* Giới hạn theo màn hình: bảng dài cuộn DỌC bên trong khung, nhờ vậy
     thanh kéo NGANG luôn nằm trong tầm mắt, không phải kéo xuống cuối trang. */
  max-height: 72vh;
  overscroll-behavior: contain;
}
.table-wrap.dragging { cursor: grabbing; user-select: none; }
.table-wrap.dragging * { cursor: grabbing !important; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
th {
  background: #f8f9fb; color: #566179; font-size: .78rem; font-weight: 600;
  position: sticky; top: 0; z-index: 1;
}
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: #f3faf9; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
td.money { font-variant-numeric: tabular-nums; font-weight: 650; }
tfoot td { font-weight: 700; background: #f8f9fb; }

/* ---------------- badge & nút ---------------- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: .73rem; font-weight: 700; }
.badge.gray { background: #eef0f4; color: var(--muted); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.orange { background: var(--accent-soft); color: var(--accent-dark); }

.btn {
  display: inline-block; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); padding: 6px 12px; border-radius: 9px;
  font-weight: 650; font-size: .88rem; cursor: pointer;
  transition: background .14s, border-color .14s, box-shadow .14s, transform .1s;
}
.btn:hover { border-color: #cbd3de; box-shadow: var(--shadow-lift); text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.green:hover { filter: brightness(1.07); }
.btn.danger { background: #fff; border-color: #f3caca; color: var(--red); }
.btn.danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn.sm { padding: 4px 10px; font-size: .8rem; border-radius: 8px; }

/* ---------------- form ---------------- */
label { display: block; font-size: .78rem; font-weight: 700; color: var(--muted); margin: 8px 0 4px; }
input, select, textarea {
  width: 100%; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font: inherit; background: #fbfcfd; color: var(--text);
  transition: border-color .14s, box-shadow .14s, background .14s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 163, .15); background: #fff;
}
.form-row { display: flex; gap: 12px; }
.form-row > div { flex: 1; }
form.inline { display: inline; }
form.inline input, form.inline select { width: auto; padding: 4px 8px; font-size: .84rem; }

.alert {
  padding: 10px 12px; border-radius: var(--radius-sm); margin-bottom: 12px;
  font-size: .9rem; border: 1px solid transparent; border-left-width: 3px;
}
.alert.err { background: var(--red-soft); color: var(--red); border-color: #f6d5d5; border-left-color: var(--red); }
.alert.ok { background: var(--green-soft); color: var(--green); border-color: #cbeeda; border-left-color: var(--green); }
.alert.info { background: var(--blue-soft); color: #3b4f9e; border-color: #dbe1f8; border-left-color: var(--blue); }
.alert.warn { background: var(--amber-soft); color: var(--amber); border-color: #f3e5bc; border-left-color: var(--amber); }

/* ---------------- tabs ---------------- */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs a {
  padding: 8px 16px; border-radius: 99px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font-weight: 700; font-size: .88rem;
  transition: box-shadow .14s, color .14s;
}
.tabs a:hover { text-decoration: none; color: var(--text); box-shadow: var(--shadow-lift); }
.tabs a.active { color: #fff; border-color: transparent; }
.tabs a .badge { margin-left: 5px; }

/* ---------------- phiếu lương ---------------- */
.payslip-hero {
  position: relative; overflow: hidden;
  background: #0d9488;
  color: #fff; border-radius: 16px; padding: 24px; margin-bottom: 16px;
  box-shadow: 0 14px 28px -16px rgba(28, 36, 51, .3);
}
.payslip-hero .period { opacity: .92; font-weight: 700; font-size: .86rem; }
.payslip-hero .net { font-size: 2.1rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.payslip-hero .who { opacity: .95; margin-top: 2px; font-size: .92rem; position: relative; z-index: 1; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: .91rem; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.kv .v.big { font-size: 1.05rem; font-weight: 700; }
.kv.total { border-top: 2px solid var(--border); margin-top: 3px; padding-top: 9px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

.muted { color: var(--muted); }
.small { font-size: .83rem; }
.mt { margin-top: 12px; }
.flex { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------------- trang đăng nhập ---------------- */
.auth-wrap { flex: 1; display: grid; place-items: center; padding: 22px; }
.auth-card {
  width: 100%; max-width: 410px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 16px 44px -22px rgba(28, 36, 51, .22); padding: 28px 24px;
}
.auth-card .brand { justify-content: center; margin-bottom: 6px; font-size: 1.18rem; padding-bottom: 2px; }
.auth-card h1 { font-size: 1.05rem; text-align: center; margin: 4px 0 16px; color: var(--muted); font-weight: 600; }
.auth-card .btn { width: 100%; margin-top: 16px; padding: 10px; font-size: .95rem; }
.auth-foot { text-align: center; margin-top: 16px; font-size: .86rem; color: var(--muted); }

footer.app-foot { margin-top: auto; text-align: center; color: var(--muted); font-size: .78rem; padding: 18px; }

/* ---------------- bảng lương: gọn mặc định ---------------- */
.paytable .cols-extra { display: none; }
.paytable.full .cols-extra { display: table-cell; }
.paytable tbody tr:nth-child(even) td { background: #fafbfc; }
.paytable tbody tr:hover td { background: var(--accent-soft); }
.paytable td.sticky-name, .paytable th.sticky-name {
  position: sticky; left: 0; z-index: 2;
  background: var(--surface); min-width: 190px; white-space: normal;
  box-shadow: 2px 0 4px -3px rgba(28, 36, 51, .14);
}
.paytable thead th.sticky-name { z-index: 3; background: #f8f9fb; }
.paytable tbody tr:nth-child(even) td.sticky-name { background: #fafbfc; }
.paytable tbody tr:hover td.sticky-name { background: var(--accent-soft); }
.paytable tfoot td.sticky-name { background: #f8f9fb; font-weight: 700; }
.netbar { height: 4px; border-radius: 2px; background: var(--bg-2); margin-top: 3px; overflow: hidden; }
.netbar > div { height: 100%; border-radius: 2px; background: linear-gradient(90deg, #0e9f6e, #34d399); }

/* ---------------- thẻ quy trình tháng (trang kỳ lương) ---------------- */
.wf { padding: 12px 16px; }
.wf-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--accent-soft); border-radius: 9px;
  padding: 8px 12px; margin-bottom: 12px;
  font-size: .92rem; color: var(--accent-dark);
}
.wf-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.wf-step {
  display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; background: #fff;
}
.wf-step.done { background: var(--green-soft); border-color: #cbeeda; }
.wf-step.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 163, .12);
}
.wf-t {
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
  font-size: .92rem; font-weight: 700; color: var(--text);
}
.wf-step.done .wf-t { color: var(--green); }
.wf-step.active .wf-t { color: var(--accent-dark); }
.wf-d { font-size: .8rem; color: var(--muted); line-height: 1.45; margin-bottom: 8px; }
.wf-acts { margin-top: auto; }
.wf-n {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  background: #e5e9ef; color: var(--muted);
  display: grid; place-items: center; font-size: .74rem; font-weight: 700;
}
.wf-step.done .wf-n { background: var(--green); color: #fff; }
.wf-step.active .wf-n { background: var(--accent); color: #fff; }
.wf-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
@media (max-width: 1080px) { .wf-steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 580px) { .wf-steps { grid-template-columns: 1fr; } }

/* card gập mở được (details) */
details.fold > summary {
  cursor: pointer; list-style: none; user-select: none;
  font-weight: 700; font-size: 1.02rem;
  display: flex; align-items: center; gap: 8px;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after {
  content: "›"; margin-left: auto; color: var(--muted);
  font-size: 1.25rem; font-weight: 700; transform: rotate(90deg);
  transition: transform .18s ease-out;
}
details.fold[open] > summary::after { transform: rotate(-90deg); }
details.fold[open] > summary { margin-bottom: 10px; }

/* ---------------- thẻ ca trong "Bảng công theo ngày" (chi tiết NV) ---------------- */
.shift-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px;
  padding: 12px 16px; margin: 8px 0; box-shadow: var(--shadow);
}
.shift-card.sc-manual { border-left: 4px solid #f59e0b; }
.sc-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px;
}
.sc-head > b { font-size: .92rem; }
.sc-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.fg { display: flex; flex-direction: column; gap: 4px; }
.fg > label {
  margin: 0; font-size: .74rem; font-weight: 600; color: var(--muted);
}
.fg input { width: 84px; height: 36px; text-align: center; font-size: .92rem; }
.fg select { height: 36px; font-size: .88rem; }
.fg-note { flex: 1; min-width: 220px; }
.fg-note input { width: 100%; text-align: left; }
.fg-act button { height: 36px; white-space: nowrap; }
.fg input.edited { border-color: var(--amber); font-weight: 700; background: #fffdf4; }
.sc-note {
  margin-top: 8px; padding: 6px 10px; border-radius: 8px;
  background: var(--bg-2); color: var(--muted); font-size: .82rem;
}
@media (max-width: 860px) {
  .sc-form { gap: 8px; }
  .fg input { width: 72px; }
}

/* nút − / + điều chỉnh suất cơm */
.meal-step { display: inline-flex; align-items: center; gap: 3px; }
.meal-step input { width: 48px; }
.ms-btn {
  width: 32px; height: 36px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font-weight: 700; font-size: 1.05rem;
  cursor: pointer; line-height: 1; padding: 0;
  transition: background .12s, border-color .12s;
}
.ms-btn:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }
.ms-btn:active { transform: scale(.94); }

/* ---------------- trang hướng dẫn ---------------- */
.g-hello {
  background: #0d9488;
  color: #fff; border-radius: 16px; padding: 20px; margin-bottom: 12px;
  box-shadow: 0 12px 26px -16px rgba(28, 36, 51, .3);
}
.g-hello-txt { display: flex; flex-direction: column; gap: 2px; }
.g-hello-txt b { font-size: 1.2rem; letter-spacing: -.01em; }
.g-hello-txt span { opacity: .93; font-size: .92rem; }

.g-search { margin-bottom: 16px; }
.g-search input {
  padding: 12px 16px; font-size: .97rem; border-radius: 12px;
  background: var(--surface); border-width: 1.5px; box-shadow: var(--shadow);
}

.g-role {
  font-size: .84rem; font-weight: 700;
  color: var(--muted); margin: 20px 2px 8px;
}

details.g-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 8px; overflow: hidden;
  transition: box-shadow .16s, border-color .16s;
  animation: rise-in .28s ease-out both;
}
details.g-item[open] { box-shadow: var(--shadow-lift); border-color: #bfe8e5; }
.g-item summary {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; cursor: pointer; list-style: none; user-select: none;
}
.g-item summary::-webkit-details-marker { display: none; }
.g-item summary::after {
  content: "›"; margin-left: auto; color: var(--muted);
  font-size: 1.3rem; font-weight: 700; transform: rotate(90deg);
  transition: transform .18s ease-out; flex-shrink: 0;
}
.g-item[open] summary::after { transform: rotate(-90deg); }
.g-item summary:hover { background: #fafcfc; }
.g-item summary b { font-size: .96rem; display: block; line-height: 1.3; }
.g-item summary small { color: var(--muted); font-size: .8rem; }
.g-ico {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  background: var(--accent-soft); display: grid; place-items: center; font-size: 1.15rem;
}
.g-body { padding: 2px 16px 16px 16px; border-top: 1px dashed var(--border); }

.g-steps { list-style: none; counter-reset: gs; margin: 10px 0 0; padding: 0; }
.g-steps li {
  counter-increment: gs; position: relative;
  padding: 4px 0 10px 36px; font-size: .93rem; line-height: 1.55;
}
.g-steps li::before {
  content: counter(gs); position: absolute; left: 0; top: 4px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: .78rem; font-weight: 700;
}
.g-steps li:not(:last-child)::after {
  content: ""; position: absolute; left: 11.5px; top: 31px; bottom: 1px;
  width: 1.5px; background: var(--border);
}
.g-steps.g-plain li::before { content: "•"; background: transparent; color: var(--accent); font-size: 1.3rem; top: 1px; }
.g-steps.g-plain li::after { display: none; }
.g-steps b { color: var(--accent-dark); }

.g-tip {
  background: var(--amber-soft); border: 1px solid #f3e5bc; border-radius: var(--radius-sm);
  padding: 8px 12px; font-size: .87rem; line-height: 1.5; margin-top: 6px; color: #7c5208;
}
.g-tip.g-foot { margin-top: 18px; background: var(--accent-soft); border-color: #cdebe8; color: var(--accent-dark); }

.g-timeline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.g-tl-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px; font-size: .87rem; line-height: 1.45;
}
.g-tl-day {
  display: inline-block; background: var(--accent); color: #fff;
  border-radius: 99px; padding: 1px 10px; font-size: .74rem; font-weight: 700;
  margin-bottom: 6px;
}
@media (max-width: 700px) { .g-timeline { grid-template-columns: 1fr; } }

/* ============================================================
   HIỆU ỨNG CHUYỂN – 150–300ms, ease-out, chỉ transform + opacity,
   tắt khi người dùng bật "giảm chuyển động".
   ============================================================ */
@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.container { animation: rise-in .25s ease-out both; }
.card { animation: rise-in .28s ease-out both; }
.container > .card:nth-of-type(2) { animation-delay: .04s; }
.container > .card:nth-of-type(3) { animation-delay: .08s; }
.container > .card:nth-of-type(4) { animation-delay: .12s; }
.cards-row .stat { animation: rise-in .28s ease-out both; }
.cards-row .stat:nth-child(2) { animation-delay: .03s; }
.cards-row .stat:nth-child(3) { animation-delay: .06s; }
.cards-row .stat:nth-child(4) { animation-delay: .09s; }
.cards-row .stat:nth-child(5) { animation-delay: .12s; }

.payslip-hero { animation: rise-in .3s ease-out both; }
.netbar > div { transform-origin: left; animation: grow-x .5s cubic-bezier(.22, 1, .36, 1) .12s both; }
.alert { animation: rise-in .22s ease-out both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---------------- điện thoại ---------------- */
@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .topbar { width: 100%; height: auto; position: sticky; top: 0; border-right: 0; border-bottom: 1px solid var(--border); }
  .topbar-inner { flex-direction: row; align-items: center; flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
  .brand { padding: 0; }
  .nav { flex-direction: row; order: 3; width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .nav a { padding: 6px 12px; white-space: nowrap; }
  .userbox { flex-direction: row; border-top: 0; padding-top: 0; margin: 0 0 0 auto; align-items: center; }
  .userbox span { display: none; }
  .userbox .btn { width: auto; }
  .container { padding: 12px 12px 48px; }
  .cards-row { grid-template-columns: repeat(2, 1fr); }
  /* Bảng lương: điện thoại chỉ giữ Tên · Công/Giờ · Thực nhận · Chi tiết.
     Muốn soi đủ cột thì mở trên máy tính. */
  .paytable .m-hide { display: none; }
  .paytable.full .cols-extra { display: none; }
  .paytable tfoot { display: none; }
  #cols-toggle { display: none; }
  .paytable td.sticky-name, .paytable th.sticky-name { min-width: 126px; }
  .payslip-hero { padding: 16px; }
  .payslip-hero .net { font-size: 1.7rem; }
  .form-row { flex-direction: column; gap: 0; }
}

/* ---------------- in / PDF ---------------- */
@media print {
  .topbar, .btn, .alert, footer.app-foot, .no-print, form { display: none !important; }
  body { background: #fff; display: block; }
  .app-shell { display: block; }
  .table-wrap { border: none; box-shadow: none; max-height: none !important; overflow: visible !important; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .grid2 { display: block; }
  .payslip-hero {
    background: #fff !important; color: #111 !important;
    border: 2px solid #0d9488; box-shadow: none; -webkit-print-color-adjust: exact;
  }
  .payslip-hero .net { color: #0d9488; }
}
