/* ============================================================
   common.css — UMAY Charge Web Operations Console Baseline
   Design Source: Parsec Admin (create-parsec-admin-app)
     - ProLayout: side + light, fixSiderbar, fixedHeader
     - PageContainer + ProTable (QueryFilter + list-toolbar + middle table + pagination)
   Brand Override (PRD §7.0 / §7.9): --primary set to UMAY Charge green (00A870) inside :root.
   Single Source of Truth: all hex colors strictly inside :root. Zero hex literals outside :root.
   ============================================================ */
:root {
  /* Brand palette (UMAY Charge #00A870 override on Parsec Admin structure) */
  --primary: #00a870;
  --primary-fill: #008558;
  --primary-hover: #00704a;
  --primary-active: #005c3d;
  --primary-weak: #e6f7f1;
  --primary-weak-hover: #ccf0e3;
  --primary-border: #8adbb9;
  --primary-text: #006b46;
  --focus-ring: rgba(0, 168, 112, 0.14);

  /* Semantic colors (antd v6 aligned) */
  --success: #52c41a;
  --success-weak: #f6ffed;
  --success-border: #b7eb8f;
  --success-text: #389e0d;

  --warning: #faad14;
  --warning-weak: #fffbe6;
  --warning-border: #ffe58f;
  --warning-text: #ad6800;

  --orange-text: #d46b08;
  --orange-weak: #fff7e6;
  --orange-border: #ffd591;

  --error: #ff4d4f;
  --error-weak: #fff2f0;
  --error-border: #ffccc7;
  --error-text: #cf1322;

  --info: #1677ff;
  --info-weak: #e6f4ff;
  --info-border: #91caff;
  --info-text: #0958d9;

  /* Text */
  --text: rgba(0, 0, 0, 0.88);
  --text-secondary: rgba(0, 0, 0, 0.65);
  --text-tertiary: rgba(0, 0, 0, 0.45);
  --text-muted: rgba(0, 0, 0, 0.25);
  --text-inverse: #ffffff;

  /* Borders & surfaces */
  --border: #d9d9d9;
  --border-light: #f0f0f0;
  --border-split: rgba(5, 5, 5, 0.06);
  --bg-page: #f5f5f5;
  --bg-layout: linear-gradient(#ffffff, #f5f5f5 28%);
  --bg-card: #ffffff;
  --bg-hover: #fafafa;
  --bg-fill: rgba(0, 0, 0, 0.02);
  --bg-fill-subtle: rgba(0, 0, 0, 0.03);
  --bg-fill-hover: rgba(0, 0, 0, 0.04);
  --menu-selected-text: rgba(0, 0, 0, 0.95);
  --bg-fill-strong: rgba(0, 0, 0, 0.06);
  --bg-disabled: rgba(0, 0, 0, 0.04);
  --bg-mask: rgba(0, 0, 0, 0.45);
  --bg-tooltip: rgba(0, 0, 0, 0.85);
  --bg-header: rgba(255, 255, 255, 0.72);
  --bg-footer-toolbar: rgba(255, 255, 255, 0.78);
  --table-header-bg: #fafafa;
  --white: #ffffff;
  --site-footer-bg: #001529;
  --code-bg: #f6f8fa;
  --code-border: #e5e7eb;

  /* Chart tokens */
  --chart-bar: #00a870;
  --chart-bar-alt: #8adbb9;
  --chart-line: #1677ff;
  --chart-amber: #faad14;
  --chart-error: #ff4d4f;
  --chart-grid: #f0f0f0;

  /* Radius scale (Parsec base 6px) */
  --radius: 8px;
  --radius-base: 6px;
  --radius-sm: 4px;

  /* Shadows */
  --shadow-card: none;
  --shadow-popup: 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
  --shadow-drawer: -6px 0 16px 0 rgba(0, 0, 0, 0.08), -3px 0 6px -4px rgba(0, 0, 0, 0.12), -9px 0 28px 8px rgba(0, 0, 0, 0.05);
  --shadow-footer-toolbar: 0 -6px 16px -8px rgba(0, 0, 0, 0.08), 0 -9px 28px 0 rgba(0, 0, 0, 0.05);
  --shadow-collapse-btn: 0 2px 8px -2px rgba(0, 0, 0, 0.05), 0 1px 4px -1px rgba(25, 15, 15, 0.07), 0 0 1px 0 rgba(0, 0, 0, 0.08);

  /* ProLayout dimensions */
  --sidebar-bg: transparent;
  --sidebar-w: 256px;
  --sidebar-collapsed-w: 64px;
  --header-h: 56px;
  --content-px: 40px;
  --content-pb: 32px;
  --menu-item-h: 40px;

  /* Control heights */
  --control-h: 32px;
  --control-h-sm: 24px;
  --control-h-lg: 40px;

  /* Spacing & typography */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --font-xs: 12px;
  --font-sm: 13px;
  --font-base: 14px;
  --font-lg: 16px;
  --font-xl: 20px;
  --font-xxl: 24px;
  --line-height: 1.5714;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-family);
  font-size: var(--font-base);
  color: var(--text);
  line-height: var(--line-height);
  background: var(--bg-page) var(--bg-layout) fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: var(--primary-text); text-decoration: none; }
