/* ecbanquet UI v2 — Bootstrap 5 brand layer.
   Load after bootstrap.min.css, bootstrap-icons, and tokens.css. */

body.ui-v2 {
  margin: 0;
  background: var(--surface-alt);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: .9rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  --bs-body-bg: var(--surface-alt);
  --bs-body-color: var(--ink);
  --bs-border-color: var(--line);
  --bs-secondary-color: var(--ink-muted);
  --bs-emphasis-color: var(--ink);
  --bs-link-color: var(--brand-600);
  --bs-link-hover-color: var(--brand-700);
  --bs-primary: var(--brand-600);
  --bs-primary-rgb: 15, 107, 102;
}

[data-bs-theme="dark"] body.ui-v2 {
  --bs-body-bg: var(--surface-alt);
  --bs-body-color: var(--ink);
  --bs-border-color: var(--line);
  --bs-secondary-color: var(--ink-muted);
  --bs-emphasis-color: var(--ink);
  --bs-link-color: var(--brand-500);
  --bs-link-hover-color: var(--brand-700);
  --bs-primary: var(--brand-500);
  --bs-primary-rgb: 22, 130, 123;
}

body.ui-v2 h1,
body.ui-v2 h2,
body.ui-v2 h3,
body.ui-v2 h4,
body.ui-v2 h5,
body.ui-v2 h6 {
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -.015em;
  text-wrap: balance;
}

body.ui-v2 a { text-underline-offset: 3px; }
body.ui-v2 ::selection { background: var(--brand-100); color: var(--ink); }

body.ui-v2 :focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
}

body.ui-v2 .skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 2000;
  padding: 10px 14px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  transition: top .15s ease;
}
body.ui-v2 .skip-link:focus { top: 12px; }

body.ui-v2 .mono,
body.ui-v2 .code-chip {
  font-family: var(--font-mono);
  font-size: .82em;
  font-variant-numeric: tabular-nums;
}
body.ui-v2 .code-chip {
  display: inline-block;
  padding: .18em .5em;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-alt);
  color: var(--ink-soft);
}
body.ui-v2 code { color: var(--brand-700); }
[data-bs-theme="dark"] body.ui-v2 .text-primary { color: var(--brand-500) !important; }
[data-bs-theme="dark"] body.ui-v2 .btn-outline-secondary {
  --bs-btn-color: var(--ink-soft);
  --bs-btn-border-color: var(--line);
  --bs-btn-hover-bg: var(--surface-alt);
  --bs-btn-hover-color: var(--ink);
  --bs-btn-hover-border-color: var(--brand-500);
}
body.ui-v2 .text-muted { color: var(--ink-muted) !important; }
body.ui-v2 .text-soft { color: var(--ink-soft); }
body.ui-v2 .divider { height: 1px; background: var(--line); border: 0; margin: 1rem 0; }
body.ui-v2 .surface-muted { background: var(--surface-alt); }
body.ui-v2 .rounded-app { border-radius: var(--radius) !important; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
body.ui-v2 .btn {
  --bs-btn-border-radius: var(--radius-sm);
  --bs-btn-font-weight: 600;
  --bs-btn-focus-box-shadow: var(--focus-ring);
  font-size: .86rem;
  padding: .52rem .9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  white-space: nowrap;
}
body.ui-v2 .btn-sm { font-size: .78rem; padding: .34rem .62rem; }
body.ui-v2 .btn-lg { font-size: .95rem; padding: .7rem 1.15rem; }
body.ui-v2 .btn-primary {
  --bs-btn-bg: var(--brand-600);
  --bs-btn-border-color: var(--brand-600);
  --bs-btn-hover-bg: var(--brand-700);
  --bs-btn-hover-border-color: var(--brand-700);
  --bs-btn-active-bg: var(--brand-700);
  --bs-btn-active-border-color: var(--brand-700);
  --bs-btn-color: #fff;
  --bs-btn-hover-color: #fff;
  --bs-btn-active-color: #fff;
}
body.ui-v2 .btn-outline-primary {
  --bs-btn-color: var(--brand-600);
  --bs-btn-border-color: var(--brand-500);
  --bs-btn-hover-bg: var(--brand-600);
  --bs-btn-hover-border-color: var(--brand-600);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--brand-700);
  --bs-btn-active-border-color: var(--brand-700);
}
body.ui-v2 .btn-light {
  --bs-btn-bg: var(--surface);
  --bs-btn-border-color: var(--line);
  --bs-btn-color: var(--ink-soft);
  --bs-btn-hover-bg: var(--surface-alt);
  --bs-btn-hover-border-color: var(--line);
  --bs-btn-hover-color: var(--ink);
  --bs-btn-active-bg: var(--surface-alt);
  --bs-btn-active-border-color: var(--line);
  --bs-btn-active-color: var(--ink);
}
body.ui-v2 .btn-accent {
  background: var(--accent-500);
  border-color: var(--accent-500);
  color: #1a1206;
}
body.ui-v2 .btn-accent:hover,
body.ui-v2 .btn-accent:focus {
  background: var(--accent-600);
  border-color: var(--accent-600);
  color: #fff;
}
body.ui-v2 .btn-soft {
  background: var(--brand-050);
  border: 1px solid transparent;
  color: var(--brand-700);
}
body.ui-v2 .btn-soft:hover { background: var(--brand-100); color: var(--brand-700); }
body.ui-v2 .btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}
body.ui-v2 .btn-icon.btn-sm { width: 30px; height: 30px; }
body.ui-v2 .btn-icon i { font-size: 1rem; line-height: 1; }
body.ui-v2 .btn:disabled,
body.ui-v2 .btn.disabled { opacity: .6; }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
body.ui-v2 .form-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: .35rem;
}
body.ui-v2 .form-label .req { color: var(--danger); margin-left: .15rem; }
body.ui-v2 .form-control,
body.ui-v2 .form-select {
  background-color: var(--surface);
  border-color: var(--line);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: .52rem .72rem;
  font-size: .88rem;
  min-height: 38px;
}
body.ui-v2 .form-control::placeholder { color: var(--ink-muted); opacity: .8; }
body.ui-v2 .form-control:focus,
body.ui-v2 .form-select:focus {
  background-color: var(--surface);
  border-color: var(--brand-500);
  color: var(--ink);
  box-shadow: var(--focus-ring);
}
body.ui-v2 .form-control:disabled,
body.ui-v2 .form-select:disabled {
  background: var(--surface-alt);
  color: var(--ink-muted);
}
body.ui-v2 .form-text { font-size: .76rem; color: var(--ink-muted); }
body.ui-v2 .invalid-feedback { font-size: .76rem; }
body.ui-v2 .form-check-input {
  border-color: var(--line);
  background-color: var(--surface);
}
body.ui-v2 .form-check-input:checked {
  background-color: var(--brand-600);
  border-color: var(--brand-600);
}
body.ui-v2 .form-check-input:focus { box-shadow: var(--focus-ring); border-color: var(--brand-500); }
body.ui-v2 .form-check-label { font-size: .86rem; color: var(--ink-soft); }
body.ui-v2 .input-group-text {
  background: var(--surface-alt);
  border-color: var(--line);
  color: var(--ink-muted);
  border-radius: var(--radius-sm);
}
body.ui-v2 .form-floating > .form-control,
body.ui-v2 .form-floating > .form-select { min-height: 52px; }
body.ui-v2 .form-floating > label { color: var(--ink-muted); font-size: .84rem; }

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */
body.ui-v2 .admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  z-index: 1040;
  display: flex;
  flex-direction: column;
  padding: 18px 14px 12px;
  background:
    radial-gradient(circle at 10% 0%, rgba(79, 195, 184, .12), transparent 34%),
    var(--sidebar-bg);
  color: rgba(255, 255, 255, .78);
  box-shadow: 8px 0 28px rgba(4, 16, 18, .12);
}
body.ui-v2 .sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 18px;
  text-decoration: none;
  color: #fff;
}
body.ui-v2 .sidebar-brand-mark { height: 34px; width: 34px; border-radius: 9px; display: block; flex: 0 0 auto; }
body.ui-v2 .sidebar-brand-word { color: #fff; font-size: 1.02rem; font-weight: 800; letter-spacing: -.03em; }
body.ui-v2 .sidebar-brand:focus-visible { outline-color: #fff; }
body.ui-v2 .sidebar-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 4px 0 12px;
  scrollbar-width: thin;
}
body.ui-v2 .sidebar-nav::-webkit-scrollbar { width: 6px; }
body.ui-v2 .sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 99px; }
body.ui-v2 .nav-section-label {
  padding: 14px 12px 6px;
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .38);
}
body.ui-v2 .sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin: 1px 0;
  border-radius: 8px;
  color: rgba(255, 255, 255, .72);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
