/* ============================================================
   EasySign Web - design tokens & layout
   Theo bộ thiết kế trong Design/*.html (sidebar trắng 260px, header
   64px, màu chủ đạo #1E3A8A) - viết lại bằng CSS thuần, font Inter +
   icon Material Symbols tự host trong assets/fonts để chạy offline.
   ============================================================ */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../assets/fonts/inter-vietnamese.woff2) format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../assets/fonts/inter-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../assets/fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Material Symbols Outlined";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url(../assets/fonts/material-symbols-outlined.woff2) format("woff2");
}

.ms {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  user-select: none;
  flex-shrink: 0;
}
.ms.sm { font-size: 16px; }
.ms.xs { font-size: 14px; }
.ms.lg { font-size: 24px; }
.ms.spin { animation: spin 1.2s linear infinite; }

:root {
  --primary: #1e3a8a;
  --primary-hover: #172e6d;
  --accent: #2563eb;
  --primary-soft: #eff6ff;
  --primary-soft-border: #dbeafe;

  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --surface-3: #f3f4f6;
  --border: #e5e7eb;
  --border-strong: #d1d5db;

  --text: #111827;
  --text-2: #374151;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;

  --success: #059669;
  --success-bg: #d1fae5;
  --success-soft: #ecfdf5;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --danger-soft: #fef2f2;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --info: #1e3a8a;
  --info-bg: #dbeafe;
  --neutral-bg: #f3f4f6;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, .08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .16);

  --sidebar-w: 260px;
  --topbar-h: 64px;
  --mono: "JetBrains Mono", Consolas, "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 13.5px;
  -webkit-font-smoothing: antialiased;
}