a:hover { color: var(--primary-hover); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
button, input, textarea { font-family: inherit; }
.mono { font-family: var(--font-mono); }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- Utilities ---------- */
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex-center { display: flex; align-items: center; gap: 8px; }
.flex-wrap { flex-wrap: wrap; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.bold { font-weight: 600; }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-danger { color: var(--error-text); }
.text-success { color: var(--success-text); }
.text-warning { color: var(--warning-text); }
.text-primary { color: var(--primary-text); }

/* ProForm field widths */
.w-xs { width: 104px; max-width: 100%; }
.w-sm { width: 216px; max-width: 100%; }
.w-md { width: 328px; max-width: 100%; }
.w-lg { width: 440px; max-width: 100%; }
.w-xl { width: 552px; max-width: 100%; }
.w-full { width: 100%; }

/* ---------- ProLayout (side + light) ---------- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-split);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width 0.2s ease;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 14px;
  min-height: 56px;
  border-bottom: 1px solid var(--border-split);
  color: var(--text);
  font-weight: 600;
  font-size: var(--font-lg);
  line-height: 22px;
  white-space: nowrap;
  overflow: hidden;
}
.logo-img {
  width: 24px;
  height: 24px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}
.logo-img i, .logo-img svg { width: 22px; height: 22px; stroke-width: 2; }
.menu { padding: 4px 8px 16px; flex: 1; overflow-y: auto; }
.menu-title {
  padding: 14px 16px 4px;
  font-size: var(--font-xs);
  color: var(--text-tertiary);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--menu-item-h);
  padding: 0 14px;
  margin: 2px 0;
  border-radius: var(--radius-base);
  color: var(--text-secondary);
  font-size: var(--font-base);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.menu-item:hover { color: var(--text); background: var(--bg-fill-subtle); }
.menu-item.active { color: var(--menu-selected-text); background: var(--bg-fill-hover); font-weight: 600; }
.menu-item.disabled { color: var(--text-muted); cursor: not-allowed; background: none; }
.menu-item i, .menu-item svg { width: 15px; height: 15px; flex: none; stroke-width: 2; }
.menu-sub .menu-item { padding-left: 40px; }
.menu-badge { margin-left: auto; font-size: var(--font-xs); }
.menu-tag-p2, .menu-tag-p1 {
  margin-left: auto;
  font-size: 10px;
  line-height: 18px;
  padding: 0 6px;
  border-radius: 8px;
  white-space: nowrap;
  font-weight: 600;
}
.menu-tag-p2 { color: var(--info-text); background: var(--info-weak); }
.menu-tag-p1 { color: var(--orange-text); background: var(--orange-weak); }
.menu-footer { padding: 12px 16px 16px; font-size: var(--font-xs); color: var(--text-tertiary); }

.main {
  margin-left: var(--sidebar-w);
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.2s ease;
}

/* Sidebar collapse button */
.sider-collapse-btn {
  position: absolute;
  top: 18px;
  right: -12px;
  width: 24px;
  height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 40px;
  background: var(--bg-card);
  color: var(--text-tertiary);
  box-shadow: var(--shadow-collapse-btn);
  cursor: pointer;
  z-index: 101;
}
.sider-collapse-btn:hover { color: var(--text); }
.sider-collapse-btn i, .sider-collapse-btn svg { width: 14px; height: 14px; stroke-width: 2; transition: transform 0.2s; }
.sidebar.collapsed .sider-collapse-btn i, .sidebar.collapsed .sider-collapse-btn svg { transform: rotate(180deg); }

/* Sidebar collapsed state */
.sidebar.collapsed { width: var(--sidebar-collapsed-w); }
.sidebar.collapsed .logo { justify-content: center; padding: 16px 0; }
.sidebar.collapsed .logo > span:not(.logo-img) { display: none; }
.sidebar.collapsed .menu-title, .sidebar.collapsed .menu-footer { display: none; }
.sidebar.collapsed .menu-item { justify-content: center; padding: 0; }
.sidebar.collapsed .menu-item > span:not(.menu-badge):not(.menu-tag-p2):not(.menu-tag-p1) { display: none; }
.sidebar.collapsed .menu-badge, .sidebar.collapsed .menu-tag-p2, .sidebar.collapsed .menu-tag-p1 { display: none; }
.sidebar.collapsed ~ .main { margin-left: var(--sidebar-collapsed-w); }

.header {
  height: var(--header-h);
  background: var(--bg-header);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-split);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-left, .header-right { display: flex; align-items: center; gap: 10px; }
.header-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: none;
  background: none;
  border-radius: var(--radius-base);
  color: var(--text-secondary);
  font-size: var(--font-sm);
  cursor: pointer;
}
.header-item:hover { background: var(--bg-fill-subtle); color: var(--text); }
.header-item i, .header-item svg { width: 15px; height: 15px; stroke-width: 2; }
.header-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 12px;
  background: var(--bg-fill);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: var(--font-xs);
  white-space: nowrap;
}
.btn i, .btn svg { width: 14px; height: 14px; stroke-width: 2; }
.content { padding: 12px var(--content-px) var(--content-pb); flex: 1; min-width: 0; }

/* PageContainer header */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0 16px;
  flex-wrap: wrap;
}
.page-header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.breadcrumb { font-size: var(--font-base); color: var(--text-tertiary); margin-bottom: 6px; line-height: 22px; }
.breadcrumb a { color: var(--text-tertiary); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .current { color: var(--text); font-weight: 500; }
.page-header h2 { font-size: var(--font-xl); line-height: 30px; color: var(--text); }
.avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-weak);
  color: var(--primary-text);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-xs);
  flex: none;
  overflow: hidden;
}
.avatar-lg { width: 32px; height: 32px; font-size: var(--font-base); }