body.ui-v2 .sidebar-link i {
  width: 18px;
  font-size: 1rem;
  text-align: center;
  opacity: .9;
}
body.ui-v2 .sidebar-link:hover,
body.ui-v2 .sidebar-link:focus-visible {
  background: rgba(255, 255, 255, .07);
  color: #fff;
  outline: 0;
}
body.ui-v2 .sidebar-link.active {
  background: var(--brand-600);
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
}
body.ui-v2 .sidebar-link .nav-count {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--accent-500);
  color: #1a1206;
  font-size: .68rem;
  font-weight: 700;
  text-align: center;
}
body.ui-v2 .sidebar-footer {
  padding: 12px 10px 4px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: .7rem;
  color: rgba(255, 255, 255, .42);
}
body.ui-v2 .sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1035;
  background: rgba(4, 12, 15, .55);
  backdrop-filter: blur(1px);
}

body.ui-v2 .admin-main {
  min-height: 100vh;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}
body.ui-v2 .admin-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--topbar-h);
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
body.ui-v2 .topbar-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}
body.ui-v2 .topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
body.ui-v2 .topbar-actions .btn-icon { color: var(--ink-soft); }
body.ui-v2 .topbar-actions .btn-icon:hover { background: var(--surface-alt); color: var(--ink); }
body.ui-v2 .topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 8px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: .82rem;
}
body.ui-v2 .topbar-user:hover { background: var(--surface-alt); color: var(--ink); }
body.ui-v2 .topbar-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: var(--brand-050);
  color: var(--brand-700);
  font-size: .75rem;
  font-weight: 700;
}
body.ui-v2 .admin-content {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px;
  flex: 1 1 auto;
}

/* --------------------------------------------------------------------------
   Page head, panels, stats
   -------------------------------------------------------------------------- */
body.ui-v2 .page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
body.ui-v2 .page-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -.025em;
}
body.ui-v2 .page-sub {
  margin: 4px 0 0;
  color: var(--ink-muted);
  font-size: .86rem;
}
body.ui-v2 .page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

body.ui-v2 .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
body.ui-v2 .panel + .panel { margin-top: 16px; }
body.ui-v2 .panel.panel-scroll { overflow: visible; }
body.ui-v2 .dropdown-menu { max-height: min(70vh, 620px); overflow-y: auto; }
body.ui-v2 .panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
body.ui-v2 .panel-title {
  margin: 0;
  font-size: .96rem;
  font-weight: 700;
  letter-spacing: -.01em;
}
body.ui-v2 .panel-subtitle { margin: 2px 0 0; color: var(--ink-muted); font-size: .78rem; }
body.ui-v2 .panel-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
body.ui-v2 .panel-body { padding: 18px; }
body.ui-v2 .panel-body.p-0 { padding: 0; }
body.ui-v2 .panel-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-alt);
}

body.ui-v2 .stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
body.ui-v2 .stat {
  position: relative;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
body.ui-v2 .stat-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
body.ui-v2 .stat-value {
  margin-top: 8px;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
body.ui-v2 .stat-meta { margin-top: 4px; font-size: .76rem; color: var(--ink-muted); }
body.ui-v2 .stat-icon {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--brand-050);
  color: var(--brand-700);
  font-size: 1rem;
}
body.ui-v2 .stat.is-success .stat-icon { background: var(--success-soft); color: var(--success); }
body.ui-v2 .stat.is-warning .stat-icon { background: var(--warning-soft); color: var(--warning); }
body.ui-v2 .stat.is-danger .stat-icon { background: var(--danger-soft); color: var(--danger); }
body.ui-v2 .stat.is-info .stat-icon { background: var(--info-soft); color: var(--info); }

body.ui-v2 .eyebrow {
  margin-bottom: 6px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--brand-600);
}
[data-bs-theme="dark"] body.ui-v2 .eyebrow { color: var(--brand-500); }
html:lang(zh-Hant-HK) body.ui-v2 .eyebrow { letter-spacing: 0; text-transform: none; }