::selection { background: #dbeafe; color: var(--primary); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; }

button {
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

input, select, textarea {
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 8px 11px;
  width: 100%;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
input[type="checkbox"], input[type="radio"] { width: auto; }
input[type="color"] { padding: 2px; height: 36px; cursor: pointer; }

input:focus, select:focus, textarea:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
input:disabled, select:disabled { opacity: .55; cursor: not-allowed; }

.mono { font-family: var(--mono); }

label.field-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.input-suffix { position: relative; }
.input-suffix input { padding-right: 34px; }
.input-suffix > span {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 11px; color: var(--text-faint); font-family: var(--mono); pointer-events: none;
}

/* ---------- layout shell ---------- */

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  left: 0; top: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 40;
}

.sidebar-brand {
  height: var(--topbar-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.brand-mark {
  width: 36px; height: 36px; border-radius: var(--radius); background: #fff; overflow: hidden;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: var(--shadow); border: 1px solid var(--border);
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
.brand-name { font-size: 17px; font-weight: 700; color: var(--primary); letter-spacing: -.01em; line-height: 1.15; }
.brand-sub { font-size: 11px; font-weight: 500; color: var(--text-muted); }

.sidebar-nav { flex: 1; padding: 14px 12px; overflow-y: auto; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 4px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.sidebar-link .ms { color: var(--text-muted); transition: color .15s; }
.sidebar-link:hover { background: var(--surface-3); text-decoration: none; }
.sidebar-link:hover .ms { color: var(--primary); }
.sidebar-link.active {
  background: linear-gradient(90deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 4px 10px rgba(30, 58, 138, .25);
}
.sidebar-link.active .ms { color: #fff; }

.sidebar-foot {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.sidebar-foot .foot-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sidebar-foot .foot-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.sidebar-foot .foot-cert { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot .foot-ver { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

.main-col { padding-left: var(--sidebar-w); min-width: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar h1 { font-size: 17px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .sub { font-size: 12.5px; color: var(--text-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.topbar .menu-toggle { display: none; }

.lang-toggle {
  display: flex;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px;
}
.lang-toggle button {
  border: none;
  background: transparent;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.lang-toggle button:hover { color: var(--text); }
.lang-toggle button.active { background: var(--surface); color: var(--primary); font-weight: 700; box-shadow: var(--shadow); }

.agent-badge {
  display: flex; align-items: center; gap: 10px;
  padding-left: 16px; border-left: 1px solid var(--border);
}
.agent-badge .agent-icon {
  width: 36px; height: 36px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  background: var(--neutral-bg); color: var(--text-muted);
}
.agent-badge.ok .agent-icon { background: var(--success-soft); color: var(--success); }
.agent-badge.off .agent-icon { background: var(--danger-soft); color: var(--danger); }
.agent-badge .agent-title { font-size: 12.5px; font-weight: 700; color: var(--text); line-height: 1.2; }
.agent-badge .agent-sub { font-size: 11px; color: var(--text-muted); }

.page-content { padding: 28px; 
  /* max-width: 1400px;  */
}
.page-content.full { max-width: none; padding: 0; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  margin-bottom: 22px; flex-wrap: wrap;
}
.page-head h2 { font-size: 20px; color: var(--primary); letter-spacing: -.01em; }
.page-head p { margin: 4px 0 0; font-size: 12.5px; color: var(--text-muted); }
.page-head .actions { display: flex; gap: 8px; }

/* ---------- cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}
.card.tight { padding: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.stack > .card:last-child { margin-bottom: 0; }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.card-head .card-title { margin: 0; }

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px;
}
.card-title .ms { color: var(--primary); }

.card-subtitle { font-size: 12.5px; color: var(--text-muted); margin-bottom: 14px; }

.icon-tile {
  width: 40px; height: 40px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary);
  flex-shrink: 0;
}
.icon-tile.success { background: var(--success-soft); color: var(--success); }
.icon-tile.danger { background: var(--danger-soft); color: var(--danger); }
.icon-tile.warning { background: var(--warning-bg); color: var(--warning); }
.icon-tile.neutral { background: var(--neutral-bg); color: var(--text-muted); }
.icon-tile.sm { width: 32px; height: 32px; }

.card-row { display: flex; gap: 14px; flex-wrap: wrap; }
.card-row > * { flex: 1; min-width: 160px; }

.section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 20px 0 10px;
}
.section-label:first-child { margin-top: 0; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 > .card, .grid-4 > .card, .grid-2 > .card { margin-bottom: 0; }
.mb-20 { margin-bottom: 20px; }

.split { display: grid; gap: 20px; align-items: start; }
.split.left-330 { grid-template-columns: 330px minmax(0, 1fr); }
.split.left-420 { grid-template-columns: 420px minmax(0, 1fr); }
.split.left-480 { grid-template-columns: minmax(0, 480px) minmax(0, 1fr); }
.split.w-8-4 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: stretch; }
.split.w-7-5 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }

@media (max-width: 1100px) {
  .split.left-330, .split.left-420, .split.left-480, .split.w-8-4, .split.w-7-5 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ---------- stat cards ---------- */

.stat-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stat-card .label { font-size: 12.5px; font-weight: 500; color: var(--text-muted); }
.stat-card .value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-card .foot { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.stat-card .icon-tile { width: 44px; height: 44px; border: 1px solid var(--primary-soft-border); }
.stat-card .icon-tile.success { border-color: var(--success-bg); }
.stat-card .icon-tile.danger { border-color: var(--danger-bg); }
.stat-card .icon-tile.warning { border-color: #fde68a; }

.mini-stat { display: flex; align-items: center; gap: 12px; }
.mini-stat .label { font-size: 12px; color: var(--text-muted); }
.mini-stat .value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }

.tile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tile-stat {
  position: relative; overflow: hidden;
  padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border);
}
.tile-stat .label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.tile-stat .value { font-size: 24px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tile-stat .bg-icon { position: absolute; right: -6px; bottom: -8px; font-size: 48px; opacity: .1; }
.tile-stat.success { background: var(--success-soft); border-color: var(--success-bg); }
.tile-stat.success .label, .tile-stat.success .value { color: var(--success); }
.tile-stat.danger { background: var(--danger-soft); border-color: var(--danger-bg); }
.tile-stat.danger .label, .tile-stat.danger .value { color: var(--danger); }

/* ---------- hero (dashboard) ---------- */

.hero-card { border-left: 5px solid var(--primary); display: flex; flex-direction: column; justify-content: space-between; }
.hero-card h3 { font-size: 20px; letter-spacing: -.01em; }
.hero-card p { font-size: 13.5px; color: #4b5563; line-height: 1.6; margin: 6px 0 0; max-width: 640px; }
.hero-tags { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.hero-tag { padding: 2px 10px; border-radius: 4px; background: var(--info-bg); color: var(--primary); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.hero-tag-sub { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.feature-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0; }
.feature-chip {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--surface-3);
  font-size: 12px; font-weight: 500; color: var(--text-2);
}
.feature-chip .ms { color: var(--primary); font-size: 18px; }
@media (max-width: 700px) { .feature-chips { grid-template-columns: 1fr; } }

.kv-list { display: flex; flex-direction: column; gap: 12px; font-size: 12.5px; }
.kv-list .k { font-size: 11px; color: var(--text-muted); display: block; margin-bottom: 2px; }
.kv-list .v { font-weight: 600; color: var(--text); word-break: break-word; }
.kv-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kv-row .k { margin: 0; }

/* ---------- quick actions ---------- */

.quick-action {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 16px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.quick-action:hover { border-color: var(--primary); box-shadow: var(--shadow-md); text-decoration: none; }
.quick-action .qa-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.quick-action .qa-title { font-size: 14px; font-weight: 700; color: var(--text); }
.quick-action .qa-sub { font-size: 12px; color: var(--text-muted); }
.quick-action .icon-tile { transition: background .15s, color .15s; }
.quick-action:hover .icon-tile { background: var(--primary); color: #fff; }
.quick-action:hover .icon-tile.danger { background: var(--danger); }
.quick-action:hover .icon-tile.success { background: var(--success); }
.quick-action .chev { color: var(--text-faint); transition: transform .15s, color .15s; }
.quick-action:hover .chev { color: var(--primary); transform: translateX(2px); }

/* ---------- activity list ---------- */

.activity-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--surface-3); font-size: 12.5px;
}
.activity-row:last-child { border-bottom: none; padding-bottom: 0; }
.activity-row .a-left { display: flex; align-items: flex-start; gap: 12px; min-width: 0; flex: 1; }
.activity-row .a-title { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.activity-row .a-time { font-size: 11px; font-weight: 400; color: var(--text-muted); }
.activity-row .a-path { font-family: var(--mono); font-size: 11px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-row .a-right { display: flex; align-items: center; gap: 22px; flex-shrink: 0; }
.activity-row .a-count { text-align: right; white-space: nowrap; }
.activity-row .a-progress { width: 110px; }
.a-progress .ap-head { display: flex; justify-content: space-between; font-size: 10px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
@media (max-width: 800px) {
  .activity-row { flex-direction: column; align-items: stretch; }
  .activity-row .a-right { justify-content: flex-start; }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  font-weight: 600;
  font-size: 13px;
  background: var(--surface);
  color: var(--text-2);
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn .ms { font-size: 18px; }

.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 1px 2px rgba(30, 58, 138, .2); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }

.btn-soft { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.btn-soft:hover { background: var(--info-bg); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--primary-soft); }
.btn-ghost.danger { color: var(--danger); }
.btn-ghost.danger:hover { background: var(--danger-soft); }

.btn-icon { width: 32px; height: 32px; padding: 0; border-color: transparent; background: transparent; color: var(--text-muted); }
.btn-icon:hover { background: var(--surface-3); color: var(--text); }
.btn-icon.danger:hover { background: var(--danger-soft); color: var(--danger); }

.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-lg { height: 46px; font-size: 14px; font-weight: 700; letter-spacing: .02em; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-sm .ms { font-size: 16px; }
.btn.is-on { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- segmented control ---------- */

.seg { display: flex; background: var(--surface-3); border-radius: var(--radius); padding: 3px; gap: 2px; }
.seg button {
  flex: 1; border: none; background: transparent; border-radius: var(--radius-sm);
  padding: 7px 10px; font-size: 12.5px; font-weight: 500; color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--surface); color: var(--primary); font-weight: 700; box-shadow: var(--shadow); }

/* ---------- pills / badges ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill .dot.pulse { animation: pulse 1.6s ease-in-out infinite; }
.pill-success { background: var(--success-bg); color: var(--success); }
.pill-danger { background: var(--danger-bg); color: var(--danger); }
.pill-info { background: var(--info-bg); color: var(--primary); }
.pill-warning { background: var(--warning-bg); color: var(--warning); }
.pill-neutral { background: var(--neutral-bg); color: var(--text-muted); }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 4px;
  background: var(--surface-3); color: var(--text-muted); font-family: var(--mono);
}
.tag.blue { background: var(--primary-soft); color: var(--accent); border: 1px solid var(--primary-soft-border); font-family: inherit; }

kbd {
  padding: 1px 6px; background: var(--surface-3); border: 1px solid var(--border);
  border-radius: 4px; font-size: 11px; font-family: var(--mono); color: var(--text-2);
}

/* ---------- toggle switch ---------- */

.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider {
  position: absolute; inset: 0; background: var(--border-strong);
  border-radius: 999px; transition: .15s; cursor: pointer;
}
.switch .slider::before {
  content: ""; position: absolute; height: 16px; width: 16px; left: 2px; top: 2px;
  background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(16px); }
.switch input:disabled + .slider { opacity: .5; cursor: not-allowed; }

/* checkbox kiểu ô vuông có dấu tick (thiết kế Ký hàng loạt / Xoá chữ ký / Cài đặt) */
.check {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  font-size: 13px; color: var(--text); padding: 4px 0;
}
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check .box {
  width: 18px; height: 18px; border-radius: 4px; border: 2px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px;
  background: var(--surface); transition: .15s; color: transparent;
}
.check .box .ms { font-size: 14px; font-weight: 700; }
.check input:checked + .box { background: var(--primary); border-color: var(--primary); color: #fff; }
.check input:focus-visible + .box { box-shadow: 0 0 0 3px rgba(37, 99, 235, .25); }
.check:hover .box { border-color: var(--primary); }
.check .check-text { display: flex; flex-direction: column; gap: 2px; }
.check .check-title { font-weight: 500; }
.check:hover .check-title { color: var(--primary); }
.check .check-desc { font-size: 12px; color: var(--text-muted); }
.check-list { display: flex; flex-direction: column; gap: 6px; }
.check-list.divided > .check { padding: 12px 0; border-bottom: 1px solid var(--surface-3); }
.check-list.divided > .check:last-child { border-bottom: none; padding-bottom: 0; }
.check-list.divided > .check:first-child { padding-top: 0; }

.field-toggle-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--surface-3);
}
.field-toggle-row:last-child { border-bottom: none; }
.field-toggle-row .title { font-weight: 500; font-size: 13px; }
.field-toggle-row .grow { flex: 1; }

/* ---------- step cards (Ký hàng loạt / Xoá chữ ký) ---------- */

.step-card { position: relative; margin-top: 12px; }
.step-badge {
  position: absolute; top: -12px; left: -12px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md); transition: transform .15s;
}
.step-card:hover .step-badge { transform: scale(1.08); }
.step-card .card-title { padding-left: 14px; }
.step-card .card-head .card-title { padding-left: 14px; }

.path-box {
  display: flex; align-items: stretch; gap: 8px;
}
.path-box .path-field {
  flex: 1; min-width: 0; background: var(--primary-soft); border-radius: var(--radius);
  padding: 7px 10px; border: 1px solid transparent; transition: border-color .15s;
}
.path-box .path-field:focus-within { border-color: var(--accent); background: var(--surface); }
.path-box .path-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 1px; }
.path-box .path-field input {
  background: transparent; border: none; padding: 0; font-family: var(--mono); font-size: 12px;
  border-radius: 0; box-shadow: none;
}
.path-box .btn { height: auto; min-height: 36px; background: var(--info-bg); border-color: transparent; color: var(--primary); }
.path-box .btn:hover { background: #bfdbfe; }

.detect-note {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  background: rgba(30, 58, 138, .05); color: var(--primary); font-size: 12px; font-weight: 500;
}
.detect-note .ms { font-size: 16px; }
.detect-note.warn { background: var(--warning-bg); color: var(--warning); }

.cfg-box {
  position: relative; overflow: hidden; background: var(--surface-2);
  border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 8px;
}
.cfg-box .bg-icon { position: absolute; right: 6px; bottom: 6px; font-size: 56px; opacity: .04; pointer-events: none; }
.cfg-box .cfg-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; font-size: 12.5px; position: relative; }
.cfg-box .cfg-row .k { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.cfg-box .cfg-row .v { font-weight: 600; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cfg-box .cfg-sep { border-top: 1px solid var(--border); margin: 2px 0; }

/* ---------- progress ---------- */

.progress-track { height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 999px; transition: width .3s; }
.progress-fill.success { background: var(--success); }
.progress-fill.danger { background: var(--danger); }
.progress-fill.warning { background: #f59e0b; }
.progress-fill.running { background: var(--accent); }

.progress-big { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 14px; }
.progress-big .pct { font-size: 32px; font-weight: 700; color: var(--primary); line-height: 1; font-variant-numeric: tabular-nums; }
.progress-meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11px; color: var(--text-muted); font-family: var(--mono); gap: 10px; }

.ring { width: 64px; height: 64px; transform: rotate(-90deg); }
.ring .ring-bg { stroke: var(--border); }
.ring .ring-fg { stroke: var(--primary); transition: stroke-dasharray .3s; }

/* ---------- log ---------- */

.log-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.log-card .log-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted); font-family: var(--mono); }
.live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.live-dot.idle::before { background: var(--text-faint); box-shadow: none; }

.log-list {
  background: #fafafa; padding: 8px; overflow-y: auto; height: 320px;
  display: flex; flex-direction: column; gap: 2px; font-size: 12px;
}
.log-row {
  display: flex; align-items: flex-start; gap: 10px; padding: 6px 8px; border-radius: var(--radius-sm);
}
.log-row:hover { background: var(--primary-soft); }
.log-row .t { font-family: var(--mono); font-size: 11px; color: var(--text-faint); flex-shrink: 0; margin-top: 1px; }
.log-row .ms { font-size: 16px; }
.log-row .f { font-family: var(--mono); font-size: 11px; color: var(--text-muted); flex-shrink: 0; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.log-row .m { min-width: 0; word-break: break-word; color: var(--text); }
.log-row.ok .ms { color: var(--success); }
.log-row.skip .ms { color: var(--warning); }
.log-row.info .ms { color: var(--primary); }
.log-row.fail { background: var(--danger-soft); border-left: 2px solid var(--danger); }
.log-row.fail .ms, .log-row.fail .m { color: var(--danger); }
.log-row.fail .m { font-weight: 600; }
.log-empty { color: var(--text-faint); text-align: center; padding: 30px 10px; font-size: 12px; }

.status-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; min-height: 56px;
}
.status-bar .st { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-faint); }
.status-dot.running { background: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, .6); }
.status-dot.paused { background: #f59e0b; }
.status-dot.done { background: var(--success); }
.status-dot.fail { background: var(--danger); }

/* ---------- table ---------- */

table.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table th {
  text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); padding: 12px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td { padding: 12px 12px; border-bottom: 1px solid var(--surface-3); vertical-align: middle; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tr:last-child td { border-bottom: none; }
.data-table .cell-path { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 11.5px; color: var(--text-2); }
.data-table .cell-date { font-weight: 600; }
.data-table .cell-sub { font-size: 11px; color: var(--text-muted); }
.table-wrap { overflow-x: auto; }

.counts { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.counts .c-ok { color: var(--success); font-weight: 600; }
.counts .c-err { color: var(--danger); font-weight: 600; }
.counts .c-skip { color: var(--warning); font-weight: 600; }

.pager-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-muted);
}
.pager-bar b { color: var(--text); }
.pager { display: flex; gap: 4px; align-items: center; }
.pager button {
  min-width: 30px; height: 30px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); font-size: 12.5px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 6px;
}
.pager button:hover:not(:disabled) { background: var(--surface-2); }
.pager button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager button:disabled { opacity: .45; cursor: not-allowed; }
.pager .gap { padding: 0 4px; color: var(--text-faint); }

.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.filter-bar .search { position: relative; flex: 2; min-width: 220px; }
.filter-bar .search .ms { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-faint); font-size: 18px; }
.filter-bar .search input { padding-left: 36px; }
.filter-bar .dates { display: flex; align-items: center; gap: 8px; }
.filter-bar .dates input { width: 150px; }

/* ---------- menu (dropdown) ---------- */

.menu-wrap { position: relative; display: inline-block; }
.menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 180px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 4px;
}
.menu button {
  display: flex; align-items: center; gap: 8px; width: 100%; border: none; background: transparent;
  padding: 8px 10px; border-radius: var(--radius-sm); font-size: 12.5px; color: var(--text-2); text-align: left;
}
.menu button:hover { background: var(--surface-3); }
.menu button .ms { font-size: 17px; color: var(--text-muted); }

/* ---------- misc ---------- */

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 13px; }
.empty-state > .ms { font-size: 40px; color: var(--text-faint); display: block; margin: 0 auto 8px; }
.hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.hint.warn { color: var(--warning); }
.error-text { font-size: 12.5px; color: var(--danger); margin-top: 6px; }
.alert {
  display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius);
  font-size: 12.5px; margin-top: 10px;
}
.alert .ms { font-size: 18px; }
.alert.danger { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger-bg); }
.alert.warn { background: #fffbeb; color: #b45309; border: 1px solid var(--warning-bg); }
.alert.info { background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary-soft-border); }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.muted { color: var(--text-muted); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .5);
  display: flex; align-items: center; justify-content: center; z-index: 80; padding: 16px;
}
.modal-box {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 22px; max-width: 440px; width: 100%;
}
.modal-box h3 { font-size: 16px; }

/* màn kết nối agent (app.js showConnectScreen) */
.connect-card { max-width: 640px; }
.connect-card .setting-card-head p { font-size: 12.5px; }
.connect-card > .alert { margin-bottom: 16px; }
.connect-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.connect-steps li { display: flex; gap: 14px; align-items: flex-start; }
.connect-steps .cs-num {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 13px;
}
.connect-steps h4 { font-size: 14px; margin: 3px 0 4px; }
.connect-steps p { font-size: 12.5px; color: var(--text-muted); margin: 0 0 10px; line-height: 1.55; }
.connect-steps input { flex: 1; min-width: 0; }
.cs-detect { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.cs-detect .ms { font-size: 16px; }
.cs-detect.ok { color: var(--success); }
.cs-detect.warn { color: var(--warning); }
.connect-foot {
  margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-muted); display: flex; align-items: center; gap: 6px;
}
.connect-foot .ms { font-size: 16px; }

/* license (js/license.js, app.js showLicenseScreen/showFeatureLocked) */
.sidebar-link.locked { opacity: .55; }
.sidebar-link .lock-ic { margin-left: auto; font-size: 15px; }
.lic-or { display: flex; align-items: center; gap: 10px; margin: 14px 0; font-size: 11.5px; color: var(--text-faint); text-transform: uppercase; }
.lic-or::before, .lic-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.lic-features { display: inline-flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.rm-lock {
  width: 56px; height: 56px; border-radius: 50%; margin: 4px auto 14px; display: flex; align-items: center; justify-content: center;
  background: var(--neutral-bg); color: var(--text-muted);
}
.rm-lock .ms { font-size: 28px; }

/* màn kết nối toàn trang, không sidebar (app.js showConnectScreen) */
.auth-page {
  min-height: 100vh; display: flex; flex-direction: column; padding: 20px 40px 18px;
  background:
    radial-gradient(ellipse 60% 55% at 50% 40%, rgba(219, 234, 254, .55) 0%, rgba(239, 246, 255, .35) 45%, rgba(255, 255, 255, 0) 75%),
    var(--surface);
}
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.auth-brand { display: flex; align-items: center; gap: 10px; }
.auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 28px 0; }
.auth-main .connect-card { width: 100%; max-width: 660px; margin: 0; box-shadow: var(--shadow-lg); }
.auth-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap;
  font-size: 12px; color: #94a3b8; font-weight: 500;
}
.auth-foot > span { display: inline-flex; align-items: center; gap: 5px; }
.auth-foot .ms { font-size: 15px; }
.auth-foot a { color: #64748b; text-decoration: underline dotted; }
@media (max-width: 700px) { .auth-page { padding: 16px; } }
.splash { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.splash .brand-mark { width: 64px; height: 64px; border-radius: 18px; }
.splash-text { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); font-weight: 500; }
.splash-text .ms { font-size: 18px; }

/* mã máy (js/license.js mountMachineCode) */
.machine-code { margin: 0 0 16px; padding: 12px 14px; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); }
.machine-code .mc-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.machine-code .mc-label .ms { font-size: 16px; }
.machine-code .mc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.machine-code .mc-value { font-size: 17px; font-weight: 700; letter-spacing: .06em; color: var(--text); user-select: all; }
.machine-code .mc-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; }
.machine-code.compact { margin: 0; padding: 0; border: none; background: none; }
.machine-code.compact .mc-row { justify-content: flex-end; }
.machine-code.compact .mc-value { font-size: 12.5px; letter-spacing: .03em; }

/* banner agent đã cũ (app.js renderAgentBanner) */
.agent-banner {
  display: flex; align-items: center; gap: 12px; padding: 10px 24px; font-size: 12.5px;
  background: var(--warning-bg); color: #92400e; border-bottom: 1px solid #fde68a;
}
.agent-banner > .ms { font-size: 20px; color: var(--warning); }

/* hộp thoại liên hệ hỗ trợ (Util.showSupportDialog) */
.support-modal .modal-box { max-width: 460px; }
.support-modal .sm-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.support-modal .sm-head .icon-tile { background: var(--primary-soft); color: var(--primary); flex-shrink: 0; }
.support-modal .sm-head h3 { margin-bottom: 2px; }
.support-modal .sm-head p { margin: 0; font-size: 12.5px; color: var(--text-muted); }
.support-modal .sm-email {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
}
.support-modal .sm-email .mono { font-size: 13.5px; font-weight: 600; user-select: all; overflow-wrap: anywhere; }
.support-modal .sm-actions { display: flex; flex-direction: column; gap: 8px; }
.support-modal .sm-actions .btn { justify-content: center; text-decoration: none; }
.support-modal .sm-note { font-size: 11.5px; color: var(--text-muted); margin: 12px 0 8px; }

/* modal kết quả khi ký/xoá chữ ký xong (job-runner-ui.js) */
.result-modal .modal-box { text-align: center; max-width: 420px; padding: 28px 24px 22px; }
.result-modal .rm-icon {
  width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
}
.result-modal .rm-icon .ms { font-size: 34px; }
.result-modal .rm-icon.success { background: var(--success-bg); color: var(--success); }
.result-modal .rm-icon.warning { background: var(--warning-bg); color: var(--warning); }
.result-modal .rm-icon.danger { background: var(--danger-bg); color: var(--danger); }
.result-modal h3 { font-size: 18px; margin-bottom: 6px; }
.result-modal .rm-msg { font-size: 13px; color: var(--text-muted); margin: 0 0 18px; }
.result-modal .rm-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.result-modal .rm-stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 4px; }
.result-modal .rm-stat .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.result-modal .rm-stat .l { font-size: 11px; color: var(--text-muted); }
.result-modal .rm-stat.success .v { color: var(--success); }
.result-modal .rm-stat.danger .v { color: var(--danger); }
.result-modal .rm-time { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; justify-content: center; gap: 4px; margin-bottom: 20px; }
.result-modal .rm-time .ms { font-size: 15px; }
.result-modal .rm-actions { display: flex; justify-content: center; gap: 10px; }
.result-modal .rm-actions .btn { min-width: 120px; justify-content: center; }

.toast-wrap {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  display: flex; flex-direction: column; gap: 8px; max-width: 340px;
}
.toast {
  background: var(--text); color: #fff; padding: 10px 14px; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); font-size: 13px;
}
.toast.danger { background: var(--danger); }
.toast.success { background: var(--success); }

/* Dải báo hộp thoại Windows (chọn file/thư mục) đang mở - hộp thoại do
   agent mở nằm NGOÀI trình duyệt nên trang web phải tự nói ra, kẻo
   người dùng tưởng bấm nút không ăn. z-index trên cả modal-backdrop. */
.pending-banner {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 95; display: flex; align-items: center; gap: 12px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-left: 4px solid var(--primary);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 12px 18px; max-width: min(92vw, 460px);
}
.pending-banner .ms { color: var(--primary); font-size: 22px; }
.pending-banner .pb-title { font-size: 13px; font-weight: 600; }
.pending-banner .pb-hint { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---------- cấu hình vùng ký (editor toàn màn hình) ---------- */

.zone-editor { display: flex; height: calc(100vh - var(--topbar-h)); min-height: 520px; }
.zone-side {
  width: 380px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border);
  overflow-y: auto; display: flex; flex-direction: column;
}
.zone-side #side-body { flex: 1; }
.zone-side .side-tabs {
  position: sticky; top: 0; z-index: 2; padding: 12px 16px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.zone-side .side-tabs .ms { font-size: 16px; }
.zone-side .side-foot {
  position: sticky; bottom: 0; z-index: 2; background: var(--surface); border-top: 1px solid var(--border);
  padding: 12px 16px 16px;
}
.zone-side .side-note {
  display: flex; gap: 8px; align-items: flex-start; margin: 12px 16px 0; padding: 8px 10px;
  background: var(--primary-soft); color: #1e40af; border-radius: var(--radius); font-size: 11.5px; line-height: 1.45;
}
.zone-side .side-note .ms { font-size: 16px; flex-shrink: 0; }
.zone-side .field-card { margin-bottom: 8px; }
.zone-side .field-card .fc-body { padding-left: 0; }
.zone-side section { padding: 16px; border-bottom: 1px solid var(--surface-3); }
.zone-side section:last-child { border-bottom: none; padding-bottom: 28px; }
.zone-side .sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.zone-side .sec-title { font-size: 11px; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: .06em; }
.zone-side .field { margin-bottom: 10px; }
.zone-side .field:last-child { margin-bottom: 0; }
.zone-side .grid-2 { gap: 10px; }
.zone-side .grid-2 > * { min-width: 0; }

.preset-item {
  position: relative; padding: 10px 10px 10px 12px; border-radius: var(--radius);
  border: 1px solid var(--border); margin-bottom: 6px; cursor: pointer; background: var(--surface);
  transition: border-color .15s, background .15s;
}
.preset-item:hover { border-color: var(--border-strong); }
.preset-item .p-head { display: flex; align-items: center; gap: 8px; }
.preset-item .ms { font-size: 17px; color: var(--text-muted); }
.preset-item .name { font-weight: 500; font-size: 12.5px; color: #1e293b; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preset-item .meta { font-size: 11px; color: var(--text-muted); margin-top: 3px; padding-left: 25px; }
.preset-item.active { background: var(--primary-soft); border-color: #bfdbfe; border-left: 3.5px solid var(--primary); }
.preset-item.active .ms, .preset-item.active .name { color: var(--primary); font-weight: 700; }
.preset-item.active .meta { color: #3b82f6; font-weight: 500; }

.anchor-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 6px; font-size: 12px;
}
.anchor-item:hover { border-color: var(--border-strong); }
.anchor-item .ms { font-size: 16px; color: var(--text-faint); }
.anchor-item .txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: #334155; }

.zone-work { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #eef2f6; }
.zone-toolbar {
  height: 48px; flex-shrink: 0; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px;
}
.zone-toolbar .tb-group { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.zone-toolbar .tb-val { font-family: var(--mono); font-size: 12px; font-weight: 500; min-width: 48px; text-align: center; }
.zone-toolbar .page-input { width: 44px; height: 26px; text-align: center; padding: 0; font-family: var(--mono); font-weight: 600; font-size: 12px; background: var(--surface); }
.zone-toolbar .sample-path { font-family: var(--mono); font-size: 11px; color: var(--text-muted); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zone-viewport { flex: 1; overflow: auto; padding: 32px; display: flex; align-items: flex-start; justify-content: center; min-height: 0; }
.zone-empty {
  margin: auto; text-align: center; color: var(--text-muted); max-width: 360px;
  background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); padding: 32px 24px;
}
.zone-empty > .ms { font-size: 44px; color: var(--accent); display: block; margin: 0 auto 10px; }
.zone-empty p { font-size: 12.5px; margin: 6px 0 16px; }
.zone-statusbar {
  height: 28px; flex-shrink: 0; background: var(--surface); border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px;
  font-size: 11px; font-family: var(--mono); color: var(--text-muted); white-space: nowrap; overflow: hidden;
}
.zone-statusbar .sep { color: #cbd5e1; margin: 0 8px; }
.zone-statusbar .ok { color: var(--success); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.zone-statusbar .ok .ms { font-size: 13px; }

.zone-canvas-wrap {
  position: relative; display: inline-block; background: #fff; flex-shrink: 0;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .15); border: 1px solid rgba(203, 213, 225, .6);
}
.zone-canvas-wrap img { display: block; max-width: none; }
.zone-rect {
  position: absolute; border: 1.5px solid var(--accent); border-radius: 4px;
  background: rgba(37, 99, 235, .08); cursor: move; box-shadow: var(--shadow);
}
.zone-rect .zone-tag {
  position: absolute; left: -1.5px; bottom: calc(100% + 3px); max-width: 240px;
  padding: 1px 6px; background: var(--accent); color: #fff; font-size: 9px; font-weight: 700;
  border-radius: 3px; display: flex; align-items: center; gap: 3px; white-space: nowrap; overflow: hidden;
  pointer-events: none;
}
.zone-rect .zone-tag .ms { font-size: 11px; }
.zone-rect .zone-dim {
  position: absolute; left: 4px; bottom: 3px; font-family: var(--mono); font-size: 8.5px; color: var(--accent);
  pointer-events: none; white-space: nowrap;
}
.zone-rect .resize-handle {
  position: absolute; width: 9px; height: 9px; background: #fff; border: 1.5px solid var(--accent);
  border-radius: 2px; right: -5px; bottom: -5px; cursor: nwse-resize;
}
.zone-rect .sig-part { position: absolute; pointer-events: none; }
/* Vùng ký "Chỉ hình ảnh": ảnh co vừa khung giữ tỉ lệ, căn giữa - khớp
   PdfSigningService.DrawImageFitted. */
.zone-rect .zone-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.zone-rect .zone-image-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--accent); opacity: .6; pointer-events: none;
}
.zone-rect .sig-text { overflow: hidden; overflow-wrap: anywhere; }
.zone-empty-wrap { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 24px; max-width: 100%; }
.zone-empty-wrap .zone-empty { margin: 0; }
/* Trường tự do trên trang PDF - vẽ đúng như lúc ký (góc trên-trái = điểm
   đặt), viền nét đứt chỉ để nhận biết/kéo, không có trong PDF thật. */
.anchor-box {
  position: absolute; min-width: 10px; min-height: 10px; white-space: nowrap; line-height: normal;
  outline: 1px dashed rgba(220, 38, 38, .75); outline-offset: 1px; background: rgba(220, 38, 38, .05);
  cursor: move;
}
.anchor-box:hover { outline-style: solid; }
.anchor-box.is-image { display: flex; align-items: center; justify-content: center; color: var(--text-faint); }
.anchor-box.is-image img { width: 100%; height: 100%; display: block; pointer-events: none; }

/* Thẻ trường tự do ở panel trái */
.anchor-card {
  padding: 8px; border-radius: var(--radius-sm); background: var(--surface-2);
  border: 1px solid var(--border); margin-bottom: 8px;
}
.anchor-card:hover { border-color: var(--border-strong); }
.anchor-card .anchor-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.anchor-card .anchor-head .seg { flex: 1; }
.anchor-card input[data-anchor-text] { height: 30px; font-size: 12.5px; background: var(--surface); }
.seg.seg-sm { padding: 2px; }
.seg.seg-sm button { padding: 4px 8px; font-size: 11.5px; gap: 4px; }
.style-toggles.sm button { width: 28px; height: 28px; font-size: 12.5px; }
.anchor-color {
  width: 28px; height: 28px; border-radius: 50%; padding: 0; border: 2px solid var(--border);
  overflow: hidden; cursor: pointer; flex-shrink: 0;
}
.anchor-img-drop { width: 72px; height: 72px; }
.anchor-img-drop img { padding: 4px; }

/* xem trước ảnh trang trong trang Ký / Kiểm tra */
.page-thumb { background: #525659; border-radius: var(--radius); overflow: hidden; display: inline-block; max-width: 100%; }
.page-thumb img { display: block; max-width: 100%; }

/* ---------- Thông tin ký ---------- */

.field-card {
  padding: 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border);
  margin-bottom: 10px; transition: border-color .15s;
}
.field-card:hover { border-color: var(--primary); }
.field-card .fc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.field-card .fc-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.field-card .fc-name { font-weight: 600; font-size: 12.5px; }
.field-card .fc-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.field-card:hover .fc-actions { opacity: 1; }
.field-card .fc-body { display: flex; align-items: center; gap: 8px; padding-left: 46px; }
.field-card .fc-body input, .field-card .fc-body select { height: 32px; padding: 4px 8px; font-size: 12px; background: var(--surface); }
.field-card.off .fc-body { opacity: .5; }

.style-toggles { display: flex; gap: 6px; }
.style-toggles button {
  width: 34px; height: 34px; border-radius: var(--radius); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text-2); font-size: 14px;
}
.style-toggles button.on { background: var(--primary); border-color: var(--primary); color: #fff; }

.logo-drop {
  width: 96px; height: 96px; border-radius: var(--radius); border: 2px dashed var(--border-strong);
  background: var(--surface-2); display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; cursor: pointer; flex-shrink: 0; transition: border-color .15s;
}
.logo-drop:hover { border-color: var(--primary); }
.logo-drop img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.logo-drop .ms { color: var(--text-faint); font-size: 30px; }
.logo-drop .logo-overlay {
  position: absolute; inset: 0; background: rgba(0, 0, 0, .5); display: flex; align-items: center; justify-content: center;
  gap: 8px; opacity: 0; transition: opacity .15s;
}
.logo-drop:hover .logo-overlay { opacity: 1; }
.logo-drop .logo-overlay button {
  width: 30px; height: 30px; border-radius: 50%; border: none; background: #fff; color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.logo-drop .logo-overlay button.del { background: var(--danger-bg); color: var(--danger); }

.preview-panel { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.preview-panel .pv-head { height: 48px; border-bottom: 1px solid var(--border); background: var(--surface-2); display: flex; align-items: center; padding: 0 20px; }
.preview-canvas {
  flex: 1; min-height: 320px; display: flex; align-items: center; justify-content: center; padding: 32px; position: relative;
  background-color: #f1f5f9;
  background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
  background-size: 20px 20px;
}
.preview-stamp {
  background: rgba(255, 255, 255, .9); border: 1px dashed var(--border-strong); border-radius: 4px;
  padding: 14px 16px; max-width: 100%; box-shadow: var(--shadow);
}
.preview-hint {
  position: absolute; right: 16px; bottom: 16px; display: flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, .85); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 5px 10px; font-size: 11px; color: var(--text-muted);
}
.preview-hint .ms { font-size: 14px; }

/* ---------- Cài đặt ---------- */

.setting-card-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.setting-card-head h3 { font-size: 14px; }
.setting-card-head p { font-size: 12px; color: var(--text-muted); margin: 3px 0 0; }

.app-info-hero {
  height: 110px; position: relative; display: flex; align-items: flex-end; padding: 16px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%); color: #fff;
}
.app-info-hero::after {
  content: ""; position: absolute; inset: 0; opacity: .15;
  background-image: radial-gradient(circle at 2px 2px, #fff 1px, transparent 0); background-size: 18px 18px;
}
.app-info-hero .brand { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; font-size: 18px; font-weight: 700; }
.app-info-hero .brand-mark { width: 40px; height: 40px; border: none; }
.info-rows { padding: 6px 20px 14px; }
.info-rows .ir { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--surface-3); font-size: 12.5px; }
.info-rows .ir:last-child { border-bottom: none; }
.info-rows .ir .k { display: flex; align-items: center; gap: 8px; color: var(--text-muted); }
.info-rows .ir .k .ms { font-size: 17px; }
.info-rows .ir .v { font-weight: 600; text-align: right; }

/* ---------- Hướng dẫn ---------- */

.quickstart { position: relative; overflow: hidden; }
.quickstart::before {
  content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, .08), transparent 70%);
}
.qs-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; position: relative; }
.qs-step { display: flex; gap: 14px; position: relative; }
.qs-step .num {
  width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: var(--shadow-md);
}
.qs-step h4 { font-size: 13.5px; margin-bottom: 4px; }
.qs-step p { font-size: 12.5px; color: var(--text-muted); line-height: 1.55; margin: 0; }
@media (max-width: 900px) { .qs-steps { grid-template-columns: 1fr; } }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card { display: flex; flex-direction: column; margin-bottom: 0; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.feature-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.feature-card h3 { font-size: 14px; margin: 12px 0 6px; }
.feature-card p { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; margin: 0; flex: 1; }
.feature-card .fc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-family: var(--mono); font-size: 11px; color: var(--text-faint); }
.feature-card .fc-foot .ms { font-size: 16px; transition: transform .15s, color .15s; }
.feature-card:hover .fc-foot .ms { color: var(--primary); transform: translateX(2px); }
.feature-card.wide { grid-column: span 2; }
.feature-card ul { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-direction: column; gap: 8px; }
.feature-card li { display: flex; gap: 8px; font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.feature-card li .ms { font-size: 17px; color: var(--success); margin-top: 1px; }
@media (max-width: 1000px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { .feature-grid { grid-template-columns: 1fr; } .feature-card.wide { grid-column: auto; } }

.help-banner {
  display: flex; align-items: center; gap: 20px; padding: 24px; border-radius: var(--radius-lg); margin-top: 20px;
  background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; position: relative; overflow: hidden;
}
.help-banner::after {
  content: ""; position: absolute; inset: 0; opacity: .12;
  background-image: radial-gradient(circle at 2px 2px, #fff 1px, transparent 0); background-size: 18px 18px;
}
.help-banner > * { position: relative; z-index: 1; }
.help-banner h3 { font-size: 16px; margin-bottom: 4px; }
.help-banner p { font-size: 12.5px; opacity: .9; margin: 0; line-height: 1.55; }
.help-banner .icon-tile { background: rgba(255, 255, 255, .18); color: #fff; width: 48px; height: 48px; }
.help-banner.support { background: var(--surface); color: var(--text); border: 1px solid var(--border); margin-top: 14px; }
.help-banner.support::after { display: none; }
.help-banner.support p { color: var(--text-muted); opacity: 1; }
.help-banner.support .icon-tile { background: var(--primary-soft); color: var(--primary); }
.help-banner .help-mail { flex-shrink: 0; background: var(--primary); color: #fff; border-color: var(--primary); }
@media (max-width: 700px) { .help-banner { flex-wrap: wrap; } }

/* ---------- Kiểm tra chữ ký ---------- */

.sig-card { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.sig-card:hover { border-color: var(--border-strong); }
.sig-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.sig-head > .row:last-child { flex-shrink: 0; }

.viewer-card { position: sticky; top: calc(var(--topbar-h) + 20px); }
.viewer-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
}
.viewer-toolbar .page-input { width: 44px; height: 28px; text-align: center; padding: 0; font-family: var(--mono); font-weight: 600; font-size: 12px; }
.viewer-body {
  position: relative; background: #525659; padding: 20px; max-height: calc(100vh - var(--topbar-h) - 150px);
  overflow: auto; display: flex; justify-content: center; align-items: flex-start;
}
.viewer-page { position: relative; display: inline-block; background: #fff; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); min-height: 200px; min-width: 150px; }
.viewer-page img { display: block; max-width: 100%; height: auto; }
.viewer-page .empty-state { color: var(--text-muted); }
.viewer-foot { display: flex; align-items: center; gap: 6px; padding: 10px 16px; font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--border); min-height: 40px; }
.sig-mark {
  position: absolute; border: 2px dashed rgba(220, 38, 38, .55); background: rgba(220, 38, 38, .05);
  border-radius: 3px; cursor: pointer;
}
.sig-mark span {
  position: absolute; left: -2px; top: -18px; background: rgba(220, 38, 38, .7); color: #fff;
  font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 3px 3px 0 0; white-space: nowrap;
}
.sig-mark.active { border: 2.5px solid var(--danger); background: rgba(220, 38, 38, .1); animation: sigPulse 1.4s ease-out 2; }
.sig-mark.active span { background: var(--danger); }
@keyframes sigPulse { 0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .55); } 100% { box-shadow: 0 0 0 14px rgba(220, 38, 38, 0); } }
@media (max-width: 1100px) { .viewer-card { position: static; } }

.sig-card .sig-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.sig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.sig-grid .k { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.sig-grid .v { font-size: 12.5px; font-weight: 600; word-break: break-word; }
.sig-grid .full { grid-column: span 2; }
@media (max-width: 700px) { .sig-grid { grid-template-columns: 1fr; } .sig-grid .full { grid-column: auto; } }

/* ---------- animations ---------- */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- responsive shell ---------- */

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .main-col { padding-left: 0; }
  .topbar .menu-toggle { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .page-content { padding: 16px; }
  .agent-badge .agent-text { display: none; }
  .zone-editor { flex-direction: column; height: auto; }
  .zone-side { width: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .zone-work { min-height: 600px; }
}

/* ---------- Màn chào mừng (Design/Welcome.html) ---------- */

.welcome {
  min-height: 100vh; display: flex; flex-direction: column;
  padding: 24px 56px 20px; position: relative; overflow: hidden;
  background:
    radial-gradient(ellipse 60% 70% at 72% 50%, rgba(219, 234, 254, .6) 0%, rgba(239, 246, 255, .4) 45%, rgba(255, 255, 255, 0) 75%),
    var(--surface);
}
.welcome-top { display: flex; justify-content: flex-end; }
.welcome-grid > * { min-width: 0; }
.welcome-grid {
  flex: 1; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; align-items: center;
  max-width: 1240px; width: 100%; margin: 0 auto;
}
.welcome-left { max-width: 560px; }
.welcome-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.welcome-logo {
  width: 56px; height: 56px; border-radius: 16px; background: #fff; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 14px rgba(59, 130, 246, .25); border: 1px solid #dbeafe;
}
.welcome-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.welcome-brand-name { font-size: 30px; font-weight: 800; letter-spacing: -.02em; color: #0f172a; }
.welcome .accent { color: #2563eb; }
.welcome h1 { font-size: 40px; line-height: 1.2; font-weight: 800; color: #0f172a; margin-bottom: 12px; letter-spacing: -.02em; }
.welcome-lead { font-size: 15px; line-height: 1.65; color: #64748b; margin: 0 0 32px; }
.welcome-features { display: flex; flex-direction: column; gap: 20px; margin-bottom: 40px; }
.welcome-feature { display: flex; align-items: flex-start; gap: 16px; }
.welcome-feature .icon-tile { width: 44px; height: 44px; border-radius: 12px; color: #2563eb; }
.welcome-feature h2 { font-size: 15px; font-weight: 700; color: #0f172a; margin-bottom: 2px; }
.welcome-feature p { font-size: 13.5px; color: #64748b; margin: 0; line-height: 1.5; }
.welcome-cta {
  display: inline-flex; align-items: center; gap: 8px; border: none; cursor: pointer;
  padding: 13px 28px; border-radius: 999px; background: #2563eb; color: #fff; font-size: 15px; font-weight: 600;
  box-shadow: 0 10px 22px rgba(59, 130, 246, .35); transition: background .15s, box-shadow .15s;
}
.welcome-cta:hover { background: #1d4ed8; box-shadow: 0 12px 26px rgba(59, 130, 246, .45); }
.welcome-cta:active { background: #1e40af; }
.welcome-cta .ms { font-size: 18px; transition: transform .2s; }
.welcome-cta:hover .ms { transform: translateX(4px); }
.welcome-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap;
  font-size: 12px; color: #94a3b8; font-weight: 500; padding-top: 12px;
}
.welcome-foot > span { display: inline-flex; align-items: center; gap: 5px; }
.welcome-foot .ms { font-size: 15px; }
.welcome-foot a { color: #64748b; text-decoration: underline dotted; }
.welcome-foot a:hover { color: #2563eb; }

/* minh hoạ: laptop + PDF + thẻ chứng thư + USB token */
.welcome-right { position: relative; display: flex; align-items: center; justify-content: center; min-height: 400px; }
.welcome-glow {
  position: absolute; width: 440px; height: 440px; border-radius: 50%;
  background: rgba(219, 234, 254, .6); filter: blur(60px); transform: translateX(16px);
}
.welcome-art { position: relative; width: 100%; max-width: 460px; display: flex; flex-direction: column; align-items: center; }
.laptop-screen {
  width: 420px; height: 280px; background: #1a4b8c; border: 4px solid #295b9e; border-bottom: none;
  border-radius: 16px 16px 0 0; padding: 12px 12px 0; box-shadow: 0 20px 40px rgba(15, 23, 42, .2); overflow: hidden;
}
.laptop-inner {
  width: 100%; height: 100%; border-radius: 8px 8px 0 0; display: flex; align-items: flex-end; justify-content: center;
  background: linear-gradient(to bottom, #1b3f73, #255ba4);
}
.doc-sheet {
  width: 250px; height: 280px; background: #fff; border-radius: 12px 12px 0 0; padding: 20px;
  display: flex; flex-direction: column; justify-content: space-between; transform: translateY(12px);
  box-shadow: 0 18px 40px -10px rgba(30, 58, 138, .15), 0 4px 12px -2px rgba(15, 23, 42, .05);
}
.doc-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px; background: #e11d48; color: #fff;
  font-size: 11px; font-weight: 900; letter-spacing: .08em; margin-bottom: 16px;
}
.doc-lines { display: flex; flex-direction: column; gap: 10px; }
.doc-lines i { display: block; height: 8px; border-radius: 999px; background: #e2e8f0; }
.doc-sign {
  position: relative; margin-top: 16px; margin-bottom: 18px; border: 2px dashed #93c5fd; border-radius: 8px; padding: 10px;
  background: rgba(239, 246, 255, .3); display: flex; align-items: center; justify-content: center;
}
.doc-sign-text { font-family: "Brush Script MT", "Segoe Script", cursive; font-size: 30px; font-weight: 700; font-style: italic; color: #2563eb; line-height: 1; }
.doc-sign-check {
  position: absolute; right: -12px; top: -12px; width: 24px; height: 24px; border-radius: 50%;
  background: #2563eb; color: #fff; border: 2px solid #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
}
.doc-sign-check .ms { font-size: 14px; font-weight: 700; }
.laptop-base {
  width: 475px; height: 14px; border-radius: 0 0 12px 12px; border-top: 1px solid #cbd5e1;
  background: linear-gradient(to right, #e2e8f0, #f1f5f9, #e2e8f0); box-shadow: var(--shadow-md);
  display: flex; justify-content: center;
}
.laptop-base div { width: 80px; height: 4px; border-radius: 999px; background: #cbd5e1; margin-top: 2px; }

.float-card {
  position: absolute; left: -24px; top: 96px; z-index: 2; background: #fff; border: 1px solid #f1f5f9;
  border-radius: 16px; padding: 14px 16px; display: flex; align-items: center; gap: 14px;
  box-shadow: 0 12px 30px -4px rgba(37, 99, 235, .12), 0 4px 12px -2px rgba(15, 23, 42, .06);
  animation: floatY 4s ease-in-out infinite;
}
.float-icon {
  width: 40px; height: 40px; border-radius: 12px; background: #3b82f6; color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 12px rgba(59, 130, 246, .3);
}
.float-title { margin: 0; font-size: 12px; font-weight: 700; color: #0f172a; }
.float-state { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 11px; font-weight: 600; color: #475569; }
.float-state .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); box-shadow: 0 0 0 2px #f1f5f9; }
.float-card[data-state="ok"] .dot { background: #10b981; box-shadow: 0 0 0 2px #d1fae5; }
.float-card[data-state="warn"] .dot { background: #f59e0b; box-shadow: 0 0 0 2px #fef3c7; }
.float-card[data-state="off"] .dot { background: var(--danger); box-shadow: 0 0 0 2px var(--danger-bg); }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.usb-token {
  position: absolute; right: 0; bottom: 40px; z-index: 2; display: flex; flex-direction: column; align-items: center;
  transform: rotate(22deg); transform-origin: bottom; filter: drop-shadow(0 16px 20px rgba(15, 23, 42, .3));
}
.usb-pin {
  width: 28px; height: 20px; border: 1px solid #94a3b8; border-bottom: none; border-radius: 4px 4px 0 0;
  background: linear-gradient(to bottom, #e2e8f0, #cbd5e1); display: flex; justify-content: space-around; align-items: center; padding: 0 4px;
}
.usb-pin i { width: 6px; height: 6px; background: #475569; border-radius: 1px; }
.usb-body {
  width: 48px; height: 96px; border-radius: 12px; border: 1px solid #334155; padding: 8px;
  background: linear-gradient(to bottom, #1b3a6b, #12284c);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
}
.usb-body .ridge { width: 24px; height: 2px; background: rgba(255, 255, 255, .2); border-radius: 2px; }
.usb-body .hole { width: 10px; height: 4px; background: rgba(0, 0, 0, .4); border-radius: 999px; }
.usb-logo { width: 24px; height: 24px; border-radius: 4px; background: rgba(59, 130, 246, .8); color: #fff; display: flex; align-items: center; justify-content: center; }
.usb-logo .ms { font-size: 14px; }

@media (max-width: 1000px) {
  .welcome { padding: 20px 24px; }
  .welcome-grid { grid-template-columns: minmax(0, 1fr); }
  .welcome-right { min-height: 360px; margin-top: 12px; }
}
@media (max-width: 560px) {
  .welcome h1 { font-size: 30px; }
  .welcome-right { min-height: 290px; align-items: flex-start; }
  .welcome-art { transform: scale(.7); transform-origin: top center; }
  .welcome-glow { width: 300px; height: 300px; }
}
@media (prefers-reduced-motion: reduce) { .float-card { animation: none; } }