/* ---------- Cards & Metrics ---------- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
  padding: 20px 24px;
  min-width: 0;
}
.card + .card { margin-top: 16px; }
.card-title {
  font-size: var(--font-lg);
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.metrics-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-card .metric-title { color: var(--text-tertiary); font-size: var(--font-sm); }
.metric-card .metric-value { font-size: var(--font-xxl); font-weight: 600; margin: 4px 0; line-height: 32px; }
.metric-card .metric-footer { color: var(--text-tertiary); font-size: var(--font-xs); }

.dash-split-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.two-col-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.stat-filter-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.stat-filter-item {
  height: 30px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  font-size: var(--font-sm);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}
.stat-filter-item:hover { color: var(--primary-text); border-color: var(--primary-border); }
.stat-filter-item.active {
  border-color: var(--primary);
  color: var(--primary-text);
  background: var(--primary-weak);
  font-weight: 600;
}

/* ---------- QueryFilter (filter-bar) ---------- */
.filter-bar {
  display: flex;
  gap: 12px 24px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px 24px 0;
  margin-bottom: 16px;
}
.filter-bar > .form-group, .filter-bar > .btn { margin-bottom: 20px; }
.filter-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(var(--filter-cols, 3), minmax(0, 1fr));
  gap: 0 24px;
}
.filter-item { display: flex; align-items: center; margin-bottom: 20px; min-width: 0; }
.filter-item > .form-label, .filter-item > label {
  flex: 0 0 var(--filter-label-w, 120px);
  text-align: right;
  padding-right: 10px;
  color: var(--text);
  font-size: var(--font-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.filter-item > .form-label::after, .filter-item > label::after { content: ":"; margin-left: 2px; }
.filter-item > :not(label):not(.form-label) { flex: 1; min-width: 0; width: 100%; }
.filter-item.is-collapsed { display: none; }
.filter-bar.expanded .filter-item.is-collapsed { display: flex; }
.filter-actions {
  grid-column: -2 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 20px;
  white-space: nowrap;
}
.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: none;
  color: var(--primary-text);
  cursor: pointer;
  padding: 0 0 0 6px;
  font-size: var(--font-sm);
}
.filter-toggle i, .filter-toggle svg { width: 14px; height: 14px; transition: transform 0.2s; }
.filter-bar.expanded .filter-toggle i, .filter-bar.expanded .filter-toggle svg { transform: rotate(180deg); }
.filter-toggle .when-expanded { display: none; }
.filter-bar.expanded .filter-toggle .when-expanded { display: inline; }
.filter-bar.expanded .filter-toggle .when-collapsed { display: none; }

/* ---------- ProTable Card ---------- */
.table-card { padding: 0; }
.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: 12px 24px;
  flex-wrap: wrap;
}
.list-toolbar-title {
  font-size: var(--font-lg);
  font-weight: 600;
  color: var(--text);
  line-height: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.list-toolbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  border-radius: var(--radius-base);
  color: var(--text-secondary);
  cursor: pointer;
}
.toolbar-icon-btn:hover { color: var(--primary-text); border-color: var(--primary-border); }
.toolbar-icon-btn i, .toolbar-icon-btn svg { width: 15px; height: 15px; stroke-width: 2; }
.toolbar-search { position: relative; display: inline-flex; align-items: center; width: 220px; }
.toolbar-search .form-input { width: 100%; padding-right: 32px; }
.toolbar-search > i, .toolbar-search > svg {
  position: absolute;
  right: 10px;
  width: 14px;
  height: 14px;
  color: var(--text-tertiary);
  pointer-events: none;
}
.table-wrap { padding: 0 24px; overflow-x: auto; width: 100%; }
.table-card > .pagination { padding: 16px 24px; margin-top: 0; }
.table-alert {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 24px 16px;
  padding: 12px 24px;
  border-radius: var(--radius);
  background: var(--primary-weak);
  border: 1px solid var(--primary-border);
}

/* ---------- Table (antd middle density) ---------- */
.ant-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--font-sm);
  background: var(--bg-card);
}
.ant-table thead th {
  position: relative;
  background: var(--table-header-bg);
  color: var(--text);
  font-weight: 600;
  text-align: left;
  padding: 11px 10px;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}
.ant-table thead th:first-child { border-top-left-radius: var(--radius-base); }
.ant-table thead th:last-child { border-top-right-radius: var(--radius-base); }
.ant-table thead th + th::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 1.4em;
  transform: translateY(-50%);
  background: var(--border-split);
}
.ant-table tbody td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.ant-table tbody tr:hover > td { background: var(--bg-hover); }
.ant-table tbody tr.selected > td, .ant-table tbody tr[aria-selected="true"] > td { background: var(--primary-weak); }
.ant-table .col-check { width: 44px; text-align: center; }
.ant-table .col-num { text-align: right; white-space: nowrap; }
.ant-table th.sortable { cursor: pointer; }
.row-ok { color: var(--success-text); }
.row-err { color: var(--error-text); }

/* FooterToolbar */
.footer-toolbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: var(--sidebar-w);
  z-index: 99;
  height: 56px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-footer-toolbar);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--border-split);
  box-shadow: var(--shadow-footer-toolbar);
  transition: left 0.2s ease;
}
.footer-toolbar-extra { color: var(--text); }
.footer-toolbar-extra .count { color: var(--primary-text); font-weight: 600; margin: 0 4px; }
.footer-toolbar-actions { display: flex; gap: 8px; }
.sidebar.collapsed ~ .main .footer-toolbar { left: var(--sidebar-collapsed-w); }
.content:has(.footer-toolbar:not([hidden])) { padding-bottom: 88px; }