body.ui-v2 .quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
body.ui-v2 .quick-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 600;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
body.ui-v2 .quick-card:hover,
body.ui-v2 .quick-card:focus-visible {
  border-color: var(--brand-500);
  background: var(--brand-050);
  color: var(--brand-700);
}
body.ui-v2 .quick-card i {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand-050);
  color: var(--brand-700);
  font-size: .95rem;
}
body.ui-v2 .quick-card span {
  min-width: 0;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
body.ui-v2 .table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius);
}
body.ui-v2 .table-app {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--ink);
  font-size: .84rem;
  --bs-table-bg: transparent;
  --bs-table-color: var(--ink);
  --bs-table-border-color: var(--line);
  --bs-table-hover-bg: var(--surface-alt);
  --bs-table-hover-color: var(--ink);
}
body.ui-v2 .table-app > :not(caption) > * > * {
  padding: .72rem .85rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
body.ui-v2 .table-app thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-alt);
  color: var(--ink-muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: normal;
}
html:lang(zh-Hant-HK) body.ui-v2 .table-app thead th { letter-spacing: 0; text-transform: none; }
body.ui-v2 .table-app tbody tr:last-child td { border-bottom: 0; }
body.ui-v2 .table-app tbody tr:hover { background: var(--surface-alt); }
body.ui-v2 .table-app .num { text-align: right; font-variant-numeric: tabular-nums; }
body.ui-v2 .table-app .actions { white-space: nowrap; text-align: right; }
body.ui-v2 .table-app .col-actions { width: 72px; white-space: nowrap; text-align: center; }
body.ui-v2 .table-empty {
  padding: 42px 20px !important;
  text-align: center;
  color: var(--ink-muted);
}
body.ui-v2 .table-empty i { display: block; font-size: 1.7rem; margin-bottom: 6px; color: var(--brand-500); }

/* --------------------------------------------------------------------------
   Badges, filters, empty states
   -------------------------------------------------------------------------- */
body.ui-v2 .badge-soft {
  display: inline-flex;
  align-items: center;
  gap: .32rem;
  padding: .28em .62em;
  border-radius: var(--radius-pill);
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  background: var(--surface-alt);
  color: var(--ink-soft);
  border: 1px solid transparent;
}
body.ui-v2 .badge-soft.is-brand { background: var(--brand-050); color: var(--brand-700); }
body.ui-v2 .badge-soft.is-success { background: var(--success-soft); color: var(--success); }
body.ui-v2 .badge-soft.is-danger { background: var(--danger-soft); color: var(--danger); }
body.ui-v2 .badge-soft.is-warning { background: var(--warning-soft); color: var(--warning); }
body.ui-v2 .badge-soft.is-info { background: var(--info-soft); color: var(--info); }
body.ui-v2 .badge-soft.is-neutral { background: var(--surface-alt); color: var(--ink-muted); }

body.ui-v2 .filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
body.ui-v2 .filter-search { position: relative; flex: 1 1 260px; max-width: 380px; }
body.ui-v2 .filter-search i {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
  pointer-events: none;
}
body.ui-v2 .filter-search .form-control { padding-left: 34px; }
body.ui-v2 .filter-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
body.ui-v2 .filter-count { color: var(--ink-muted); font-size: .76rem; }

body.ui-v2 .empty-state {
  padding: 44px 24px;
  text-align: center;
  color: var(--ink-muted);
}
body.ui-v2 .empty-state-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--brand-050);
  color: var(--brand-600);
  font-size: 1.35rem;
}
body.ui-v2 .empty-state h3 { margin: 0 0 4px; font-size: .96rem; color: var(--ink); }
body.ui-v2 .empty-state p { margin: 0 auto 14px; max-width: 420px; font-size: .82rem; }

/* --------------------------------------------------------------------------
   Tabs and pagination
   -------------------------------------------------------------------------- */
body.ui-v2 .nav-tabs {
  gap: 2px;
  border-bottom: 1px solid var(--line);
}
body.ui-v2 .nav-tabs .nav-link {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: .65rem .85rem;
  color: var(--ink-muted);
  font-size: .84rem;
  font-weight: 600;
}
body.ui-v2 .nav-tabs .nav-link:hover { color: var(--ink); background: transparent; }
body.ui-v2 .nav-tabs .nav-link.active {
  color: var(--brand-700);
  background: transparent;
  border-bottom-color: var(--brand-600);
}
body.ui-v2 .pagination { gap: 3px; margin: 0; }
body.ui-v2 .pagination .page-link {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-size: .8rem;
  min-width: 32px;
  text-align: center;
}
body.ui-v2 .pagination .page-link:hover { background: var(--surface-alt); color: var(--ink); }
body.ui-v2 .pagination .page-item.active .page-link {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #fff;
}
body.ui-v2 .pagination .page-item.disabled .page-link { color: var(--ink-muted); opacity: .6; }

/* --------------------------------------------------------------------------
   Modals and toasts
   -------------------------------------------------------------------------- */
