:root {
  --bg: #e8e1d4;
  --ink: #1c1915;
  --muted: #6f685e;
  --card: #fbf7f1;
  --line: #ddd3c4;
  --sidebar: #241f1b;
  --sidebar-text: #f4efe6;
  --accent: #9c3b1e;
  --accent-ink: #fff8f3;
  --ok: #1d6b43;
  --bad: #9f1239;
  --warn: #9a6700;
  --shadow: 0 16px 40px rgba(48, 32, 14, 0.08);
  --sans: "Segoe UI", sans-serif;
  --mono: Consolas, "Cascadia Mono", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
}

button, input, select, textarea { font: inherit; color: inherit; }

button, .link-button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}

.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.row-actions button { padding: 6px 10px; font-size: 13px; }
button.name-link {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-weight: 700;
  text-decoration: underline;
  text-align: left;
}
button.ghost, a.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  text-decoration: none;
  display: inline-block;
}

button:disabled { opacity: 0.5; cursor: default; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  padding: 10px 12px;
}

textarea { min-height: 140px; resize: vertical; font-family: var(--mono); font-size: 13px; }

label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

[hidden] { display: none !important; }

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.login-card { width: min(440px, 100%); display: grid; gap: 14px; }

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  font-weight: 700;
}

h1, h2, p { margin: 0; }

h1 { font-size: 28px; letter-spacing: -0.03em; }

h2 { font-size: 18px; }

.lede { color: var(--muted); }

.form-grid, .stack { display: grid; gap: 12px; }

.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }

.row > * { flex: 1; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 230px 1fr; }