/* ---------- Tag ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 7px;
  border-radius: var(--radius-sm);
  font-size: var(--font-xs);
  line-height: 20px;
  border: 1px solid var(--border);
  background: var(--bg-hover);
  color: var(--text);
  white-space: nowrap;
}
.tag-blue { color: var(--info-text); background: var(--info-weak); border-color: var(--info-border); }
.tag-green { color: var(--primary-text); background: var(--primary-weak); border-color: var(--primary-border); }
.tag-orange { color: var(--orange-text); background: var(--orange-weak); border-color: var(--orange-border); }
.tag-red { color: var(--error-text); background: var(--error-weak); border-color: var(--error-border); }
.tag-gray { color: var(--text-secondary); background: var(--bg-fill); border-color: var(--border); }

/* ---------- Badge & Status Dot ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--error);
  color: var(--text-inverse);
  font-size: var(--font-xs);
  line-height: 20px;
  box-shadow: 0 0 0 1px var(--bg-card);
}
.badge-dot { min-width: 6px; width: 6px; height: 6px; padding: 0; border-radius: 50%; }
.badge-status { display: inline-flex; align-items: center; gap: 8px; color: var(--text); white-space: nowrap; }
.badge-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  flex: none;
}
.badge-status.is-success::before { background: var(--success); }
.badge-status.is-error::before { background: var(--error); }
.badge-status.is-warning::before { background: var(--warning); }
.badge-status.is-processing::before { background: var(--primary); }
.badge-status.is-default::before { background: var(--border); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--control-h);
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-base);
  font-size: var(--font-base);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  background: var(--bg-card);
  color: var(--text);
}
.btn-primary {
  background: var(--primary-fill);
  color: var(--text-inverse);
  box-shadow: 0 2px 0 var(--focus-ring);
}
.btn-primary:hover { background: var(--primary-hover); color: var(--text-inverse); }
.btn-primary:active { background: var(--primary-active); }
.btn-outline {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.02);
}
.btn-outline:hover { color: var(--primary-text); border-color: var(--primary); }
.btn-danger { background: var(--error); color: var(--text-inverse); }
.btn-danger:hover { opacity: 0.88; }
.btn-danger-outline { background: var(--bg-card); border-color: var(--error); color: var(--error-text); }
.btn-danger-outline:hover { background: var(--error-weak); }
.btn-link {
  background: none;
  color: var(--primary-text);
  padding: 0;
  height: auto;
  border: none;
  box-shadow: none;
}
.btn-link:hover { color: var(--primary-hover); }
.btn-link.danger, .btn-link.btn-danger-link { color: var(--error-text); }
.btn-text { background: none; border: none; color: var(--text); }
.btn-text:hover { background: var(--bg-fill-hover); }
.btn-sm { height: var(--control-h-sm); padding: 0 8px; font-size: var(--font-xs); border-radius: var(--radius-sm); }
.btn-lg { height: var(--control-h-lg); padding: 0 16px; font-size: var(--font-lg); border-radius: var(--radius); }
.btn[disabled], .btn.disabled {
  color: var(--text-muted);
  background: var(--bg-disabled);
  border-color: var(--border);
  box-shadow: none;
  cursor: not-allowed;
}
.btn-link[disabled], .btn-link.disabled { background: none; border: none; }
.btn-group { display: inline-flex; }
.btn-group > .btn { border-radius: 0; border-color: var(--border); }
.btn-group > .btn + .btn { margin-left: -1px; }
.btn-group > .btn:first-child { border-radius: var(--radius-base) 0 0 var(--radius-base); }
.btn-group > .btn:last-child { border-radius: 0 var(--radius-base) var(--radius-base) 0; }
.btn-group > .btn.active { background: var(--primary-weak); color: var(--primary-text); border-color: var(--primary); z-index: 1; font-weight: 600; }

/* Action cell (LinkButton + Divider) */
.action-cell { display: flex; gap: 0; align-items: center; white-space: nowrap; }
.action-cell > .btn-link { padding: 0; }
.action-divider {
  display: inline-block;
  width: 1px;
  height: 0.9em;
  margin: 0 8px;
  background: var(--border-split);
  vertical-align: middle;
  flex: none;
}