body.ui-v2 .modal-content {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
body.ui-v2 .modal-header,
body.ui-v2 .modal-footer { border-color: var(--line); padding: 14px 18px; }
body.ui-v2 .modal-body { padding: 18px; }
body.ui-v2 .modal-title { font-size: 1rem; font-weight: 700; }
body.ui-v2 .modal-backdrop.show { opacity: .55; }
[data-bs-theme="dark"] body.ui-v2 .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

body.ui-v2 .toast-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1090;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
body.ui-v2 .app-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-500);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  color: var(--ink);
  font-size: .84rem;
  animation: app-toast-in .18s ease-out both;
}
body.ui-v2 .app-toast .toast-icon { color: var(--brand-600); font-size: 1rem; line-height: 1.3; }
body.ui-v2 .app-toast .toast-body { flex: 1 1 auto; min-width: 0; }
body.ui-v2 .app-toast .toast-close {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  padding: 0 2px;
  line-height: 1;
  font-size: 1rem;
  cursor: pointer;
}
body.ui-v2 .app-toast.is-success { border-left-color: var(--success); }
body.ui-v2 .app-toast.is-success .toast-icon { color: var(--success); }
body.ui-v2 .app-toast.is-danger { border-left-color: var(--danger); }
body.ui-v2 .app-toast.is-danger .toast-icon { color: var(--danger); }
body.ui-v2 .app-toast.is-warning { border-left-color: var(--warning); }
body.ui-v2 .app-toast.is-warning .toast-icon { color: var(--warning); }
body.ui-v2 .app-toast.is-info { border-left-color: var(--info); }
body.ui-v2 .app-toast.is-info .toast-icon { color: var(--info); }
body.ui-v2 #promptMsg.prompt-stack {
  position: fixed;
  top: calc(var(--topbar-h) + 12px);
  right: 20px;
  z-index: 1080;
  width: min(380px, calc(100vw - 32px));
}
body.ui-v2 #promptMsg .alert { margin: 0; box-shadow: var(--shadow); }
body.ui-v2 #promptMsg .alert + .alert { margin-top: 8px; }
@keyframes app-toast-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Auth pages
   -------------------------------------------------------------------------- */
body.ui-v2.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 8%, var(--brand-050), transparent 38%),
    radial-gradient(circle at 88% 92%, var(--accent-050), transparent 42%),
    var(--surface-alt);
}
body.ui-v2 .auth-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 32px;
}
body.ui-v2 .auth-logo { display: block; height: 44px; width: auto; margin: 0 auto 22px; }
body.ui-v2 .auth-logo .logo-dark { display: none; }
[data-bs-theme="dark"] body.ui-v2 .auth-logo .logo-light { display: none; }
[data-bs-theme="dark"] body.ui-v2 .auth-logo .logo-dark { display: block; }
body.ui-v2 .auth-title { margin: 0 0 4px; text-align: center; font-size: 1.2rem; font-weight: 800; }
body.ui-v2 .auth-sub { margin: 0 0 22px; text-align: center; color: var(--ink-muted); font-size: .82rem; }
body.ui-v2 .auth-footer {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-muted);
  font-size: .74rem;
}
body.ui-v2 .auth-lang { display: flex; gap: 8px; }
body.ui-v2 .auth-lang a { color: var(--ink-muted); text-decoration: none; }
body.ui-v2 .auth-lang a:hover,
body.ui-v2 .auth-lang a.active { color: var(--brand-500); font-weight: 600; }
[data-bs-theme="dark"] body.ui-v2 .auth-lang a:hover,
[data-bs-theme="dark"] body.ui-v2 .auth-lang a.active { color: var(--brand-500); }
body.ui-v2 .auth-card .btn-primary { width: 100%; }
body.ui-v2 .auth-hint { font-size: .76rem; color: var(--ink-muted); }

/* --------------------------------------------------------------------------
   Legacy page chrome inside the v2 shell
   -------------------------------------------------------------------------- */
body.ui-v2 .admin-content > .content,
body.ui-v2 .admin-content .content {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}
body.ui-v2 .funcBar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding: 0;
  background: transparent;
  color: var(--ink);
  border: 0;
}
body.ui-v2 .funcBar .funcTitle {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -.025em;
  color: var(--ink);
}
body.ui-v2 .funcBar .funcMenu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 0 auto !important;
  padding: 0 !important;
}
body.ui-v2 .funcBar .funcMenu > .btn,
body.ui-v2 .funcBar .funcMenu > a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
}
body.ui-v2 .funcBar .funcMenu > .btn:hover,
body.ui-v2 .funcBar .funcMenu > a.btn:hover {
  border-color: var(--brand-500);
  background: var(--brand-050);
  color: var(--brand-700);
}
body.ui-v2 .funcBar .funcMenu .btn i,
body.ui-v2 .funcBar .funcMenu a.btn i { font-size: 1rem; }

body.ui-v2 .card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
body.ui-v2 .card-header,
body.ui-v2 .card-top {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
}
body.ui-v2 .card-body { padding: 18px; }
body.ui-v2 .card-footer { padding: 12px 18px; background: var(--surface-alt); border-top: 1px solid var(--line); }
body.ui-v2 .card-title { font-size: 1rem; font-weight: 700; }

body.ui-v2 .func-btn {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 14px 16px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
}
body.ui-v2 .func-btn:hover { border-color: var(--brand-500); background: var(--brand-050); color: var(--brand-700); }