.side {
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.side .brand { display: flex; gap: 10px; align-items: center; }

.side strong { display: block; }

.side span { color: #cbbfae; font-size: 12px; }

.side nav { display: grid; gap: 4px; }

.side button, .side a {
  text-align: left;
  background: transparent;
  color: var(--sidebar-text);
  border-radius: 8px;
  text-decoration: none;
  padding: 10px 12px;
}

.side button.active, .side a:hover, .side button:hover { background: #3a322b; }

.main { padding: 22px 28px 40px; display: grid; gap: 16px; align-content: start; }

.top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.who { color: var(--muted); }

.notice {
  padding: 10px 12px;
  border-radius: 8px;
  background: #f3e7c8;
}

.notice.error { background: #f8d7df; color: var(--bad); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

.stat { display: grid; gap: 6px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat strong { font-size: 28px; letter-spacing: -0.04em; }
.account-layout .stats { grid-template-columns: 1fr 1fr; }
.account-layout .stats.account-stats { grid-template-columns: repeat(2, 1fr); }
.stat-code strong { font-size: 18px; letter-spacing: 0; word-break: break-all; line-height: 1.35; }
@media (min-width: 900px) {
  .account-layout .stats.account-stats { grid-template-columns: repeat(3, 1fr); }
}
.account-line { display: block; margin: 0 0 6px; color: #111; }
.account-line b { font-weight: 700; }
#activate-note a { color: #e10600; font-weight: 700; }

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
.table-wrap table { min-width: 680px; }

th {
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  padding: 8px 10px;
}

td { padding: 10px; border-top: 1px solid var(--line); vertical-align: top; }

code, .mono { font-family: var(--mono); }

.key-banner {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  background: #f4e2d6;
  border-radius: 12px;
  padding: 12px 14px;
}

.key-banner code { font-size: 18px; letter-spacing: 0.04em; }

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  background: #ece5da;
}

.pill.ok { background: #d9f0e3; color: var(--ok); }
.pill.bad { background: #f8d7df; color: var(--bad); }
.pill.warn { background: #f8ebc8; color: var(--warn); }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.tool-page { max-width: 1100px; margin: 0 auto; padding: 22px; display: grid; gap: 16px; }

.tool-bar, .tool-grid { display: flex; justify-content: space-between; gap: 12px; align-items: center; }

.tool-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }

.steps { display: grid; gap: 14px; }

.invoice { display: grid; gap: 8px; }

.invoice-total { font-size: 28px; letter-spacing: -0.04em; }

.muted { color: var(--muted); }

.site-bar, .site-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px 28px;
}

.site-bar { background: var(--sidebar); color: var(--sidebar-text); }

.site-bar .brand, .site-nav { display: flex; gap: 14px; align-items: center; text-decoration: none; color: inherit; }

.site-bar .brand > div { display: grid; line-height: 1.2; }

.site-bar span { color: #cbbfae; font-size: 13px; }

.site-foot { color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

.site-nav a { color: var(--sidebar-text); text-decoration: none; }

.site-bar .ghost { color: var(--sidebar-text); border-color: #5c5148; }

.site { max-width: 1040px; margin: 0 auto; padding: 28px 20px 64px; display: grid; gap: 28px; }

.hero { display: grid; gap: 14px; padding: 12px 0 8px; }

.eyebrow { margin: 0; color: var(--accent); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; font-size: 13px; }

.hero-copy { max-width: 640px; font-size: 18px; }

.hero-actions, .phones { display: flex; gap: 10px; flex-wrap: wrap; }

.hero-actions a, .phones a {
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  border-radius: 8px;
  padding: 10px 14px;
}

.hero-actions a.ghost, .site-bar a.ghost {
  background: transparent;
}

.section { display: grid; gap: 14px; }

.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.service-grid h3, .train h2 { margin: 0 0 8px; }

.service-grid p, .train p { margin: 0; color: var(--muted); }

.train { display: flex; justify-content: space-between; gap: 16px; align-items: center; }

.site-foot { color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

.auth-switch { display: flex; gap: 8px; flex-wrap: wrap; }

.auth-switch button.active { background: var(--accent); color: var(--accent-ink); }

body.public {
  background: #fff;
  color: #1a1a1a;
  font-family: "Be Vietnam Pro", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

body.public .site-bar {
  background: #3e4348;
  color: #fff;
  border-bottom: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 8px 22px;
  gap: 18px;
}

body.public .site-bar .brand { gap: 10px; color: #fff; text-decoration: none; }
body.public .site-bar .brand strong {
  color: #ff9f1a;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

body.public .brand-mark {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  background: #ff9f1a;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

body.public h1,
body.public h2,
body.public h3 {
  color: #111;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

body.public h1 { font-size: 40px; }

body.public .lede,
body.public .service-grid p,
body.public .train p,
body.public .site-foot,
body.public label { color: #4b4b4b; }

body.public .site-nav { flex: 1; flex-wrap: wrap; gap: 6px 16px; }
body.public .site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}
body.public .site-nav a:hover,
body.public .site-nav a.on { color: #ffd56a; }
.panel { scroll-margin-top: 84px; }
.panel[hidden] { display: none !important; }
.tool-link { margin: 0; font-weight: 700; }
.tool-link a { color: #e10600; }
.tool-points { margin: 8px 0 16px; padding-left: 18px; }
.tool-points li { margin: 4px 0; }
.tool-shots button.thumb img { max-height: none; }
body.public .site-nav svg,
body.public .site-actions svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
body.public .site-actions { display: flex; gap: 8px; margin-left: auto; flex-shrink: 0; }
body.public .site-actions a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f5c400;
  color: #1a1a1a;
  border-radius: 4px;
  padding: 7px 12px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.2;
}
body.public .site-actions a:hover { background: #ffd84a; }
body.public #bar-logout[hidden] { display: none !important; }
body.public.signed-in .bar-guest { display: none !important; }
body.public .bar-member { display: none !important; }
body.public.signed-in .bar-member { display: inline-flex !important; align-items: center; gap: 6px; }

body.public .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 0;
  background: #f0f9ff !important;
  color: #0284c7 !important;
  border: 1px solid #bae6fd !important;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
}

body.public .card {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 16px;
  color: #1a1a1a;
  box-shadow: none;
}

body.public .service-grid h3 {
  color: #0f172a !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  margin: 0 0 8px !important;
  display: flex;
  align-items: center;
  gap: 8px;
}
body.public .service-grid h3::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 18px;
  background: #0284c7;
  border-radius: 2px;
}

.more-photos { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 12px; }
body.public button.thumb {
  width: 100%;
  padding: 0;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  background: #f3f3f3;
  overflow: hidden;
  line-height: 0;
}
button.thumb img { width: 100%; height: auto; max-height: 420px; object-fit: contain; display: block; background: #f3f3f3; }
.train-photos { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.train-photos button.thumb img { height: 210px; max-height: none; object-fit: cover; }
.shop-logo { margin: 0 0 6px; }
.shop-logo svg { width: min(880px, 100%); height: auto; display: block; }
.fb-link { margin: 0; font-weight: 600; }
.fb-link a { color: #111; font-style: italic; word-break: break-all; }
.cap { display: none; }
#photo-view {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: 64px 16px 24px;
  background: rgba(0, 0, 0, 0.86);
  overflow: auto;
}
#photo-view[hidden] { display: none; }
#photo-view img { max-width: min(920px, 100%); max-height: 62vh; object-fit: contain; border-radius: 12px; background: #111; }
#photo-view p { margin: 0; color: #fff; text-align: center; max-width: min(920px, 100%); white-space: pre-wrap; line-height: 1.55; }
body.public #photo-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #fff;
  color: #111;
  border-radius: 999px;
}

/* ===== AUTHENTICATION PORTAL (TÀI KHOẢN) ===== */
.account-layout {
  max-width: 520px !important;
  margin: 0 auto;
  padding: 32px 16px 72px;
}
body.public.signed-in .account-layout {
  max-width: 1040px !important;
}

.auth-container {
  gap: 16px;
}

.auth-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: #f1f5f9;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
}

.auth-tab-btn,
body.public button.auth-tab-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent !important;
  color: #475569 !important;
  border: 0 !important;
  border-radius: 10px !important;
  padding: 10px 8px !important;
  font-weight: 700 !important;
  font-size: 13.5px !important;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: none !important;
  text-decoration: none !important;
  width: 100%;
}
.auth-tab-btn:hover,
body.public button.auth-tab-btn:hover {
  color: #0f172a !important;
  background: rgba(255, 255, 255, 0.6) !important;
}
.auth-tab-btn.active,
body.public button.auth-tab-btn.active {
  background: #ffffff !important;
  color: #0284c7 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
  font-weight: 800 !important;
}

.auth-form-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 32px 26px !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05);
}

.auth-card-head h2 {
  font-size: 22px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  margin: 0 0 6px !important;
  letter-spacing: -0.02em;
}
.auth-card-head .lede {
  font-size: 13.5px !important;
  color: #64748b !important;
  margin: 0 0 20px !important;
  line-height: 1.45;
}

.label-row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.link-subtle {
  color: #0284c7;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
}
.link-subtle:hover {
  color: #0369a1;
  text-decoration: underline;
}

.btn-auth-submit,
body.public button.btn-auth-submit,
body.public form button[type="submit"] {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  color: #ffffff !important;
  border: 0 !important;
  border-radius: 10px !important;
  padding: 13px !important;
  font-size: 15px !important;
  font-weight: 750 !important;
  width: 100% !important;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 8px;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3) !important;
  letter-spacing: 0.02em;
}
.btn-auth-submit:hover,
body.public form button[type="submit"]:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.4) !important;
}

.auth-card-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed #e2e8f0;
  font-size: 13.5px;
  color: #64748b;
  flex-wrap: wrap;
}

.link-action,
body.public button.link-action {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  color: #0284c7 !important;
  font-weight: 750 !important;
  font-size: 13.5px !important;
  cursor: pointer;
  text-decoration: none !important;
  box-shadow: none !important;
  transition: color 0.15s;
}
.link-action:hover,
body.public button.link-action:hover {
  color: #0369a1 !important;
  text-decoration: underline !important;
  transform: none !important;
}

.tool-link-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 16px;
}
.tool-notice-icon {
  font-size: 20px;
  line-height: 1.2;
  color: #f59e0b;
  flex-shrink: 0;
}
.tool-link-notice strong {
  display: block;
  font-size: 12.5px;
  color: #0f172a;
}
.tool-link-notice p {
  font-size: 12px;
  color: #64748b;
  margin: 2px 0 0;
  line-height: 1.4;
}

body.public .site a[href="/tai-khoan"] {
  background: #0284c7;
  color: #fff;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}

body.public .site-bar a.ghost {
  background: #fff;
  color: #0284c7;
  border: 1px solid #0284c7;
}

body.public input,
body.public select,
body.public textarea {
  background: #fff;
  color: #111;
  border-color: #e0e0e0;
  border-radius: 12px;
}

.secret { position: relative; display: block; }
.secret input { padding-right: 46px; }
button.eye {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  padding: 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8eb6ff;
}
button.eye svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
body.public button.eye { background: transparent; border: 0; color: #666; border-radius: 8px; }
body.public button.eye.open { color: #e10600; }

body.public .site-foot { border-top-color: #eee; }

body.public .notice { background: #f6f6f6; color: #222; border-radius: 12px; }

body.public .notice.error { background: #fff1f1; color: #9f1239; }

body.public table { font-size: 14px; }
body.public th { text-align: left; color: #111; font-weight: 700; }
body.public td, body.public th { padding: 8px 6px; border-bottom: 1px solid #eee; }

.device-list { display: flex; flex-direction: column; gap: 12px; }
.device-sheet {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}
.device-sheet-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 10px; }
.device-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.device-cell { border: 1px solid var(--line); border-radius: 8px; padding: 8px; min-width: 0; background: #f7f4ee; }
.device-cell span { display: block; font-size: 11px; font-weight: 700; letter-spacing: .03em; color: var(--muted); }
.device-cell strong { display: block; margin-top: 4px; font-size: 14px; word-break: break-all; }
.result.thanh_cong { color: var(--ok); font-weight: 700; }
.result.that_bai, .result.tu_choi { color: var(--bad); font-weight: 700; }
body.public .device-sheet { border-color: #e6e6e6; border-radius: 16px; }
body.public .device-cell { border-color: #e6e6e6; background: #fafafa; }
body.public .device-cell span { color: #666; }
body.public .device-cell strong { color: #111; }

body.admin {
  background: #f8fafc;
  color: #0f172a;
  font-family: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.admin .login-view {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  place-items: stretch;
  padding: 0;
  background: #f1f5f9;
}

body.admin .login-card {
  place-self: center;
  margin: 24px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

body.admin .admin-topbar {
  background: #0f172a;
  color: #fff;
  display: flex;
  align-items: center;
  padding: 12px 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

body.admin .admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

body.admin .admin-brand strong,
body.admin .side .brand strong {
  display: block;
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

body.admin .admin-brand span,
body.admin .side .brand span {
  display: block;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
}

body.admin .admin-topbar .admin-brand span { color: #94a3b8; }
body.admin .login-card .admin-brand span { color: #64748b; }

body.admin .brand-mark {
  width: 42px;
  min-width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

body.admin .eyebrow {
  display: inline-flex;
  width: fit-content;
  margin: 0;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body.admin h1,
body.admin h2 {
  color: #0f172a;
  font-weight: 800;
  letter-spacing: -0.02em;
}

body.admin h1 { font-size: 24px; line-height: 1.25; margin: 0 0 4px; }
body.admin h2 { font-size: 18px; margin: 0 0 12px; }

body.admin .lede,
body.admin label,
body.admin .who,
body.admin th { color: #64748b; }

body.admin .card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  padding: 22px;
}

body.admin button,
body.admin .link-button {
  background: #0284c7;
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}
body.admin button:hover,
body.admin .link-button:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.35);
}

body.admin button.ghost,
body.admin a.ghost {
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 8px 16px;
  font-weight: 600;
  box-shadow: none;
}
body.admin button.ghost:hover,
body.admin a.ghost:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

body.admin #logout {
  background: #fee2e2 !important;
  color: #dc2626 !important;
  border: 1px solid #fecaca !important;
  border-radius: 10px !important;
  padding: 8px 18px !important;
  font-weight: 700 !important;
}
body.admin #logout:hover {
  background: #dc2626 !important;
  color: #fff !important;
  border-color: #dc2626 !important;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3) !important;
}

body.admin button.name-link {
  background: transparent;
  color: #0284c7;
  border: 0;
  border-radius: 0;
  padding: 0;
  font-weight: 700;
  box-shadow: none;
}
body.admin button.name-link:hover {
  text-decoration: underline;
  color: #0369a1;
  transform: none;
}

body.admin input,
body.admin select,
body.admin textarea {
  background: #fff;
  color: #0f172a;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
body.admin input:focus,
body.admin select:focus,
body.admin textarea:focus {
  border-color: #0284c7;
  outline: none;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

body.admin .side {
  background: #0f172a;
  color: #fff;
  padding: 20px 12px;
  width: 240px;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.08);
}

.nav-group-title {
  color: #475569;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 16px 8px 6px;
  padding-bottom: 2px;
}
.nav-group-title:first-child { margin-top: 4px; }
.nav-icon { font-size: 15px; display: inline-block; width: 20px; text-align: center; }
.nav-link-btn {
  display: flex !important;
  align-items: center;
  gap: 10px;
  background: transparent !important;
  color: #38bdf8 !important;
  border: 1px dashed rgba(56, 189, 248, 0.4) !important;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13.5px;
  padding: 10px 14px !important;
  text-decoration: none;
  transition: all 0.2s ease;
  margin-top: 4px;
}
.nav-link-btn:hover {
  background: rgba(56, 189, 248, 0.1) !important;
  color: #7dd3fc !important;
  border-color: #38bdf8 !important;
  transform: translateX(3px);
}

body.admin .side button,
body.admin .side a:not(.nav-link-btn) {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: #94a3b8;
  border: 0;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13.5px;
  padding: 10px 12px;
  text-align: left;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  box-shadow: none;
  width: 100%;
}

body.admin .side button:hover,
body.admin .side a:not(.nav-link-btn):hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
  transform: translateX(3px);
}

body.admin .side button.active {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  font-weight: 750;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
}

body.admin .notice {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 20px;
}
body.admin .notice.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* 4 STATS CARDS */
body.admin .stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
body.admin .stat {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
body.admin .stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}
body.admin .stat::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3.5px;
}
body.admin .stat:nth-child(1)::before { background: linear-gradient(90deg, #0284c7, #38bdf8); }
body.admin .stat:nth-child(2)::before { background: linear-gradient(90deg, #10b981, #34d399); }
body.admin .stat:nth-child(3)::before { background: linear-gradient(90deg, #8b5cf6, #c084fc); }
body.admin .stat:nth-child(4)::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.stat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.stat-icon {
  font-size: 18px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
}
.stat-hint {
  color: #94a3b8;
  font-size: 11.5px;
  margin-top: 4px;
  display: block;
}

body.admin .stat span {
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
body.admin .stat strong {
  font-size: 32px !important;
  font-weight: 900 !important;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 4px 0 0;
}
body.admin .stat:nth-child(1) strong { color: #0284c7 !important; }
body.admin .stat:nth-child(2) strong { color: #10b981 !important; }
body.admin .stat:nth-child(3) strong { color: #8b5cf6 !important; }
body.admin .stat:nth-child(4) strong { color: #f59e0b !important; }

/* QUICK ACTIONS BAR */
.quick-actions-bar {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 18px !important;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}
.qa-title {
  font-size: 11.5px;
  font-weight: 800;
  color: #475569;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.qa-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}
.qa-btn,
body.admin button.qa-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  background: #f8fafc !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  padding: 7px 12px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: all 0.15s ease;
}
.qa-btn:hover,
body.admin button.qa-btn:hover {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.25) !important;
}

/* 2-COLUMN DASHBOARD GRID */
.dashboard-grid-2col {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.section-title-row h2 { margin: 0 !important; }
.btn-link,
body.admin button.btn-link {
  background: transparent !important;
  color: #0284c7 !important;
  border: 0 !important;
  padding: 0 !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  box-shadow: none !important;
  cursor: pointer;
}
.btn-link:hover,
body.admin button.btn-link:hover {
  text-decoration: underline;
  color: #0369a1 !important;
  transform: none !important;
}

/* PASSWORD CARD COMPACT */
.password-card-compact {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 18px 22px !important;
}
.badge-secure {
  display: inline-block;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 700;
}
.btn-pw-save,
body.admin button.btn-pw-save {
  padding: 10px 20px !important;
  white-space: nowrap;
  height: 42px;
}

@media (max-width: 1100px) {
  .dashboard-grid-2col { grid-template-columns: 1fr; }
}

/* ===== EVENTS AUDIT LOG ENHANCEMENT ===== */
.ev-filter-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.ev-tabs-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ev-tab-btn,
body.admin button.ev-tab-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  background: #ffffff !important;
  color: #334155 !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 8px !important;
  padding: 7px 14px !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03) !important;
}
.ev-tab-btn:hover,
body.admin button.ev-tab-btn:hover {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  transform: translateY(-1px);
}
.ev-tab-btn.active,
body.admin button.ev-tab-btn.active {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35) !important;
}
.ev-search-row {
  display: flex;
  gap: 10px;
}
.events-table td {
  vertical-align: middle;
}

/* TABLES */
body.admin table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
body.admin th {
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 14px;
  border-bottom: 1.5px solid #e2e8f0;
  text-align: left;
}
body.admin td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  border-top: none;
  color: #1e293b;
}
body.admin tr:hover td {
  background: #f8fafc;
}

body.admin .pill {
  display: inline-block;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 700;
}
body.admin .pill.ok { background: #dcfce7; color: #15803d; }
body.admin .pill.bad { background: #fee2e2; color: #b91c1c; }
body.admin .pill.warn { background: #fef3c7; color: #b45309; }

body.admin .key-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 600;
}

body.admin .device-sheet,
body.admin .device-cell { border-color: #e2e8f0; }
body.admin .device-cell { background: #f8fafc; }

@media (max-width: 900px) {
  .shell, .tool-grid, .stats, .settings-grid, .service-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .train { flex-direction: column; align-items: flex-start; }
  body.public .site-bar { flex-wrap: wrap; align-items: center; }
  body.public .site-actions { margin-left: 0; }
  .device-grid { grid-template-columns: 1fr 1fr; }
}

#panel-oldkeys {
  background: #0b0f14;
  color: #edf2f7;
  border-radius: 12px;
  padding: 16px;
  display: grid;
  gap: 10px;
}
#panel-oldkeys .ok-head h2 { margin: 0; color: #f2c94c; font-size: 22px; }
#panel-oldkeys .ok-head p { margin: 4px 0 0; color: #8793a3; }
#panel-oldkeys .ok-card {
  background: #151a21;
  border: 1px solid #394553;
  border-radius: 10px;
  padding: 12px 14px;
}
#panel-oldkeys .ok-card-title { font-weight: 700; margin-bottom: 8px; }
#panel-oldkeys .ok-card-title span,
#panel-oldkeys .ok-split span { color: #8793a3; font-weight: 400; font-size: 13px; margin-left: 10px; }
#panel-oldkeys .ok-split { margin-top: 14px; }
#panel-oldkeys .ok-grid { display: grid; gap: 10px; align-items: end; }
#panel-oldkeys .ok-activate { grid-template-columns: 1.1fr 0.8fr 1.6fr 0.9fr; }
#panel-oldkeys .ok-replace { grid-template-columns: 1.4fr 1.4fr auto 1.2fr auto; }
#panel-oldkeys label { display: grid; gap: 4px; color: #8793a3; font-size: 12px; font-weight: 700; }
#panel-oldkeys input,
#panel-oldkeys select {
  background: #0b0f14;
  color: #edf2f7;
  border: 1px solid #394553;
  border-radius: 6px;
  padding: 8px 10px;
}
#panel-oldkeys input.mono { color: #f2c94c; font-family: Consolas, monospace; }
#panel-oldkeys #ok-new-key { color: #59c878; }
#panel-oldkeys button {
  background: #f2c94c;
  color: #101318;
  border-radius: 6px;
  padding: 8px 12px;
  font-weight: 700;
}
#panel-oldkeys button.grey { background: #252e3a; color: #edf2f7; }
#panel-oldkeys button.blue { background: #2a4365; color: #ebf8ff; }
#panel-oldkeys button.green { background: #22543d; color: #f0fff4; }
#panel-oldkeys button.yellow { background: #744210; color: #fffff0; }
#panel-oldkeys button.warn { background: #7b341e; color: #fffaf0; }
#panel-oldkeys button.danger { background: #742a2a; color: #fff5f5; }
#panel-oldkeys .ok-actions { display: flex; gap: 8px; margin-top: 10px; }
#panel-oldkeys .ok-clusters { display: flex; flex-wrap: wrap; gap: 8px; }
#panel-oldkeys .ok-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  background: #181f28;
  border: 1px solid #2a3440;
  border-radius: 6px;
  padding: 6px;
}
#panel-oldkeys .ok-cluster b { color: #8793a3; font-size: 12px; min-width: 52px; }
#panel-oldkeys .ok-find { display: flex; gap: 8px; }
#panel-oldkeys .ok-find input { flex: 1; border-color: #f2c94c; font-size: 16px; }
#panel-oldkeys .ok-status { color: #59c878; font-weight: 700; margin: 8px 0; }
#panel-oldkeys .ok-status.bad { color: #df5b63; }
#panel-oldkeys .ok-table-wrap { overflow: auto; max-height: 520px; border: 1px solid #2a3440; }
#panel-oldkeys table { width: 100%; border-collapse: collapse; min-width: 860px; }
#panel-oldkeys th,
#panel-oldkeys td { border-bottom: 1px solid #2a3440; padding: 8px 10px; text-align: left; color: #edf2f7; }
#panel-oldkeys th { color: #8793a3; background: #121820; position: sticky; top: 0; }
#panel-oldkeys tr { cursor: pointer; }
#panel-oldkeys tr.odd td { background: #12171e; }
#panel-oldkeys tr.selected td { background: #3a3220; color: #f2c94c; }
#panel-oldkeys tr.off td { color: #df5b63; }
#panel-oldkeys tr.warn td { color: #f6ad55; }
@media (max-width: 1100px) {
  #panel-oldkeys .ok-activate,
  #panel-oldkeys .ok-replace { grid-template-columns: 1fr; }
}

/* ===== FLOATING CONTACT WIDGET ===== */
.floating-contact {
  position: fixed;
  right: 18px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
}
.float-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 10px;
  border-radius: 30px;
  color: #fff !important;
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}
.float-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.float-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.float-call {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  animation: floatPulse 2.5s infinite;
}
.float-zalo {
  background: linear-gradient(135deg, #0068ff 0%, #0052cc 100%);
}
.float-zalo .zalo-icon-txt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #0068ff;
  font-weight: 900;
  font-size: 10px;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  letter-spacing: -0.05em;
}
.float-fb {
  background: linear-gradient(135deg, #1877f2 0%, #0c63d4 100%);
}
@keyframes floatPulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
}

@media (max-width: 600px) {
  .floating-contact { right: 12px; bottom: 16px; gap: 8px; }
  .float-btn { padding: 8px; border-radius: 50%; width: 44px; height: 44px; justify-content: center; }
  .float-btn .float-label { display: none; }
  .float-btn svg { width: 22px; height: 22px; }
}

/* ===== FOOTER MODERN ===== */
body.public .site-foot {
  background: #181d24;
  color: #cbd5e1;
  padding: 36px 24px 30px;
  border-top: 1px solid #2d3748;
  display: block;
}
.foot-wrap {
  max-width: 1040px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1.2fr 1fr;
  gap: 28px;
  width: 100%;
}
.foot-col strong {
  display: block;
  color: #fff;
  font-size: 16px;
  margin-bottom: 8px;
}
.foot-col p {
  margin: 4px 0 8px;
  font-size: 14px;
  color: #94a3b8;
  line-height: 1.5;
}
.foot-copy {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  font-size: 13px;
  color: #64748b;
}
.foot-sub { font-size: 12px; color: #475569; margin: 4px 0 0; }

/* ===== HERO TOP BADGE & QUICK HIGHLIGHTS ===== */
.hero-top-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f0f9ff !important;
  border: 1px solid #bae6fd !important;
  color: #0369a1 !important;
  font-size: 12.5px;
  font-weight: 800;
  padding: 7px 18px;
  border-radius: 999px;
  margin: 0 auto 12px;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.08);
}
.hero-top-badge span:not(.live-dot) {
  color: #0369a1 !important;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

/* Hero CTA Buttons */
.btn-hero {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px !important;
  border-radius: 999px !important;
  font-weight: 750 !important;
  font-size: 15px !important;
  text-decoration: none !important;
  transition: all 0.2s ease !important;
}
.btn-hero.primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #fff !important;
  border: 1px solid #10b981 !important;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35) !important;
}
.btn-hero.secondary {
  background: #ffffff !important;
  color: #1e293b !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}
.btn-hero.zalo-btn {
  background: linear-gradient(135deg, #0068ff 0%, #0052cc 100%) !important;
  color: #fff !important;
  border: 1px solid #0068ff !important;
  box-shadow: 0 4px 16px rgba(0, 104, 255, 0.35) !important;
}
.btn-hero:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

/* Trust Grid 4 columns */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
  padding-top: 20px;
  border-top: 1px dashed #e2e8f0;
}
.trust-item,
body.public button.trust-item {
  display: flex !important;
  align-items: center;
  gap: 12px;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 14px !important;
  padding: 12px 16px !important;
  text-align: left;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
}
.trust-item:hover,
body.public button.trust-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.12) !important;
  border-color: #0284c7 !important;
  background: #f8fafc !important;
}
.trust-icon {
  font-size: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: #f0f9ff;
  border-radius: 10px;
}
.trust-item strong {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
}
.trust-item small {
  display: block;
  font-size: 11.5px;
  color: #64748b;
  margin-top: 2px;
}

/* Tab Switcher (To, đẹp, nổi bật) */
.tab-switcher {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  background: #f1f5f9;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  margin: 20px 0 28px;
}
.tab-pill,
body.public button.tab-pill {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 14px !important;
  padding: 14px 20px !important;
  font-weight: 800 !important;
  font-size: 15px !important;
  color: #334155 !important;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}
.tab-pill:hover,
body.public button.tab-pill:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.tab-pill.active,
body.public button.tab-pill.active,
.tab-pill.on,
body.public button.tab-pill.on {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.35) !important;
  transform: translateY(-1px);
}
.tab-pill .pill-icon { font-size: 20px; }

/* Service Cards Enhancement */
body.public .card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
body.public .service-grid .card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  border-color: #cbd5e1;
}

/* Đào tạo học viên Banner */
.train-banner {
  background: radial-gradient(circle at top right, rgba(238, 61, 150, 0.08) 0%, #fff 60%);
  border: 1px solid #fbcfe8 !important;
  padding: 24px !important;
}
.train-badge {
  display: inline-block;
  background: #fdf2f8;
  color: #db2777;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
  letter-spacing: 0.05em;
}
.train-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}
.feat-pill {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}
.phone-title { font-size: 12px; font-weight: 800; color: #64748b; letter-spacing: 0.04em; margin-bottom: 8px; display: block; }
.btn-phone {
  display: block;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  background: #10b981;
  color: #fff !important;
  text-align: center;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.btn-phone.ghost {
  background: #fff;
  color: #1a1a1a !important;
  border: 1px solid #cbd5e1;
  box-shadow: none;
  margin-top: 8px;
}

/* ===== TOOL HERO CARD (CYBER TECH MODERN) ===== */
.tool-hero-card {
  background: radial-gradient(120% 120% at 50% 0%, #1e293b 0%, #0b1120 100%);
  border: 1px solid #334155;
  border-radius: 20px;
  padding: 32px 28px;
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
}
.tool-hero-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #38bdf8, #818cf8, #ee3d96);
}
.tool-tag-badge {
  display: inline-block;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  font-size: 11px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 20px;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.tool-main-heading {
  font-size: 32px !important;
  font-weight: 900 !important;
  color: #fff !important;
  margin: 0 0 10px !important;
  letter-spacing: -0.02em;
}
.tool-main-lede {
  color: #94a3b8 !important;
  font-size: 16px !important;
  max-width: 720px;
  line-height: 1.5;
  margin: 0 0 18px !important;
}
.tool-spec-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.chip-item {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
}

/* Tool CTA Buttons */
.tool-cta-group {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.btn-tool-dl {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-tool-dl .btn-icon {
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-tool-dl .btn-text strong {
  display: block;
  font-size: 14px;
  line-height: 1.2;
}
.btn-tool-dl .btn-text small {
  display: block;
  font-size: 11px;
  opacity: 0.85;
  margin-top: 3px;
}
.btn-tool-dl.primary {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff !important;
  border: 1px solid #38bdf8;
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.4);
}
.btn-tool-dl.secondary {
  background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
  color: #fff !important;
  border: 1px solid #2dd4bf;
}
.btn-tool-dl.outline {
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0 !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.btn-tool-dl:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.tool-trial-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 10px;
  padding: 10px 16px;
  margin-top: 20px;
}
.alert-icon { font-size: 22px; flex-shrink: 0; }
.tool-trial-alert p { margin: 0; color: #fbbf24; font-size: 13px; font-weight: 600; }

/* ===== FEATURES SECTION ===== */
.tool-features-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 28px;
  margin-top: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}
.features-head h3 {
  font-size: 22px !important;
  color: #0f172a !important;
  margin: 0 0 6px !important;
}
.features-sub {
  color: #64748b;
  font-size: 14px;
  margin: 0 0 20px;
}
.features-grid-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.tool-points {
  list-style: none;
  padding: 0;
  margin: 16px 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.tool-points li {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tool-points li::before {
  content: "✓";
  color: #10b981;
  font-weight: 900;
}
.feat-card {
  display: flex;
  gap: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  transition: all 0.2s ease;
}
.feat-card:hover {
  border-color: #cbd5e1;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}
.feat-icon-wrap {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.feat-card-body strong {
  display: block;
  font-size: 15px;
  color: #0f172a;
  margin-bottom: 4px;
}
.feat-card-body p {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.45;
}
.tool-extra-box {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: #475569;
}
.tool-extra-box p { margin: 0; }
.tool-contact-line a { font-weight: 700; color: var(--site-accent, #ee3d96); }

/* ===== DRIVERS BUNDLE SECTION (3 CARDS HORIZONTAL) ===== */
.drivers-bundle-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 28px;
  margin-top: 20px;
}
.drivers-head h3 {
  font-size: 20px !important;
  color: #0f172a !important;
  margin: 0 0 6px !important;
}
.drivers-head p {
  color: #64748b;
  font-size: 14px;
  margin: 0 0 20px;
}
.drivers-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.driver-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}
.driver-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  border-color: #cbd5e1;
}
.driver-card.highlight {
  border-color: #e2e8f0;
}
.driver-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.driver-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: 0.04em;
}
.driver-badge.mtk { background: #fee2e2; color: #dc2626; }
.driver-badge.apple { background: #f3e8ff; color: #9333ea; }
.driver-badge.adb { background: #dcfce7; color: #16a34a; }
.driver-size { font-size: 12px; font-weight: 700; color: #64748b; }
.driver-card h4 {
  font-size: 15px;
  margin: 0 0 6px;
  color: #0f172a;
}
.driver-card p {
  font-size: 13px;
  color: #64748b;
  line-height: 1.45;
  margin: 0 0 16px;
  flex: 1;
}
.btn-download-driver {
  display: block;
  background: #0284c7;
  color: #fff !important;
  text-align: center;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s ease;
}
.btn-download-driver.apple-btn {
  background: #7c3aed;
}
.btn-download-driver:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.tool-gallery-head {
  margin: 28px 0 14px;
}
.tool-gallery-head h3 {
  font-size: 20px !important;
  margin: 0 0 4px !important;
  color: #0f172a !important;
}
.tool-gallery-head p {
  color: #64748b;
  font-size: 14px;
  margin: 0;
}

/* Footer Địa chỉ */
.foot-address-box { margin-top: 12px; }
.addr-main { font-size: 14px; color: #f1f5f9; display: flex; align-items: flex-start; gap: 6px; }
.addr-old { margin-top: 2px; color: #94a3b8; font-size: 12px; }
.btn-maps {
  display: inline-block;
  background: rgba(238, 61, 150, 0.15);
  color: var(--site-accent, #ee3d96) !important;
  border: 1px solid rgba(238, 61, 150, 0.35);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  margin-top: 6px;
  transition: all 0.2s ease;
}
.btn-maps:hover {
  background: var(--site-accent, #ee3d96);
  color: #fff !important;
}

/* ===== PHOTO GRID INSIDE SERVICE CARDS ===== */
.service-grid .more-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}
.service-grid button.thumb {
  aspect-ratio: 1 / 1;
  height: auto;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  transition: transform 0.15s, border-color 0.15s;
  cursor: pointer;
  padding: 0;
  display: block;
}
.service-grid button.thumb:hover {
  transform: scale(1.04);
  border-color: #0284c7;
}
.service-grid button.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ===== TABLET RESPONSIVE (641px - 1024px) ===== */
@media (max-width: 1024px) {
  .service-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px;
  }
  .features-grid-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .shell, .tool-grid, .stats, .settings-grid { grid-template-columns: 1fr; }
  .trust-grid { grid-template-columns: 1fr 1fr; }
  .train-features { grid-template-columns: 1fr 1fr; }
  .drivers-cards-grid { grid-template-columns: 1fr; }
  .foot-wrap { grid-template-columns: 1fr; gap: 20px; }
  .foot-copy { justify-content: flex-start; }
}

/* ===== MOBILE RESPONSIVE (<= 640px) ===== */
@media (max-width: 640px) {
  body.public .site-bar {
    padding: 10px 14px;
    gap: 10px;
    flex-wrap: wrap;
  }
  body.public .site-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    white-space: nowrap;
    padding: 4px 0;
    gap: 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  body.public .site-nav::-webkit-scrollbar {
    display: none;
  }
  body.public .site-nav a {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    font-size: 13px;
    flex-shrink: 0;
  }
  body.public .site-nav a.on {
    background: #0284c7;
    color: #fff;
  }

  /* Hero Section */
  .site { padding: 18px 14px 48px; gap: 20px; }
  .hero-top-badge { font-size: 10.5px; padding: 5px 10px; text-align: center; }
  .hero-copy { font-size: 15px; }
  .hero-actions { flex-direction: column; width: 100%; gap: 10px; }
  .btn-hero { width: 100%; padding: 12px 18px !important; font-size: 14.5px !important; }

  /* 4 Trust Badges - 2 Columns on Mobile */
  .trust-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .trust-item, body.public button.trust-item {
    padding: 10px 12px !important;
    gap: 8px;
    border-radius: 12px !important;
  }
  .trust-icon {
    width: 32px;
    height: 32px;
    font-size: 18px;
    border-radius: 8px;
  }
  .trust-item strong { font-size: 12px; }
  .trust-item small { font-size: 10px; }

  /* 3 Big Tabs */
  .tab-switcher {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 6px;
    border-radius: 14px;
    margin: 16px 0 20px;
  }
  .tab-pill, body.public button.tab-pill {
    padding: 12px 14px !important;
    font-size: 14px !important;
    border-radius: 10px !important;
  }

  /* Service Cards */
  .service-grid {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }
  .service-grid .card {
    padding: 16px !important;
  }
  .service-grid .more-photos {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  /* Training Section */
  .train-banner { padding: 18px 14px !important; }
  .train-features { grid-template-columns: 1fr 1fr; gap: 6px; }
  .feat-pill { font-size: 12px; padding: 6px 10px; }
  .train-photos { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .train-photos button.thumb img { height: 130px; }

  /* Tool Section */
  .tool-hero-card { padding: 22px 16px !important; border-radius: 16px !important; }
  .tool-main-heading { font-size: 24px !important; }
  .tool-main-lede { font-size: 14px !important; }
  .tool-cta-group { flex-direction: column; width: 100%; gap: 10px; }
  .btn-tool-dl { width: 100%; padding: 12px 16px !important; }
  .btn-tool-dl .btn-text strong { font-size: 13px; }
  .btn-tool-dl .btn-text small { font-size: 10.5px; }
  .features-grid-cards { grid-template-columns: 1fr; gap: 10px; }
  .drivers-cards-grid { grid-template-columns: 1fr; gap: 10px; }
  .tool-shots { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .tool-shots button.thumb img { height: 130px; }

  /* Footer */
  body.public .site-foot { padding: 24px 16px; }
  .foot-wrap { gap: 18px; }
  .addr-main { font-size: 13.5px; }

  /* Floating Contact */
  .floating-contact { right: 12px; bottom: 16px; gap: 8px; }
  .float-btn { padding: 8px; border-radius: 50%; width: 44px; height: 44px; justify-content: center; }
  .float-btn .float-label { display: none; }
  .float-btn svg { width: 22px; height: 22px; }

  /* Lightbox */
  #photo-view { padding: 50px 10px 20px; }
  #photo-view img { max-height: 55vh; }
  #photo-view p { font-size: 13px; }
}