/* ---------- Forms (ProForm vertical) ---------- */
.form-row { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.form-group { display: flex; flex-direction: column; gap: 6px; min-width: 160px; }
.form-group + .form-group { margin-top: 16px; }
.form-row .form-group + .form-group { margin-top: 0; }
.form-label { font-size: var(--font-base); color: var(--text); line-height: 22px; font-weight: 500; }
.form-label.form-required::before { content: "*"; color: var(--error); margin-right: 4px; }
.form-help { font-size: var(--font-xs); color: var(--text-tertiary); line-height: 18px; }
.form-error { font-size: var(--font-xs); color: var(--error-text); line-height: 18px; }
.form-input, .form-select, .form-textarea {
  height: var(--control-h);
  padding: 4px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
  font-size: var(--font-base);
  color: var(--text);
  background: var(--bg-card);
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.form-textarea { height: auto; min-height: 76px; padding: 8px 11px; resize: vertical; line-height: var(--line-height); }
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-input:hover, .form-select:hover, .form-textarea:hover { border-color: var(--primary); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px var(--focus-ring);
}
.form-input[disabled], .form-textarea[disabled] { background: var(--bg-disabled); color: var(--text-muted); cursor: not-allowed; }
.form-input[readonly] { background: var(--bg-fill); }
.form-group.has-error .form-input,
.form-group.has-error .form-textarea,
.form-group.has-error .select-trigger { border-color: var(--error); }
.form-group.has-error .form-input:focus { box-shadow: 0 0 0 2px var(--error-weak); }
.form-count { align-self: flex-end; font-size: var(--font-xs); color: var(--text-tertiary); }
.form-actions { display: flex; gap: 8px; margin-top: 12px; }

/* Select (combobox + listbox) */
.select { position: relative; display: inline-block; min-width: 140px; }
.form-group > .select, .filter-item > .select { display: block; width: 100%; }
.select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: var(--control-h);
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
  background: var(--bg-card);
  color: var(--text);
  font-size: var(--font-base);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.select-trigger:hover { border-color: var(--primary); }
.select-trigger[aria-expanded="true"] { border-color: var(--primary); box-shadow: 0 0 0 2px var(--focus-ring); }
.select-trigger[disabled] { background: var(--bg-disabled); color: var(--text-muted); cursor: not-allowed; }
.select-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-value.ph { color: var(--text-muted); }
.select-trigger .chev, .select-trigger i, .select-trigger svg {
  width: 14px;
  height: 14px;
  color: var(--text-tertiary);
  flex: none;
  transition: transform 0.2s;
}
.select-trigger[aria-expanded="true"] .chev { transform: rotate(180deg); }
.select-popup, .date-popup {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  max-height: 256px;
  overflow-y: auto;
  z-index: 320;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-popup);
  padding: 4px;
}
.select-option {
  display: block;
  width: 100%;
  min-height: 32px;
  padding: 5px 12px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: var(--font-sm);
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
.select-option:hover { background: var(--bg-fill-hover); }
.select-option[aria-selected="true"] { background: var(--primary-weak); color: var(--primary-text); font-weight: 600; }
.select-option[aria-disabled="true"] { color: var(--text-muted); cursor: not-allowed; background: none; }

/* DatePicker */
.date-picker { position: relative; display: block; width: 100%; }
.date-trigger {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: var(--control-h);
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
  background: var(--bg-card);
  color: var(--text);
  font-size: var(--font-sm);
  cursor: pointer;
  text-align: left;
}
.date-trigger:hover { border-color: var(--primary); }
.date-trigger .range-sep { color: var(--text-muted); }
.date-trigger i, .date-trigger svg { width: 14px; height: 14px; color: var(--text-tertiary); margin-left: auto; flex: none; }
.date-popup { width: 276px; padding: 10px 12px; }
.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  border-bottom: 1px solid var(--border-split);
  font-weight: 600;
  font-size: var(--font-sm);
  margin-bottom: 8px;
}
.calendar { display: grid; grid-template-columns: repeat(7, 32px); gap: 4px; justify-content: space-between; }
.calendar-cell {
  width: 32px;
  height: 26px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  font-size: var(--font-xs);
  color: var(--text);
  cursor: pointer;
}
.calendar-cell:hover { background: var(--bg-fill-hover); }
.calendar-cell.is-muted { color: var(--text-muted); cursor: default; }
.calendar-cell.is-today { box-shadow: inset 0 0 0 1px var(--primary); }
.calendar-cell.is-selected { background: var(--primary-fill); color: var(--text-inverse); }
.calendar-cell.in-range { background: var(--primary-weak); border-radius: 0; }

/* InputNumber */
.input-number {
  display: inline-flex;
  align-items: stretch;
  height: var(--control-h);
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
  background: var(--bg-card);
  overflow: hidden;
}
.input-number:hover { border-color: var(--primary); }
.input-number:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px var(--focus-ring); }
.input-number input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  padding: 0 10px;
  font-size: var(--font-base);
  color: var(--text);
  background: none;
}
.input-number input::-webkit-outer-spin-button,
.input-number input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input-number input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.input-number-step {
  width: 28px;
  border: none;
  border-left: 1px solid var(--border-light);
  background: var(--bg-fill);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.input-number-step:hover { color: var(--primary-text); background: var(--primary-weak); }
.input-number-step i, .input-number-step svg { width: 12px; height: 12px; }

/* Switch */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 44px;
  min-width: 44px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 100px;
  background: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s;
  vertical-align: middle;
}
.switch:hover { background: var(--text-tertiary); }
.switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 2px 4px 0 rgba(0, 35, 11, 0.2);
  transition: left 0.2s;
}
.switch[aria-checked="true"] { background: var(--primary); }
.switch[aria-checked="true"]:hover { background: var(--primary-hover); }
.switch[aria-checked="true"] .switch-knob { left: 24px; }
.switch[disabled] { opacity: 0.65; cursor: not-allowed; }

/* Checkbox & Radio */
.checkbox, .radio {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text);
  line-height: 22px;
  margin-right: 12px;
}
.checkbox input, .radio input {
  position: absolute;
  opacity: 0;
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
}
.checkbox-box, .radio-dot {
  position: relative;
  width: 16px;
  height: 16px;
  flex: none;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: all 0.2s;
}
.checkbox-box { border-radius: var(--radius-sm); }
.radio-dot { border-radius: 50%; }
.checkbox:hover .checkbox-box, .radio:hover .radio-dot { border-color: var(--primary); }
.checkbox input:checked + .checkbox-box { background: var(--primary-fill); border-color: var(--primary-fill); }
.checkbox input:checked + .checkbox-box::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 26%;
  width: 5.5px;
  height: 9px;
  border: 2px solid var(--white);
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg) translate(-50%, -50%);
}
.checkbox input:indeterminate + .checkbox-box::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background: var(--primary-fill);
  transform: translate(-50%, -50%);
}
.radio input:checked + .radio-dot { background: var(--primary-fill); border-color: var(--primary-fill); }
.radio input:checked + .radio-dot::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--white);
  transform: translate(-50%, -50%);
}
.checkbox input:focus-visible + .checkbox-box,
.radio input:focus-visible + .radio-dot { outline: 2px solid var(--primary-border); outline-offset: 1px; }
.checkbox input:disabled + .checkbox-box,
.radio input:disabled + .radio-dot { background: var(--bg-disabled); border-color: var(--border); }
.checkbox:has(input:disabled), .radio:has(input:disabled) { color: var(--text-muted); cursor: not-allowed; }