body.ui-v2 .dashboardicon {
  display: block;
  width: 100%;
  padding: 28px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-align: center;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
body.ui-v2 .dashboardicon:hover { border-color: var(--brand-500); background: var(--brand-050); color: var(--brand-700); }

body.ui-v2 .app-table-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 4px 14px 8px;
  margin-bottom: 16px;
  overflow-x: auto;
}
body.ui-v2 .content table.table:not(.table-app) {
  margin: 0;
  color: var(--ink);
  --bs-table-bg: transparent;
  --bs-table-color: var(--ink);
  --bs-table-border-color: var(--line);
  --bs-table-hover-bg: var(--surface-alt);
  --bs-table-hover-color: var(--ink);
}
body.ui-v2 .content table.table:not(.table-app) > :not(caption) > * > * {
  padding: .68rem .8rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
body.ui-v2 .content table.table:not(.table-app) thead th {
  background: var(--surface-alt);
  color: var(--ink-muted);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
html:lang(zh-Hant-HK) body.ui-v2 .content table.table:not(.table-app) thead th {
  letter-spacing: 0;
  text-transform: none;
}
body.ui-v2 .content table.table:not(.table-app) tbody tr:last-child td { border-bottom: 0; }
body.ui-v2 .content table.table:not(.table-app) td:last-child,
body.ui-v2 .content table.table:not(.table-app) td:nth-last-child(2) { white-space: nowrap; }
body.ui-v2 .content table.table:not(.table-app) td:last-child .btn + .btn { margin-left: 3px; }
body.ui-v2 .content img[src*="/qrcode/"],
body.ui-v2 .content img[src*="api.qrserver.com"],
body.ui-v2 .content img[src*="quickchart.io"] { max-width: 200px !important; height: auto !important; }
body.ui-v2 .table input[type="checkbox"] { width: 1.05rem; height: 1.05rem; }
body.ui-v2 .pagination .page-item.disabled .page-link { color: var(--ink-soft); background: var(--surface-alt); opacity: 1; }
body.ui-v2 .pagination .page-item.active .page-link { color: #fff; }

body.ui-v2 .table .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  box-shadow: none;
  font-size: .8rem;
}
body.ui-v2 .table .btn-primary { background: var(--brand-050); color: var(--brand-700); }
body.ui-v2 .table .btn-primary:hover { background: var(--brand-100); color: var(--brand-700); }
body.ui-v2 .table .btn-info { background: var(--info-soft); color: var(--info); }
body.ui-v2 .table .btn-info:hover { background: var(--info); color: #fff; }
body.ui-v2 .table .btn-success { background: var(--success-soft); color: var(--success); }
body.ui-v2 .table .btn-success:hover { background: var(--success); color: #fff; }
body.ui-v2 .table .btn-danger { background: var(--danger-soft); color: var(--danger); }
body.ui-v2 .table .btn-danger:hover { background: var(--danger); color: #fff; }
body.ui-v2 .table .btn-warning { background: var(--warning-soft); color: var(--warning); }
body.ui-v2 .table .btn-warning:hover { background: var(--warning); color: #fff; }
body.ui-v2 .dt-buttons .btn,
body.ui-v2 .dt-buttons .dt-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-soft);
  box-shadow: none;
  font-size: .8rem;
}
body.ui-v2 .dt-buttons .btn:hover,
body.ui-v2 .dt-buttons .dt-button:hover { border-color: var(--brand-500); background: var(--brand-050); color: var(--brand-700); }
body.ui-v2 .btn-success {
  --bs-btn-bg: var(--brand-600);
  --bs-btn-border-color: var(--brand-600);
  --bs-btn-hover-bg: var(--brand-700);
  --bs-btn-hover-border-color: var(--brand-700);
  --bs-btn-active-bg: var(--brand-700);
  --bs-btn-active-border-color: var(--brand-700);
}
body.ui-v2 .btn-danger {
  --bs-btn-bg: var(--danger);
  --bs-btn-border-color: var(--danger);
  --bs-btn-hover-bg: #8f1c13;
  --bs-btn-hover-border-color: #8f1c13;
  --bs-btn-active-bg: #8f1c13;
  --bs-btn-active-border-color: #8f1c13;
}
body.ui-v2 .btn-info {
  --bs-btn-bg: var(--info);
  --bs-btn-border-color: var(--info);
  --bs-btn-hover-bg: #173db0;
  --bs-btn-hover-border-color: #173db0;
}

/* Badge / display field builders */
body.ui-v2 .draggable-container .btn-success {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  font-weight: 600;
  box-shadow: none;
}
body.ui-v2 .draggable-container .btn-success::before {
  content: "⠿";
  color: var(--ink-muted);
  font-size: 1rem;
  line-height: 1;
}
body.ui-v2 .draggable-container .btn-success:hover {
  border-color: var(--brand-500);
  background: var(--brand-050);
  color: var(--brand-700);
}
body.ui-v2 #tables_selected:empty::before,
body.ui-v2 #tables_selected:not(:has(.shallow-draggable))::before {
  content: "—";
  display: block;
  padding: 28px 12px;
  text-align: center;
  color: var(--ink-muted);
}
body.ui-v2 #form-setting > .card .row > .col-md-6:last-child {
  flex: 0 0 100%;
  max-width: 100%;
  padding: 0;
}
body.ui-v2 #form-setting > .card .row > .col-md-6:last-child .card { margin-top: 0; }

body.ui-v2 .alert { border-radius: var(--radius-sm); border: 1px solid transparent; }
body.ui-v2 .alert-danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
body.ui-v2 .alert-warning { background: var(--warning-soft); color: var(--warning); border-color: var(--warning); }
body.ui-v2 .alert-info { background: var(--info-soft); color: var(--info); border-color: var(--info); }
body.ui-v2 .alert-success { background: var(--success-soft); color: var(--success); border-color: var(--success); }

/* --------------------------------------------------------------------------
   Public and kiosk shells
   -------------------------------------------------------------------------- */
body.ui-v2 .public-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 10% 0%, var(--brand-050), transparent 34%),
    var(--surface-alt);
}
body.ui-v2 .public-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 0 max(20px, env(safe-area-inset-left)) 0 max(20px, env(safe-area-inset-right));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
body.ui-v2 .public-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -.03em;
  text-decoration: none;
}
body.ui-v2 .public-brand img { width: 32px; height: 32px; border-radius: 9px; }
body.ui-v2 .public-actions { display: flex; align-items: center; gap: 4px; }
body.ui-v2 .public-footer {
  padding: 18px 24px 28px;
  text-align: center;
  color: var(--ink-muted);
  font-size: .75rem;
}
body.ui-v2 .public-content {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px max(20px, env(safe-area-inset-left)) 64px max(20px, env(safe-area-inset-right));
}
body.ui-v2 .kiosk-shell { min-height: 100vh; background: var(--surface-alt); }
body.ui-v2 .kiosk-logo { max-height: 40px; width: auto; max-width: 160px; }
/* Kiosk check-in */
body.ui-v2 .kiosk-app {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px max(16px, env(safe-area-inset-left)) 40px max(16px, env(safe-area-inset-right));
}
body.ui-v2 .kiosk-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
body.ui-v2 .kiosk-title { margin: 0; font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; letter-spacing: -.03em; }
body.ui-v2 .kiosk-clock { margin-top: 4px; color: var(--ink-muted); font-family: var(--font-mono); font-size: .8rem; }
body.ui-v2 .kiosk-actions { display: flex; flex-wrap: wrap; gap: 6px; }
body.ui-v2 .kiosk-source {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
body.ui-v2 .kiosk-source .form-label { margin: 0; white-space: nowrap; }
body.ui-v2 .kiosk-source .form-select { max-width: 420px; }
body.ui-v2 .kiosk-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
body.ui-v2 .checkin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}
body.ui-v2 .checkin-field { min-width: 0; }
body.ui-v2 .checkin-or { padding-bottom: 12px; color: var(--ink-muted); font-size: .8rem; }
body.ui-v2 .checkin-grid .btn { min-height: 42px; }
body.ui-v2 .checkin-search { max-width: 720px; margin: 0 auto; }
body.ui-v2 .checkin-search-box { position: relative; }
body.ui-v2 .checkin-search-box > i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
  font-size: 1.15rem;
  pointer-events: none;
}
body.ui-v2 .checkin-search-box .form-control {
  height: 64px;
  padding-left: 48px;
  font-size: 1.1rem;
  border-radius: 14px;
}
body.ui-v2 .checkin-results {
  margin-top: 10px;
  max-height: 42vh;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: left;
}
body.ui-v2 .checkin-results[hidden] { display: none; }
body.ui-v2 .checkin-result {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}
body.ui-v2 .checkin-result:last-child { border-bottom: 0; }
body.ui-v2 .checkin-result:hover,
body.ui-v2 .checkin-result.is-active { background: var(--brand-050); }
body.ui-v2 .checkin-result .result-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--brand-050);
  color: var(--brand-700);
  font-weight: 700;
}
body.ui-v2 .checkin-result .result-name { font-weight: 700; }
body.ui-v2 .checkin-result .result-meta { color: var(--ink-muted); font-size: .78rem; }
body.ui-v2 .checkin-result .result-state { margin-left: auto; flex: 0 0 auto; }
body.ui-v2 .checkin-empty { padding: 18px; text-align: center; color: var(--ink-muted); }
body.ui-v2 .kiosk-video {
  margin-top: 18px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
  max-height: 58vh;
}
body.ui-v2 .kiosk-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 767.98px) {
  body.ui-v2 .checkin-grid { grid-template-columns: 1fr; }
  body.ui-v2 .checkin-or { padding: 0; text-align: center; }
  body.ui-v2 .kiosk-card { padding: 14px; }
  body.ui-v2 .kiosk-video { aspect-ratio: 4 / 3; }
}