/* Upload */
.upload { display: flex; flex-direction: column; gap: 8px; }
.upload-trigger {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 96px;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-fill);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.2s;
  text-align: center;
}
.upload-trigger:hover { border-color: var(--primary); }
.upload-trigger input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-trigger i, .upload-trigger svg { width: 22px; height: 22px; color: var(--primary); }
.upload-trigger.is-card { width: 120px; height: 108px; min-height: 0; padding: 8px; font-size: var(--font-xs); }
.upload-list { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.upload-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: var(--font-sm);
}
.upload-item:hover { background: var(--bg-fill-hover); }
.upload-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item .size { color: var(--text-tertiary); font-size: var(--font-xs); }
.upload-item.is-error, .upload-item.is-error .name { color: var(--error-text); }
.upload-item i, .upload-item svg { width: 14px; height: 14px; color: var(--text-tertiary); flex: none; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-mask);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 72px;
  padding-bottom: 40px;
  z-index: 220;
  overflow-y: auto;
}
.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  width: min(var(--modal-w, 680px), calc(100vw - 32px));
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-popup);
  padding: 20px 24px;
}
.modal.modal-sm { --modal-w: 440px; }
.modal.modal-md { --modal-w: 640px; }
.modal.modal-lg { --modal-w: 880px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  font-size: var(--font-lg);
  font-weight: 600;
  line-height: 24px;
}
.modal-body { padding: 4px 0 8px; overflow-y: auto; flex: 1; }
.modal-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-split);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.modal-header .btn-link, .drawer-header .btn-link { color: var(--text-tertiary); font-weight: 400; }
.modal-header .btn-link:hover, .drawer-header .btn-link:hover { color: var(--text); }

/* ---------- Drawer ---------- */
.drawer-overlay { position: fixed; inset: 0; background: var(--bg-mask); z-index: 210; }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(var(--drawer-w, 640px), 94vw);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-drawer);
}
.drawer.drawer-sm { --drawer-w: 420px; }
.drawer.drawer-lg { --drawer-w: 720px; }
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-split);
  font-size: var(--font-lg);
  font-weight: 600;
  line-height: 24px;
}
.drawer-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.drawer-footer {
  padding: 12px 24px;
  border-top: 1px solid var(--border-split);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ---------- Descriptions / Divider / Bordered ---------- */
.descriptions-title { font-size: var(--font-md, 15px); font-weight: 600; margin-bottom: 12px; }
.descriptions { display: grid; grid-template-columns: repeat(var(--desc-cols, 2), minmax(0, 1fr)); gap: 0 24px; }
.descriptions.cols-1 { --desc-cols: 1; }
.descriptions.cols-3 { --desc-cols: 3; }
.desc-row { display: flex; align-items: baseline; padding-bottom: 12px; min-width: 0; font-size: var(--font-sm); }
.desc-row.span-all { grid-column: 1 / -1; }
.desc-label { flex: none; color: var(--text-tertiary); white-space: nowrap; }
.desc-label::after { content: ":"; margin: 0 8px 0 2px; }
.desc-value { flex: 1; min-width: 0; color: var(--text); word-break: break-word; }
.divider { height: 1px; background: var(--border-split); margin: 20px 0; border: none; }
.divider-text {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  height: auto;
  background: none;
  font-weight: 600;
  font-size: var(--font-base);
  color: var(--text);
}
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--border-split); }
.divider-vertical { display: inline-block; width: 1px; height: 0.9em; margin: 0 8px; vertical-align: middle; }
.bordered { border: 1px solid var(--border-light); border-radius: var(--radius); padding: 16px; }
.bordered-title { font-weight: 600; margin-bottom: 12px; }

/* ---------- Progress / Timeline / Stepper ---------- */
.progress-bar { height: 8px; background: var(--bg-fill-strong); border-radius: 100px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 100px; }
.progress-bar.is-success .progress-fill { background: var(--success); }
.progress-bar.is-error .progress-fill { background: var(--error); }
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 8px; bottom: 8px; width: 2px; background: var(--border-split); }
.timeline-item { position: relative; padding-bottom: 16px; line-height: var(--line-height); font-size: var(--font-sm); }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 3px solid var(--primary);
  box-sizing: border-box;
}
.timeline-item.is-error::before { border-color: var(--error); }
.timeline-item.is-success::before { border-color: var(--success); }
.timeline-item.is-warning::before { border-color: var(--warning); }
.timeline-item .time { color: var(--text-tertiary); font-size: var(--font-xs); margin-top: 2px; }

/* ---------- Pagination / Empty ---------- */
.pagination { display: flex; gap: 6px; justify-content: flex-end; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.pagination-total { color: var(--text-secondary); font-size: var(--font-sm); margin-right: 8px; }
.pagination > span:not(.pagination-total), .pagination .page-item {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius-base);
  background: none;
  font-size: var(--font-sm);
  color: var(--text);
  cursor: pointer;
}
.pagination > span:not(.pagination-total):hover, .pagination .page-item:hover { background: var(--bg-fill-strong); }
.pagination .active { border-color: var(--primary); color: var(--primary-text); background: var(--bg-card); font-weight: 600; }
.pagination .page-item[disabled], .pagination .page-item.disabled { color: var(--text-muted); cursor: not-allowed; background: none; }
.pagination .page-item i, .pagination .page-item svg { width: 12px; height: 12px; }

.empty-state { text-align: center; padding: 36px 20px; color: var(--text-tertiary); }
.empty-state .empty-icon { display: inline-flex; color: var(--text-muted); margin-bottom: 10px; }
.empty-state .empty-icon i, .empty-state .empty-icon svg { width: 40px; height: 40px; stroke-width: 1.5; }
.empty-state-title { font-size: var(--font-base); font-weight: 600; color: var(--text); margin-bottom: 4px; }
.empty-state-desc { font-size: var(--font-sm); color: var(--text-tertiary); margin-bottom: 14px; }

/* ---------- Tabs ---------- */
.tab-bar { display: flex; gap: 28px; border-bottom: 1px solid var(--border-split); margin-bottom: 16px; overflow-x: auto; }
.tab-item {
  padding: 10px 0;
  margin-bottom: -1px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  font-size: var(--font-base);
  font-weight: 500;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tab-item:hover { color: var(--primary-text); }
.tab-item.active { color: var(--primary-text); border-bottom-color: var(--primary); font-weight: 600; }
.tab-item[disabled] { color: var(--text-muted); cursor: not-allowed; }
.tabs { display: block; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- i18n-input ---------- */
.i18n-input { border: 1px solid var(--border); border-radius: var(--radius-base); overflow: hidden; background: var(--bg-card); }
.i18n-tabs { display: flex; background: var(--bg-hover); border-bottom: 1px solid var(--border-light); }
.i18n-tab {
  border: none;
  background: none;
  padding: 6px 12px;
  font-size: var(--font-xs);
  color: var(--text-tertiary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-weight: 500;
}
.i18n-tab.active { color: var(--primary-text); border-bottom-color: var(--primary); font-weight: 600; }
.i18n-required { color: var(--error); margin-left: 2px; }
.i18n-panel { display: none; padding: 8px; }
.i18n-panel.active { display: block; }
.i18n-input .form-input, .i18n-input .form-textarea { width: 100%; }

/* ---------- Alert Strip ---------- */
.alert-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: var(--font-sm);
  border: 1px solid transparent;
  color: var(--text);
}
.alert-strip-body { display: flex; align-items: center; gap: 8px; min-width: 0; }
.alert-strip i, .alert-strip svg { width: 16px; height: 16px; flex: none; }
.banner-success { background: var(--success-weak); border-color: var(--success-border); }
.banner-success i, .banner-success svg { color: var(--success-text); }
.banner-warn { background: var(--warning-weak); border-color: var(--warning-border); }
.banner-warn i, .banner-warn svg { color: var(--warning-text); }
.banner-info { background: var(--info-weak); border-color: var(--info-border); }
.banner-info i, .banner-info svg { color: var(--info-text); }
.banner-error { background: var(--error-weak); border-color: var(--error-border); }
.banner-error i, .banner-error svg { color: var(--error-text); }

/* ---------- Dropdown / Popconfirm / Tooltip ---------- */
.dropdown, .popover-host, .has-tooltip { position: relative; display: inline-flex; align-items: center; }
.dropdown-trigger { display: inline-flex; align-items: center; gap: 4px; }
.dropdown-trigger i, .dropdown-trigger svg { width: 12px; height: 12px; }
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 148px;
  z-index: 310;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-popup);
  padding: 4px;
}
.dropdown.open > .dropdown-menu { display: block; }
.dropdown-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 12px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  font-size: var(--font-sm);
  line-height: 20px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
}
.dropdown-menu .dropdown-item:hover { background: var(--bg-fill-hover); }
.dropdown-menu .dropdown-item.is-selected { background: var(--primary-weak); color: var(--primary-text); font-weight: 600; }
.dropdown-menu .dropdown-item.danger { color: var(--error-text); }
.dropdown-menu .dropdown-item.danger:hover { background: var(--error-weak); }
.dropdown-menu .dropdown-item[aria-disabled="true"] { color: var(--text-muted); cursor: not-allowed; background: none; }
.dropdown-menu .dropdown-divider { height: 1px; background: var(--border-split); margin: 4px 0; }

.popconfirm {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  z-index: 310;
  width: max-content;
  max-width: 300px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-popup);
  padding: 12px 14px;
  white-space: normal;
  text-align: left;
}
.popover-host.open > .popconfirm { display: block; }
.popconfirm-title { display: flex; align-items: flex-start; gap: 8px; font-weight: 600; font-size: var(--font-sm); color: var(--text); }
.popconfirm-title i, .popconfirm-title svg { width: 14px; height: 14px; color: var(--warning-text); flex: none; margin-top: 3px; }
.popconfirm-desc { margin: 4px 0 0 22px; color: var(--text-secondary); font-size: var(--font-xs); }
.popconfirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

.tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 330;
  width: max-content;
  max-width: 260px;
  padding: 6px 10px;
  border-radius: var(--radius-base);
  background: var(--bg-tooltip);
  color: var(--text-inverse);
  font-size: var(--font-xs);
  line-height: 1.45;
  white-space: normal;
  font-weight: 400;
}
.has-tooltip:hover > .tooltip, .has-tooltip:focus-within > .tooltip { display: block; }
.tip-icon { display: inline-flex; color: var(--text-tertiary); cursor: help; margin-left: 4px; vertical-align: middle; }
.tip-icon i, .tip-icon svg { width: 14px; height: 14px; }