body.ui-v2 .error-page {
  min-height: 60vh;
  display: grid;
  place-items: center;
  text-align: center;
}
body.ui-v2 .error-page > div { max-width: 520px; }
body.ui-v2 .error-code {
  font-size: clamp(4rem, 14vw, 7rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.05em;
  color: var(--brand-600);
}
body.ui-v2 .error-page .page-title { margin-top: 8px; }
@media (max-width: 991.98px) {
  body.ui-v2 .content .row > [class*="col-md-"] { flex: 0 0 100%; max-width: 100%; }
  body.ui-v2 .content .card { overflow-x: auto; }
}
body.ui-v2 .public-content .form-signin {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0;
  background: transparent;
  text-align: left;
}
body.ui-v2 .public-content .form-signin > img,
body.ui-v2 .public-content .form-signin > span > img { max-width: 220px; height: auto; }
body.ui-v2 .enroll-logo { display: block; max-height: 52px; width: auto; max-width: 220px; margin: 0 auto 16px; }
body.ui-v2 #guestContentArea .row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin: 0;
}
body.ui-v2 #guestContentArea .row > [class*="col"] {
  width: auto;
  max-width: none;
  padding: 0;
}
body.ui-v2 #guestContentArea .input-group { flex-wrap: nowrap; }
body.ui-v2 #guestContentArea .btnRemoveGuestRow { flex: 0 0 auto; }

/* --------------------------------------------------------------------------
   File uploads
   -------------------------------------------------------------------------- */
body.ui-v2 .file-drop-zone,
body.ui-v2 .file-drop-inner {
  position: relative;
  padding: 14px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface-alt);
  transition: border-color .15s ease, background .15s ease;
}
body.ui-v2 .file-drop-zone.is-dragover,
body.ui-v2 .file-drop-inner.is-dragover {
  border-color: var(--brand-500);
  background: var(--brand-050);
}
body.ui-v2 .file-drop-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
body.ui-v2 .file-drop-actions .btn { flex: 0 0 auto; }
body.ui-v2 .file-drop-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--ink-muted);
  font-size: .78rem;
}
body.ui-v2 .file-drop-hint i { color: var(--brand-600); font-size: 1rem; }
body.ui-v2 .file-drop-name {
  margin-top: 6px;
  color: var(--brand-700);
  font-size: .78rem;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Utility components
   -------------------------------------------------------------------------- */
body.ui-v2 .copy-field {
  display: flex;
  align-items: stretch;
  gap: 6px;
}
body.ui-v2 .copy-field .form-control { font-family: var(--font-mono); font-size: .78rem; }
body.ui-v2 .skeleton {
  display: inline-block;
  min-height: .8em;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-alt) 25%, var(--line) 37%, var(--surface-alt) 63%);
  background-size: 400% 100%;
  animation: app-skeleton 1.4s ease infinite;
}
@keyframes app-skeleton {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
body.ui-v2 .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: var(--brand-050);
  color: var(--brand-700);
  font-size: .74rem;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Notification template editor
   -------------------------------------------------------------------------- */
body.ui-v2 .template-editor .channel-panel { position: relative; }
body.ui-v2 .template-editor .channel-panel.is-loading { opacity: .55; pointer-events: none; }
body.ui-v2 .editor-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--ink-muted);
  font-size: .8rem;
}
body.ui-v2 .editor-loading[hidden] { display: none; }
body.ui-v2 .variable-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 2px;
}
body.ui-v2 .variable-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  font-size: .8rem;
  cursor: pointer;
}
body.ui-v2 .variable-chip:hover { border-color: var(--brand-500); background: var(--brand-050); }
body.ui-v2 .variable-chip code {
  flex: 0 0 auto;
  font-size: .74rem;
  color: var(--brand-700);
  background: var(--brand-050);
  padding: .12em .4em;
  border-radius: 5px;
}
body.ui-v2 .variable-chip .desc {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-muted);
  font-size: .74rem;
}
body.ui-v2 .editor-counter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  color: var(--ink-soft);
  font-size: .78rem;
}
body.ui-v2 .editor-counter strong { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
body.ui-v2 .editor-counter .faint { color: var(--ink-muted); font-size: .74rem; }
body.ui-v2 .block-list { display: flex; flex-direction: column; gap: 10px; }
body.ui-v2 .block-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}
body.ui-v2 .block-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--line);
}
body.ui-v2 .block-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  font-weight: 700;
  color: var(--ink-soft);
}
body.ui-v2 .block-type i { color: var(--brand-600); font-size: .9rem; }
body.ui-v2 .block-actions { margin-left: auto; display: flex; align-items: center; gap: 2px; }
body.ui-v2 .block-body { padding: 12px; }
body.ui-v2 .block-media-preview { margin-top: 10px; }
body.ui-v2 .block-media-preview img {
  display: block;
  max-width: 100%;
  max-height: 220px;
  border-radius: 8px;
}
body.ui-v2 .block-media-preview audio,
body.ui-v2 .block-media-preview video { width: 100%; }
body.ui-v2 .block-empty {
  padding: 26px 18px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--ink-muted);
  font-size: .82rem;
}
body.ui-v2 .block-empty[hidden] { display: none; }
body.ui-v2 .media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 10px;
}
body.ui-v2 .media-grid-compact {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  max-height: 340px;
  overflow-y: auto;
  padding-right: 2px;
}
body.ui-v2 .media-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}
body.ui-v2 .media-thumb {
  height: 88px;
  display: grid;
  place-items: center;
  background: var(--surface-alt);
  color: var(--ink-muted);
  font-size: 1.35rem;
  overflow: hidden;
}
body.ui-v2 .media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
body.ui-v2 .media-meta { min-width: 0; padding: 7px 9px 2px; }
body.ui-v2 .media-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .76rem;
  font-weight: 600;
  color: var(--ink);
}
body.ui-v2 .media-size { font-size: .7rem; color: var(--ink-muted); }
body.ui-v2 .media-actions { display: flex; align-items: center; gap: 2px; padding: 5px 6px 7px; }
body.ui-v2 .media-actions .media-use { flex: 1 1 auto; justify-content: center; }
body.ui-v2 .media-grid-compact .media-actions .btn { width: 28px; height: 28px; }
body.ui-v2 .phone-frame {
  width: min(340px, 100%);
  margin: 0 auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface-alt);
  box-shadow: var(--shadow-sm);
}
body.ui-v2 .phone-screen {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
  padding: 16px;
  border-radius: 18px;
  background: var(--surface);
}
body.ui-v2 .sms-bubble {
  align-self: flex-end;
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 16px 16px 4px 16px;
  background: var(--brand-600);
  color: #fff;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
body.ui-v2 .rcs-preview-title { font-size: 1rem; font-weight: 700; color: var(--ink); }
body.ui-v2 .rcs-preview-block {
  color: var(--ink-soft);
  font-size: .84rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
body.ui-v2 .rcs-preview-block img,
body.ui-v2 .rcs-preview-block audio,
body.ui-v2 .rcs-preview-block video {
  display: block;
  width: 100%;
  max-height: 220px;
  border-radius: 8px;
}
body.ui-v2 .preview-frame {
  width: 100%;
  height: min(65vh, 560px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
body.ui-v2 .template-editor .filter-search { max-width: none; }
body.ui-v2 .template-editor .empty-state { padding: 20px 0; }

/* --------------------------------------------------------------------------
   Event calendar (donatj/SimpleCalendar)
   -------------------------------------------------------------------------- */
body.ui-v2 #calendar_area {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
body.ui-v2 .calendar-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
  margin-bottom: 14px;
}
body.ui-v2 .calendar-month-label {
  min-width: 170px;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}
body.ui-v2 .SimpleCalendar {
  width: 100%;
  min-width: 620px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
}
body.ui-v2 .SimpleCalendar thead th {
  padding: 10px 6px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-align: center;
  text-transform: uppercase;
}
body.ui-v2 .SimpleCalendar thead th:last-child { border-right: 0; }
html:lang(zh-Hant-HK) body.ui-v2 .SimpleCalendar thead th { letter-spacing: 0; text-transform: none; }
body.ui-v2 .SimpleCalendar tbody td {
  height: 112px;
  padding: 0;
  vertical-align: top;
  background: var(--surface);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
body.ui-v2 .SimpleCalendar tbody td:last-child { border-right: 0; }
body.ui-v2 .SimpleCalendar tbody tr:last-child td { border-bottom: 0; }
body.ui-v2 .SimpleCalendar tbody td time {
  display: block;
  padding: 7px 9px 4px;
  background: transparent;
  color: var(--ink-muted);
  font-size: .76rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: right;
}
body.ui-v2 .SimpleCalendar tbody td.today { background: var(--brand-050); }
body.ui-v2 .SimpleCalendar tbody td.today time { color: var(--brand-700); font-weight: 800; }
body.ui-v2 .SimpleCalendar tbody td.SCprefix,
body.ui-v2 .SimpleCalendar tbody td.SCsuffix { background: var(--surface-alt); }
body.ui-v2 .SimpleCalendar tbody td .events { padding: 2px 0 4px; }
body.ui-v2 .SimpleCalendar tbody td .event {
  margin: 0 6px 3px;
  padding: 4px 6px;
  border-radius: 5px;
  background: var(--brand-600);
  color: #fff;
  font-size: .7rem;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.ui-v2 .SimpleCalendar tbody td .event a {
  display: block;
  color: inherit;
  overflow: hidden;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.ui-v2 .SimpleCalendar tbody td .event:hover { background: var(--brand-700); }
@media (max-width: 767.98px) {
  body.ui-v2 .SimpleCalendar { min-width: 560px; }
  body.ui-v2 .SimpleCalendar tbody td { height: 86px; }
  body.ui-v2 .SimpleCalendar tbody td time { padding: 5px 6px 2px; font-size: .7rem; }
  body.ui-v2 .SimpleCalendar tbody td .event { margin: 0 4px 2px; padding: 3px 5px; font-size: .64rem; }
  body.ui-v2 .calendar-month-label { min-width: 140px; font-size: .92rem; }
}

/* --------------------------------------------------------------------------
   Badge / table-stand designer
   -------------------------------------------------------------------------- */
body.ui-v2 .designer-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
body.ui-v2 .designer-kind-tabs { display: flex; gap: 4px; }
body.ui-v2 .designer-size-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
body.ui-v2 .designer-dimensions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-muted);
  font-size: .78rem;
}
body.ui-v2 .designer-dimensions input {
  width: 68px;
  padding: .35rem .45rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
body.ui-v2 .designer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
body.ui-v2 .designer-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}
body.ui-v2 .designer-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
body.ui-v2 .designer-section { padding: 14px 16px; border-bottom: 1px solid var(--line); }
body.ui-v2 .designer-section:last-child { border-bottom: 0; }
body.ui-v2 .designer-section-title {
  margin: 0 0 10px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
html:lang(zh-Hant-HK) body.ui-v2 .designer-section-title { letter-spacing: 0; text-transform: none; }
body.ui-v2 .designer-stage {
  min-width: 0;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
body.ui-v2 .designer-side-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}
body.ui-v2 .designer-side-tabs[hidden] { display: none; }
body.ui-v2 .designer-canvas-wrap {
  display: flex;
  justify-content: center;
  min-height: 260px;
  max-height: 72vh;
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background-color: var(--surface-alt);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: -1px -1px;
}
body.ui-v2 .designer-canvas-shell {
  position: relative;
  flex: 0 0 auto;
  background: #fff;
  box-shadow: var(--shadow);
}
body.ui-v2 .designer-canvas-shell .canvas-container { position: relative; }
body.ui-v2 .designer-hint {
  margin: 10px 0 0;
  text-align: center;
  color: var(--ink-muted);
  font-size: .76rem;
}
body.ui-v2 .badge-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px 12px;
  border: 1px dashed var(--line);
  border-radius: 9px;
  background: var(--surface-alt);
  color: var(--ink-muted);
  font-size: .76rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
body.ui-v2 .badge-drop i { font-size: 1.3rem; color: var(--brand-600); }
body.ui-v2 .badge-drop:hover,
body.ui-v2 .badge-drop.is-dragover { border-color: var(--brand-500); background: var(--brand-050); }
body.ui-v2 .layer-list { display: flex; flex-direction: column; gap: 5px; max-height: 230px; overflow-y: auto; }
body.ui-v2 .layer-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: .78rem;
  text-align: left;
}
body.ui-v2 .layer-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.ui-v2 .layer-item i { color: var(--brand-600); }
body.ui-v2 .layer-item:hover,
body.ui-v2 .layer-item.active { border-color: var(--brand-500); background: var(--brand-050); color: var(--brand-700); }
body.ui-v2 .badge-designer.seat-inherited #designerTools > .designer-section:not(#seatOptions),
body.ui-v2 .badge-designer.seat-inherited #designerProps { display: none; }
body.ui-v2 #seatOptions .form-check + .form-check { margin-top: 4px; }
body.ui-v2 .designer-panel .form-label { margin-bottom: 4px; }
body.ui-v2 .designer-panel .form-select-sm,
body.ui-v2 .designer-panel .form-control-sm { font-size: .78rem; }
body.ui-v2 .designer-panel .form-check { padding-left: 1.6em; margin-bottom: 0; font-size: .78rem; }
body.ui-v2 .designer-panel .form-control-color { height: 33px; padding: 2px; }
body.ui-v2 .bd-preview-card {
  position: relative;
  margin: 0 auto;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}
body.ui-v2 .bd-preview-stand {
  position: relative;
  margin: 0 auto;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}
body.ui-v2 .bd-preview-panel {
  position: absolute;
  left: 0;
  overflow: hidden;
  background: #fff;
}
body.ui-v2 .bd-preview-fold {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px dashed rgba(180, 35, 24, .7);
  z-index: 5;
}

@media (max-width: 1399.98px) {
  body.ui-v2 .designer-grid { grid-template-columns: 250px minmax(0, 1fr) 280px; }
}
@media (max-width: 1199.98px) {
  body.ui-v2 .designer-grid { grid-template-columns: 1fr; }
  body.ui-v2 .designer-stage { order: -1; }
  body.ui-v2 .designer-canvas-wrap { max-height: 60vh; }
}
@media (max-width: 575.98px) {
  body.ui-v2 .designer-toolbar { padding: 10px 12px; }
  body.ui-v2 .designer-kind-tabs { width: 100%; }
  body.ui-v2 .designer-kind-tabs .btn { flex: 1 1 0; }
  body.ui-v2 .designer-canvas-wrap { padding: 8px; }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  body.ui-v2 .admin-sidebar {
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: var(--shadow-lg);
  }
  body.ui-v2 .admin-sidebar.is-open { transform: translateX(0); }
  body.ui-v2 .admin-main { margin-left: 0; }
  body.ui-v2 .admin-topbar { padding: 0 16px; }
  body.ui-v2 .admin-content { padding: 16px; }
  body.ui-v2 .page-head { align-items: flex-start; }
  body.ui-v2 .page-actions { width: 100%; }
}
@media (max-width: 575.98px) {
  body.ui-v2 .auth-card { padding: 24px 20px; }
  body.ui-v2 .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  body.ui-v2 .stat { padding: 13px 14px; }
  body.ui-v2 .stat-value { font-size: 1.5rem; }
  body.ui-v2 .stat-icon { width: 30px; height: 30px; font-size: .9rem; }
  body.ui-v2 .page-title { font-size: 1.25rem; }
  body.ui-v2 .topbar-user .user-name { display: none; }
}
@media (max-width: 380px) {
  body.ui-v2.auth-page { padding: 16px; }
  body.ui-v2 .auth-card { padding: 22px 16px; }
}

/* --------------------------------------------------------------------------
   Print
   -------------------------------------------------------------------------- */
@media print {
  body.ui-v2 { background: #fff !important; color: #000 !important; }
  body.ui-v2 .admin-sidebar,
  body.ui-v2 .admin-topbar,
  body.ui-v2 .page-actions,
  body.ui-v2 .no-print { display: none !important; }
  body.ui-v2 .admin-main { margin-left: 0 !important; }
  body.ui-v2 .admin-content { padding: 0 !important; max-width: none; }
  body.ui-v2 .panel { border: 0; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  body.ui-v2 *,
  body.ui-v2 *::before,
  body.ui-v2 *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