/* ---------- Global Toast (message) ---------- */
.toast {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1010;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-popup);
  color: var(--text);
  font-size: var(--font-base);
}
.toast-icon-slot { display: inline-flex; align-items: center; }
.toast-icon { width: 16px; height: 16px; flex: none; color: var(--primary); }
.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--error); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--info); }

/* ---------- Skeleton / Spin / Result ---------- */
.skeleton {
  display: block;
  height: 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--bg-fill-strong) 25%, var(--border-light) 37%, var(--bg-fill-strong) 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
}
.skeleton + .skeleton { margin-top: 14px; }
.skeleton.skeleton-title { width: 38%; height: 18px; }
.skeleton.skeleton-line-short { width: 61%; }
@keyframes skeleton-loading { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.spin { display: inline-flex; flex-direction: column; align-items: center; gap: 8px; color: var(--primary-text); }
.spin svg, .spin i { width: 20px; height: 20px; animation: spin-rotate 1s linear infinite; }
.spin-text { font-size: var(--font-sm); color: var(--text-secondary); }
@keyframes spin-rotate { to { transform: rotate(360deg); } }

.result { text-align: center; padding: 48px 32px; background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border-light); }
.result-icon { display: inline-flex; margin-bottom: 18px; color: var(--primary); }
.result-icon i, .result-icon svg { width: 64px; height: 64px; stroke-width: 1.5; }
.result.is-success .result-icon { color: var(--success); }
.result.is-error .result-icon { color: var(--error); }
.result.is-warning .result-icon, .result.is-403 .result-icon { color: var(--warning); }
.result-title { font-size: var(--font-xl); line-height: 28px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.result-desc { color: var(--text-secondary); font-size: var(--font-base); max-width: 520px; margin: 0 auto; }
.result-extra { margin-top: 20px; display: flex; justify-content: center; gap: 8px; }
.runtime-state { padding: 0; }

/* ---------- Domain helpers (charts, code blocks, QR grids, sub-tables) ---------- */
.chart-box { width: 100%; overflow: hidden; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: var(--font-xs); color: var(--text-secondary); margin-top: 8px; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.code-block {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius-base);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: var(--font-xs);
  line-height: 1.55;
  color: var(--text);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.qr-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-base);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  background: var(--bg-card);
}
.sub-table-wrap { border: 1px solid var(--border-light); border-radius: var(--radius-base); overflow-x: auto; }
.ems-stat-list { display: flex; flex-direction: column; gap: 12px; }
.ems-stat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-base);
  background: var(--bg-fill);
  border: 1px solid var(--border-light);
}
.ems-stat-label { font-size: var(--font-sm); color: var(--text-secondary); }
.ems-stat-val { font-size: var(--font-lg); font-weight: 600; color: var(--text); }

[hidden] { display: none !important; }

/* ---------- Accessibility ---------- */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--radius-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ---------- User dropdown ---------- */
.user-menu { position: relative; }
.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-base);
  color: var(--text-secondary);
  border: none;
  background: none;
  font-size: var(--font-sm);
}
.user-menu-trigger:hover { background: var(--bg-fill-subtle); color: var(--text); }
.user-menu-trigger .chev, .user-menu-trigger svg.chev { transition: transform 0.2s; color: var(--text-tertiary); width: 12px; height: 12px; }
.user-menu.open .user-menu-trigger .chev { transform: rotate(180deg); }
.user-menu.open .user-dropdown { display: block; }
.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 196px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-popup);
  padding: 4px;
  z-index: 310;
}
.user-dropdown .dropdown-header { padding: 8px 12px; border-bottom: 1px solid var(--border-split); margin-bottom: 4px; }
.user-dropdown .u-name { font-weight: 600; font-size: var(--font-sm); }
.user-dropdown .u-role { font-size: var(--font-xs); color: var(--text-tertiary); margin-top: 2px; }
.user-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 12px;
  line-height: 20px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  font-size: var(--font-sm);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.user-dropdown .dropdown-item:hover { background: var(--bg-fill-hover); }
.user-dropdown .dropdown-item i, .user-dropdown .dropdown-item svg { width: 14px; height: 14px; color: var(--text-secondary); }
.user-dropdown .dropdown-item.danger { color: var(--error-text); }
.user-dropdown .dropdown-item.danger:hover { background: var(--error-weak); }
.user-dropdown .dropdown-divider { height: 1px; background: var(--border-split); margin: 4px 0; }

/* ---------- Responsive (1280px - 1920px & narrow) ---------- */
@media (max-width: 1320px) {
  .content { padding: 12px 24px var(--content-pb); }
  .dash-split-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1200px) {
  .filter-grid { --filter-cols: 2; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { width: 224px; background: var(--bg-card); transform: translateX(-100%); transition: transform 0.25s; }
  .sidebar.open { transform: translateX(0); }
  .sider-collapse-btn { display: none; }
  .main, .sidebar.collapsed ~ .main { margin-left: 0; }
  .footer-toolbar, .sidebar.collapsed ~ .main .footer-toolbar { left: 0; }
  .content { padding: 8px 16px 24px; }
  .filter-grid { --filter-cols: 1; }
  .filter-item > .form-label, .filter-item > label { flex-basis: 96px; }
  .descriptions { --desc-cols: 1; }
  .metrics-grid, .metrics-grid-3 { grid-template-columns: 1fr; }
}
