/* ==========================================================================
   财鱼 · Lucky Fish Enterprise UI V4 Design System
   3 Built-in Flagship Skins:
   - A. obsidian : 曜石流金 (Obsidian Gold — Default)
   - B. emerald  : 深海翡翠 (Deep Ocean Emerald)
   - C. stripe   : 极简白昼 (Stripe / Mercury Inset Light Canvas)
   ========================================================================== */

:root,
html[data-skin="obsidian"] {
  --sh-outer: #07080c;
  --sh-sidebar-bg: #07080c;
  --sh-sidebar-text: #f4f5f8;
  --sh-sidebar-muted: #949cb0;
  --sh-sidebar-subtle: #5a6275;
  --sh-sidebar-hover: rgba(255, 255, 255, 0.045);
  --sh-sidebar-active-bg: linear-gradient(90deg, rgba(245, 158, 11, 0.16) 0%, rgba(245, 158, 11, 0.04) 100%);
  --sh-sidebar-active-text: #fbbf24;
  --sh-sidebar-border: rgba(255, 255, 255, 0.065);

  --bg: #0d0f15;
  --bg-elevated: #131620;
  --bg-muted: #181c28;
  --bg-hover: rgba(255, 255, 255, 0.035);
  --text: #f3f4f6;
  --text-muted: #8e96aa;
  --text-subtle: #5d6579;
  --border: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.15);

  --primary: #f59e0b;
  --primary-hover: #fbbf24;
  --primary-soft: rgba(245, 158, 11, 0.14);
  --btn-primary-bg: #f59e0b;
  --btn-primary-hover: #fbbf24;
  --btn-primary-fg: #090a0f;
  --btn-primary-shadow: 0 2px 10px rgba(245, 158, 11, 0.22);

  --emerald: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.13);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.13);
  --rose: #f43f5e;
  --rose-soft: rgba(244, 63, 94, 0.13);
  --sky: #38bdf8;
  --sky-soft: rgba(56, 189, 248, 0.13);

  --card-highlight: inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
  --ws-canvas-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 20px 48px -12px rgba(0, 0, 0, 0.7);
  --shadow: 0 16px 38px -8px rgba(0, 0, 0, 0.56);
  --chk-tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23090a0f' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.2L6.6 11.3L12.5 4.8'/%3E%3C/svg%3E");
  --sel-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238e96aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

html[data-skin="emerald"] {
  --sh-outer: #040c0f;
  --sh-sidebar-bg: #040c0f;
  --sh-sidebar-text: #ecfeff;
  --sh-sidebar-muted: #86a9b2;
  --sh-sidebar-subtle: #51727b;
  --sh-sidebar-hover: rgba(20, 184, 166, 0.06);
  --sh-sidebar-active-bg: linear-gradient(90deg, rgba(20, 184, 166, 0.18) 0%, rgba(20, 184, 166, 0.04) 100%);
  --sh-sidebar-active-text: #2dd4bf;
  --sh-sidebar-border: rgba(148, 210, 205, 0.085);

  --bg: #081418;
  --bg-elevated: #0d1d22;
  --bg-muted: #12262d;
  --bg-hover: rgba(20, 184, 166, 0.05);
  --text: #ecfeff;
  --text-muted: #88aab2;
  --text-subtle: #56767e;
  --border: rgba(148, 210, 205, 0.1);
  --border-strong: rgba(148, 210, 205, 0.2);

  --primary: #14b8a6;
  --primary-hover: #2dd4bf;
  --primary-soft: rgba(20, 184, 166, 0.14);
  --btn-primary-bg: #14b8a6;
  --btn-primary-hover: #2dd4bf;
  --btn-primary-fg: #041311;
  --btn-primary-shadow: 0 2px 10px rgba(20, 184, 166, 0.22);

  --emerald: #22c55e;
  --emerald-soft: rgba(34, 197, 94, 0.13);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.13);
  --rose: #fb7185;
  --rose-soft: rgba(251, 113, 133, 0.13);
  --sky: #38bdf8;
  --sky-soft: rgba(56, 189, 248, 0.13);

  --card-highlight: inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
  --ws-canvas-shadow: 0 0 0 1px rgba(148, 210, 205, 0.1), 0 20px 48px -12px rgba(0, 0, 0, 0.7);
  --shadow: 0 16px 38px -8px rgba(0, 0, 0, 0.56);
  --chk-tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23041311' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.2L6.6 11.3L12.5 4.8'/%3E%3C/svg%3E");
  --sel-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2388aab2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

html[data-skin="stripe"] {
  --sh-outer: #eef2f7;
  --sh-sidebar-bg: #eef2f7;
  --sh-sidebar-text: #0f172a;
  --sh-sidebar-muted: #4b586e;
  --sh-sidebar-subtle: #8492a6;
  --sh-sidebar-hover: rgba(15, 23, 42, 0.05);
  --sh-sidebar-active-bg: #ffffff;
  --sh-sidebar-active-text: #0f172a;
  --sh-sidebar-border: rgba(15, 23, 42, 0.08);

  --bg: #f8fafd;
  --bg-elevated: #ffffff;
  --bg-muted: #f1f5f9;
  --bg-hover: #f4f7fb;
  --text: #0f172a;
  --text-muted: #526077;
  --text-subtle: #8795a8;
  --border: #e3e8f0;
  --border-strong: #cbd5e1;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: rgba(37, 99, 235, 0.09);
  --btn-primary-bg: #0f172a;
  --btn-primary-hover: #1e293b;
  --btn-primary-fg: #ffffff;
  --btn-primary-shadow: 0 2px 6px rgba(15, 23, 42, 0.14);

  --emerald: #059669;
  --emerald-soft: rgba(5, 150, 105, 0.1);
  --amber: #d97706;
  --amber-soft: rgba(217, 119, 6, 0.1);
  --rose: #e11d48;
  --rose-soft: rgba(225, 29, 72, 0.09);
  --sky: #0284c7;
  --sky-soft: rgba(2, 132, 199, 0.1);

  --card-highlight: 0 1px 3px rgba(15, 23, 42, 0.04);
  --ws-canvas-shadow: 0 4px 16px rgba(15, 23, 42, 0.05), 0 0 0 1px #dfe5ee;
  --shadow: 0 14px 34px -6px rgba(15, 23, 42, 0.12);
  --chk-tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.2L6.6 11.3L12.5 4.8'/%3E%3C/svg%3E");
  --sel-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23526077' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--sh-outer);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Refined Left Sidebar (248px Direct Enterprise Navigation)
   ========================================================================== */
.layout {
  display: flex;
  min-height: 100vh;
  background: var(--sh-outer);
}

.sidebar {
  width: 248px;
  background: var(--sh-sidebar-bg);
  color: var(--sh-sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  padding: 12px 10px 12px 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 8px 14px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.22);
}

.brand-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.brand-title {
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: -0.2px;
  color: var(--sh-sidebar-text);
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-pro-tag {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--primary-soft);
  color: var(--primary);
}

.brand-sub {
  font-size: 11.5px;
  color: var(--sh-sidebar-subtle);
  margin-top: 2px;
}

.sidebar-quick-search {
  margin: 0 4px 10px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--sh-sidebar-hover);
  border: 1px solid var(--sh-sidebar-border);
  color: var(--sh-sidebar-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-quick-search:hover {
  color: var(--sh-sidebar-text);
  border-color: var(--border-strong);
}

.kbd-chip {
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(128, 128, 128, 0.14);
  color: var(--sh-sidebar-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.nav-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 2px 4px 12px;
  scrollbar-width: thin;
}

.nav-group-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--sh-sidebar-subtle);
  padding: 14px 10px 5px;
}

.nav-group-label:first-child {
  padding-top: 8px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 35px;
  border: none;
  background: transparent;
  color: var(--sh-sidebar-muted);
  padding: 0 11px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.14s ease;
  text-align: left;
  margin-bottom: 2px;
}

.nav-item-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.nav-item-label svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.76;
  transition: opacity 0.14s, color 0.14s;
}

.nav-item:hover {
  background: var(--sh-sidebar-hover);
  color: var(--sh-sidebar-text);
}

.nav-item:hover .nav-item-label svg {
  opacity: 1;
}

.nav-item.active {
  background: var(--sh-sidebar-active-bg);
  color: var(--sh-sidebar-active-text);
  font-weight: 600;
}

html[data-skin="stripe"] .nav-item.active {
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.07), 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 99px;
  background: var(--primary);
}

.nav-item.active .nav-item-label svg {
  opacity: 1;
  color: var(--primary);
}

.nav-count {
  font-size: 11px;
  color: var(--sh-sidebar-subtle);
  font-variant-numeric: tabular-nums;
}

.nav-item.active .nav-count {
  color: var(--sh-sidebar-active-text);
  opacity: 0.9;
}

.sidebar-footer {
  border-top: 1px solid var(--sh-sidebar-border);
  padding: 10px 4px 2px;
}

.account-bar {
  padding: 8px 9px;
  border-radius: 10px;
  background: var(--sh-sidebar-hover);
  border: 1px solid var(--sh-sidebar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.account-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12.5px;
  flex-shrink: 0;
}

.icon-ghost-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--sh-sidebar-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.14s ease;
}

.icon-ghost-btn:hover {
  background: rgba(128, 128, 128, 0.15);
  color: var(--sh-sidebar-text);
}

.icon-ghost-btn.danger:hover {
  background: var(--rose-soft);
  color: var(--rose);
}

/* ==========================================================================
   Inset Elevated Workspace Shell & Executive Header
   ========================================================================== */
.workspace-shell {
  flex: 1;
  margin: 8px 8px 8px 248px;
  min-width: 0;
  min-height: calc(100vh - 16px);
  background: var(--bg);
  border-radius: 14px;
  box-shadow: var(--ws-canvas-shadow);
  display: flex;
  flex-direction: column;
  overflow: clip;
}

.exec-header {
  height: 54px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.exec-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  min-width: 0;
}

.exec-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--emerald-soft);
  color: var(--emerald);
  margin-left: 6px;
}

.skin-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
}

.skin-pill {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.skin-pill:hover {
  color: var(--text);
}

.skin-pill.active {
  background: var(--bg-elevated);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
}

.skin-swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.main-area {
  flex: 1;
  min-width: 0;
  padding: 24px 28px 92px;
}

.main-area > * {
  max-width: 1460px;
  margin-left: auto;
  margin-right: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.topbar > div:first-child {
  flex: 1;
  min-width: 240px;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text);
  line-height: 1.25;
}

.page-desc {
  color: var(--text-muted);
  font-size: 12.5px;
  margin-top: 4px;
}

/* ==========================================================================
   Bento Dashboard Architecture (2x2 KPI Cards + Full-Bleed Area Chart)
   ========================================================================== */
.bento-top-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

.bento-kpi-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.bento-stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 16px 18px;
  box-shadow: var(--card-highlight);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 112px;
}

.stat-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stat-card-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.stat-icon-tile {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-tile svg {
  width: 15px;
  height: 15px;
}

.stat-card-val {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.6px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  margin: 6px 0 4px;
  line-height: 1.15;
}

.stat-card-foot {
  font-size: 11.5px;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  gap: 6px;
}

.bento-chart-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 16px 20px 14px;
  box-shadow: var(--card-highlight);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.chart-x-axis {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-subtle);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

/* Unified Hairline Metric Strip & Upgraded KPI Grid */
.metric-overview-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 13px;
  box-shadow: var(--card-highlight);
  overflow: hidden;
  margin-bottom: 18px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
}

.metric-cell {
  padding: 16px 18px;
  border-right: 1px solid var(--border);
}

.metric-cell:last-child {
  border-right: none;
}

.metric-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.metric-number {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.metric-foot {
  font-size: 11.5px;
  color: var(--text-subtle);
  margin-top: 4px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 16px 18px;
  box-shadow: var(--card-highlight);
}

.kpi-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.kpi-sub {
  font-size: 11.5px;
  color: var(--text-subtle);
  margin-top: 4px;
}

/* ==========================================================================
   Smart Cards (Guaranteed Safe Padding + Flush Table Support)
   ========================================================================== */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 13px;
  box-shadow: var(--card-highlight);
  padding: 18px 20px;
  margin-bottom: 18px;
}

.card:has(> .table-wrap),
.card:has(> .toolbar) {
  padding: 0;
  overflow: hidden;
}

.card:has(> .toolbar) > :not(.toolbar):not(.table-wrap) {
  padding: 16px 20px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.toolbar:last-child {
  border-bottom: none;
}

/* ==========================================================================
   Precision Form Controls, Custom Checkboxes & Buttons
   ========================================================================== */
.input,
.select,
.textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 6.5px 11px;
  min-height: 34px;
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.select {
  appearance: none;
  -webkit-appearance: none;
  background-image: var(--sel-arrow);
  background-repeat: no-repeat;
  background-position: right 9px center;
  padding-right: 30px;
  cursor: pointer;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-soft);
}

.textarea {
  width: 100%;
  min-height: 76px;
  padding: 9px 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
}

/* Custom Enterprise Checkbox (Replaces raw Windows white squares) */
input[type="checkbox"]:not(.lf-switch-input) {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 4.5px;
  background-color: var(--bg);
  border: 1.5px solid var(--border-strong);
  cursor: pointer;
  display: inline-grid;
  place-content: center;
  vertical-align: middle;
  flex-shrink: 0;
  transition: all 0.14s ease;
}

input[type="checkbox"]:not(.lf-switch-input):hover {
  border-color: var(--primary);
}

input[type="checkbox"]:not(.lf-switch-input):checked {
  background-color: var(--primary);
  border-color: var(--primary);
  background-image: var(--chk-tick);
  background-size: 12px 12px;
  background-position: center;
  background-repeat: no-repeat;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 13px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover:not(:disabled) {
  background: var(--bg-muted);
  border-color: var(--border-strong);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--btn-primary-bg);
  border-color: transparent;
  color: var(--btn-primary-fg);
  font-weight: 600;
  box-shadow: var(--btn-primary-shadow);
}

.btn-primary:hover:not(:disabled) {
  background: var(--btn-primary-hover);
  border-color: transparent;
  color: var(--btn-primary-fg);
}

.btn-danger {
  background: var(--rose-soft);
  border-color: transparent;
  color: var(--rose);
}

.btn-danger:hover:not(:disabled) {
  background: var(--rose);
  color: #fff;
}

.btn-sm {
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 7px;
}

.view-seg {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 8px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  gap: 2px;
}

.view-seg-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.view-seg-btn.active {
  background: var(--bg-elevated);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

/* ==========================================================================
   Clean Single-Line Enterprise Data Tables
   ========================================================================== */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

table.data-table th {
  padding: 10px 8px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--text-subtle);
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.data-table td {
  padding: 11px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}

table.data-table th:first-child,
table.data-table td:first-child {
  padding-left: 14px;
}

table.data-table th:last-child,
table.data-table td:last-child {
  padding-right: 14px;
}

table.data-table tr:last-child td {
  border-bottom: none;
}

table.data-table tr:hover td {
  background: var(--bg-hover);
}

.cell-ellipsis {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.cvr-inline-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  white-space: nowrap;
}

.cvr-bar-track {
  width: 56px;
  height: 5px;
  border-radius: 999px;
  background: var(--bg-muted);
  overflow: hidden;
  flex-shrink: 0;
}

.cvr-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success {
  background: var(--emerald-soft);
  color: var(--emerald);
}

.badge-warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge-danger {
  background: var(--rose-soft);
  color: var(--rose);
}

.badge-neutral {
  background: var(--bg-muted);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.badge-custom {
  background: var(--primary-soft);
  color: var(--primary);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

@keyframes pulseLiveDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(1.25); }
}

.live-dot {
  animation: pulseLiveDot 2.2s infinite ease-in-out;
}

/* ==========================================================================
   Smooth Enterprise Pill Switch (Wraps Native <input type="checkbox">)
   ========================================================================== */
.shield-rule-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 15px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 11px;
  cursor: pointer;
  transition: border-color 0.16s ease;
}

.shield-rule-card:hover {
  border-color: var(--border-strong);
}

.lf-switch-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.lf-switch-ui {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  display: inline-block;
}

.lf-switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.32);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.lf-switch-input:checked + .lf-switch-ui {
  background: var(--primary);
  border-color: var(--primary);
}

.lf-switch-input:checked + .lf-switch-ui .lf-switch-knob {
  transform: translateX(18px);
  background: var(--btn-primary-fg);
}

html[data-skin="stripe"] .lf-switch-input:checked + .lf-switch-ui .lf-switch-knob {
  background: #ffffff;
}

/* ==========================================================================
   Visual Creative Studio Template Gallery (4-Column Responsive Cards)
   ========================================================================== */
.tpl-studio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 16px;
}

.tpl-studio-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 13px;
  box-shadow: var(--card-highlight);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.tpl-studio-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.tpl-studio-card.is-custom {
  border-color: rgba(245, 158, 11, 0.35);
}

.tpl-studio-cover {
  height: 156px;
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
  position: relative;
  overflow: hidden;
}

.tpl-studio-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.tpl-studio-card:hover .tpl-studio-cover img {
  transform: scale(1.03);
}

.tpl-cover-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  pointer-events: none;
}

.tpl-glass-tag {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(10, 12, 18, 0.72);
  color: #f8fafc;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.tpl-studio-body {
  padding: 13px 15px 11px;
}

.tpl-studio-title {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tpl-studio-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 35px;
}

.tpl-studio-foot {
  padding: 10px 15px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

/* ==========================================================================
   Slide-over Drawer with Modern Underline Tabs, Dropdowns, Bulk Bar, Login
   ========================================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 15, 0.56);
  backdrop-filter: blur(3px);
  z-index: 60;
  display: flex;
  justify-content: flex-end;
}

.drawer {
  width: min(840px, 94vw);
  max-width: 94vw;
  height: 100vh;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  box-shadow: -18px 0 48px rgba(0, 0, 0, 0.4);
}

.drawer-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-tabs {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.drawer-tab-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 12px 2px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.14s, border-color 0.14s;
  white-space: nowrap;
}

.drawer-tab-btn:hover {
  color: var(--text);
}

.drawer-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 24px;
}

.action-dropdown {
  position: relative;
  display: inline-block;
}

.action-dropdown > summary {
  list-style: none;
}

.action-dropdown > summary::-webkit-details-marker {
  display: none;
}

.action-dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 210px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  padding: 6px;
  box-shadow: var(--shadow);
  z-index: 55;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.action-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7.5px 10px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  border-radius: 7px;
  cursor: pointer;
}

.action-dropdown-item:hover {
  background: var(--bg-muted);
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
  display: block;
}

.field-hint {
  font-size: 11.5px;
  color: var(--text-subtle);
  margin-top: 4px;
}

.bulk-bar {
  position: fixed;
  bottom: 22px;
  left: calc(124px + 50%);
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--primary);
  border-radius: 12px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
  z-index: 50;
}

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

.funnel-step {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  position: relative;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.toast-container {
  position: fixed;
  top: 16px;
  right: 22px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-elevated);
  border-left: 3px solid var(--primary);
  border-top: 1px solid var(--border-strong);
  border-right: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
  padding: 10px 15px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-size: 12.5px;
  font-weight: 500;
}

.login-screen,
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 0%, var(--primary-soft), transparent 52%), var(--sh-outer);
}

.login-box {
  width: 432px;
  max-width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow);
}

/* ==========================================================================
   V5 Flagship: Split-Screen Executive Login Portal
   ========================================================================== */
.login-portal {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  background: var(--bg);
}

.login-hero-pane {
  position: relative;
  overflow: hidden;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at 16% 18%, rgba(245, 158, 11, 0.2), transparent 46%),
    radial-gradient(circle at 88% 84%, rgba(16, 185, 129, 0.16), transparent 48%),
    linear-gradient(155deg, #07090e 0%, #0d121c 55%, #090d14 100%);
  color: #f8fafc;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.login-hero-pane::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse at 40% 45%, #000 35%, transparent 82%);
  -webkit-mask-image: radial-gradient(ellipse at 40% 45%, #000 35%, transparent 82%);
  pointer-events: none;
}

.login-hero-content {
  position: relative;
  z-index: 2;
  max-width: 540px;
}

.login-feature-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 28px;
}

.login-feature-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 15px 18px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.085);
  backdrop-filter: blur(8px);
}

.login-feature-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.26);
}

.login-feature-icon svg {
  width: 18px;
  height: 18px;
}

.login-form-pane {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px 44px;
  background: radial-gradient(circle at 50% 0%, var(--primary-soft), transparent 48%), var(--bg);
}

.login-form-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.login-auth-card {
  width: 416px;
  max-width: 100%;
  margin: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 34px 32px;
  box-shadow: var(--shadow);
}

/* ==========================================================================
   V5 Flagship: Interactive 24h Chart Crosshair & Floating Tooltip
   ========================================================================== */
.chart-stage {
  width: 100%;
  height: 126px;
  position: relative;
  cursor: crosshair;
  user-select: none;
}

.chart-hover-tooltip {
  position: absolute;
  top: 4px;
  pointer-events: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 8px 11px;
  box-shadow: var(--shadow);
  font-size: 11.5px;
  z-index: 12;
  min-width: 148px;
  backdrop-filter: blur(10px);
  transition: opacity 0.12s ease;
}

/* ==========================================================================
   V5 Flagship: iPhone Dynamic-Island Frame + QR Side Dock
   ========================================================================== */
.iphone-bezel {
  width: 368px;
  max-width: 100%;
  height: 100%;
  max-height: 760px;
  background: #0b0d12;
  border-radius: 44px;
  padding: 11px;
  box-shadow:
    0 0 0 2px #2b313d,
    0 0 0 4px #14171f,
    0 24px 60px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  position: relative;
  flex-shrink: 0;
}

.iphone-screen {
  flex: 1;
  min-height: 0;
  background: #ffffff;
  border-radius: 34px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.iphone-statusbar {
  height: 34px;
  padding: 0 20px;
  background: #090b10;
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 600;
  position: relative;
  flex-shrink: 0;
}

.iphone-island {
  width: 92px;
  height: 20px;
  border-radius: 999px;
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: absolute;
  left: 50%;
  top: 7px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
}

.iphone-island::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #3b82f6, #0f172a 70%);
}

.iphone-home-bar {
  height: 18px;
  background: #090b10;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.iphone-home-bar::after {
  content: "";
  width: 110px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
}

.preview-qr-dock {
  width: 236px;
  flex-shrink: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  align-self: center;
  box-shadow: var(--card-highlight);
}

.preview-qr-box {
  padding: 10px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  display: inline-flex;
}

/* ==========================================================================
   V5 Flagship: Global Command Palette (Ctrl+K / ⌘K)
   ========================================================================== */
.cmd-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 12, 0.62);
  backdrop-filter: blur(5px);
  z-index: 95;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 11vh;
}

.cmd-dialog {
  width: 600px;
  max-width: 94vw;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 15px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cmd-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}

.cmd-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.cmd-list {
  max-height: 390px;
  overflow-y: auto;
  padding: 8px;
}

.cmd-group-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-subtle);
  padding: 7px 10px 4px;
  letter-spacing: 0.4px;
}

.cmd-item {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 8.5px 11px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.1s ease;
}

.cmd-item:hover,
.cmd-item.active {
  background: var(--primary-soft);
}

.cmd-footer {
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-subtle);
}

/* ==========================================================================
   V5 Flagship: Dual Quota Progress Bars & Brand Vector Badges
   ========================================================================== */
.quota-cell-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 175px;
}

.quota-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.quota-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

.quota-track {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: var(--bg-muted);
  overflow: hidden;
}

.quota-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
}

.brand-svg-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.brand-svg-badge svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* ==========================================================================
   Sub-Account Validity & Expiry Reminder Strip (Sidebar Footer)
   ========================================================================== */
.account-expiry-strip {
  margin-top: 7px;
  padding: 7px 10px;
  border-radius: 9px;
  background: var(--sh-sidebar-card);
  border: 1px solid var(--sh-sidebar-border);
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  color: var(--sh-sidebar-muted);
}

.account-expiry-strip.is-warn {
  border-color: rgba(245, 158, 11, 0.38);
  background: rgba(245, 158, 11, 0.08);
}

.account-expiry-strip.is-urgent {
  border-color: rgba(244, 63, 94, 0.45);
  background: rgba(244, 63, 94, 0.1);
}

.account-expiry-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.account-expiry-pill {
  display: inline-flex;
  align-items: center;
  padding: 1.5px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.account-expiry-pill.tone-emerald {
  background: var(--emerald-soft);
  color: var(--emerald);
}

.account-expiry-pill.tone-amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.account-expiry-pill.tone-rose {
  background: var(--rose-soft);
  color: var(--rose);
}

.account-expiry-note {
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--amber);
}

.account-expiry-strip.is-urgent .account-expiry-note {
  color: var(--rose);
}

/* ==========================================================================
   Sub-Account 360 Dossier & Team KPI Overview
   ========================================================================== */
.user-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.user-kpi-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.user-kpi-label {
  font-size: 11.5px;
  color: var(--text-subtle);
  font-weight: 500;
}

.user-kpi-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

.user-kpi-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.user-row-clickable {
  cursor: pointer;
  transition: background 0.14s ease;
}

.user-row-clickable:hover td {
  background: var(--bg-muted);
}

.user-dossier-modal {
  width: 920px;
  max-width: 95vw;
  max-height: 92vh;
  overflow-y: auto;
  padding: 0;
  margin: 0;
}

.user-dossier-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-muted);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.user-dossier-avatar {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  font-weight: 700;
  font-size: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-dossier-body {
  padding: 18px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.user-dossier-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.user-dossier-box-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-subtle);
}

.user-dossier-section {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
}

.user-dossier-section-head {
  padding: 10px 14px;
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
}

@media (max-width: 1100px) {
  .user-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .user-dossier-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .user-kpi-grid,
  .user-dossier-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1200px) {
  .bento-top-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .login-portal {
    grid-template-columns: 1fr;
  }
  .login-hero-pane {
    padding: 32px 24px;
  }
  .preview-qr-dock {
    display: none;
  }
  .sidebar {
    position: static;
    width: 100%;
    padding: 8px;
  }
  .layout {
    flex-direction: column;
  }
  .workspace-shell {
    margin: 0 8px 8px;
  }
  .bulk-bar {
    left: 50%;
  }
}

/* ==========================================================================
   Visual Template Picker & Split-Screen Studio (Sub-Account & Site Builder)
   ========================================================================== */
.studio-modal {
  width: 1260px;
  max-width: 96vw;
  height: 90vh;
  max-height: 890px;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.studio-head {
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.studio-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 368px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.studio-left {
  overflow-y: auto;
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.studio-right {
  border-left: 1px solid var(--border);
  background: var(--bg-muted);
  padding: 10px 14px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}

.studio-foot {
  padding: 11px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.studio-section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.studio-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  flex-wrap: wrap;
}

.studio-preset-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px dashed var(--border-strong);
}

.studio-preset-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.14s ease;
}

.studio-preset-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.studio-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  gap: 9px;
}

.studio-mode-card {
  border: 1.5px solid var(--border);
  background: var(--bg-elevated);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.studio-mode-card:hover {
  border-color: var(--border-strong);
}

.studio-mode-card.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.studio-mode-card-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.studio-mode-card-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.tpl-picker-toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.tpl-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  gap: 10px;
  max-height: 412px;
  overflow-y: auto;
  padding: 3px;
}

.tpl-pick-card {
  border: 1.5px solid var(--border);
  border-radius: 11px;
  background: var(--bg-elevated);
  cursor: pointer;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  min-width: 0;
  min-height: 192px;
  flex-shrink: 0;
}

.tpl-pick-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.tpl-pick-card.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-soft);
}

.tpl-pick-card.is-selected .tpl-pick-meta {
  background: var(--primary-soft);
}

.tpl-pick-card.is-previewing {
  outline: 2px solid var(--emerald);
  outline-offset: -2px;
}

.tpl-pick-thumb-wrap {
  position: relative;
  width: 100%;
  height: 102px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-bottom: 1px solid var(--border);
  border-radius: 9.5px 9.5px 0 0;
  overflow: hidden;
}

.tpl-pick-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tpl-pick-check {
  position: absolute;
  top: 6px;
  left: 6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  background: rgba(9, 9, 11, 0.74);
  border: 1.5px solid rgba(255, 255, 255, 0.58);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  backdrop-filter: blur(4px);
}

.tpl-pick-card.is-selected .tpl-pick-check {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--btn-primary-fg);
}

.tpl-pick-eye {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(9, 9, 11, 0.8);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.tpl-pick-card.is-previewing .tpl-pick-eye {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #052e16;
}

.tpl-pick-eye:hover {
  background: var(--primary);
  color: var(--btn-primary-fg);
}

.tpl-pick-meta {
  padding: 8px 10px 9px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 5px;
  min-width: 0;
  flex: 1;
  flex-shrink: 0;
  border-radius: 0 0 9.5px 9.5px;
}

.tpl-pick-name {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.36;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  word-break: break-word;
  min-height: 34px;
}

.tpl-pick-id {
  font-size: 10.5px;
  color: var(--text-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tpl-pick-tags {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.tpl-pick-more-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 6px 4px;
}

.family-pick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  gap: 9px;
}

.family-pick-card {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  padding: 10px 11px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 98px;
  flex-shrink: 0;
  transition: all 0.14s ease;
}

.family-pick-card.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-soft);
}

.family-thumb-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  height: 48px;
  flex-shrink: 0;
}

.family-thumb-strip img {
  width: 100%;
  height: 48px;
  object-fit: cover;
  border-radius: 5px;
  background: #0f172a;
  border: 1px solid var(--border);
  display: block;
}

.popup-pick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  gap: 8px;
}

.popup-pick-card {
  border: 1.5px solid var(--border);
  border-radius: 9px;
  background: var(--bg-elevated);
  padding: 9px 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 56px;
  flex-shrink: 0;
  transition: all 0.14s ease;
}

.popup-pick-card.is-selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.studio-phone-head {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 11px;
  flex-shrink: 0;
}

.studio-phone-shell {
  width: 318.2px;
  border-radius: 34px;
  border: 7px solid #18181b;
  background: #090b10;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 16px 36px rgba(0, 0, 0, 0.32);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

.studio-phone-shell.is-compact {
  width: 290.9px;
  border-radius: 32px;
}

.studio-phone-statusbar {
  height: 26px;
  padding: 0 14px;
  background: #090b10;
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 600;
  position: relative;
  flex-shrink: 0;
}

.studio-phone-island {
  width: 72px;
  height: 15px;
  border-radius: 999px;
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.09);
  position: absolute;
  left: 50%;
  top: 5px;
  transform: translateX(-50%);
  flex-shrink: 0;
}

.studio-phone-viewport {
  width: 304.2px;
  height: 592.8px;
  overflow: hidden;
  position: relative;
  background: #ffffff;
  flex-shrink: 0;
}

.studio-phone-shell.is-compact .studio-phone-viewport {
  width: 276.9px;
  height: 518.3px;
}

.studio-phone-iframe {
  width: 390px;
  height: 760px;
  border: none;
  background: #ffffff;
  transform: scale(0.78);
  transform-origin: 0 0;
  display: block;
}

.studio-phone-shell.is-compact .studio-phone-iframe {
  width: 390px;
  height: 730px;
  transform: scale(0.71);
  transform-origin: 0 0;
}

.studio-phone-homebar {
  height: 14px;
  background: #090b10;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.studio-phone-homebar::after {
  content: "";
  width: 92px;
  height: 3.5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
}

.studio-summary-box {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11.5px;
  flex-shrink: 0;
}

.overlay-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1350;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

@media (max-width: 1080px) {
  .studio-modal {
    height: 93vh;
    max-height: none;
  }
  .studio-split {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .studio-left,
  .studio-right {
    overflow-y: visible;
  }
  .studio-right {
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .tpl-picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .studio-mode-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   v1.9.0 Commercial Plan Tiers & PLG Golden VIP Upsell Teaser Engine
   ========================================================================== */
.vip-lock-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1.5px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(217, 119, 6, 0.14));
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 1px 4px rgba(245, 158, 11, 0.12);
}

html:not(.dark) .vip-lock-pill {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  border-color: rgba(217, 119, 6, 0.45);
}

.vip-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
}

.vip-tier-badge.tier-standard_88 {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
}

.vip-tier-badge.tier-localized_158 {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.36);
}

.vip-tier-badge.tier-flagship_299 {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.24), rgba(234, 88, 12, 0.16));
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.48);
}

.vip-tier-badge.tier-enterprise_499 {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.22), rgba(59, 130, 246, 0.18));
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.45);
}

.vip-tier-badge.tier-custom {
  background: var(--bg-muted);
  color: var(--text);
  border-color: var(--border-strong);
}

html:not(.dark) .vip-tier-badge.tier-standard_88 {
  background: #e0f2fe;
  color: #0369a1;
}
html:not(.dark) .vip-tier-badge.tier-localized_158 {
  background: #d1fae5;
  color: #047857;
}
html:not(.dark) .vip-tier-badge.tier-flagship_299 {
  background: #fef3c7;
  color: #b45309;
}
html:not(.dark) .vip-tier-badge.tier-enterprise_499 {
  background: #f3e8ff;
  color: #7e22ce;
}

.vip-upgrade-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(251, 191, 36, 0.55);
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0f172a;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.28);
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
  white-space: nowrap;
}

.vip-upgrade-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.38);
}

.tpl-lock-ribbon {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  padding: 2.5px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.88));
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.55);
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.tpl-studio-card.is-locked-teaser,
.tpl-pick-card.is-locked-teaser {
  border-color: rgba(245, 158, 11, 0.28);
}

.tpl-studio-card.is-locked-teaser:hover,
.tpl-pick-card.is-locked-teaser:hover {
  border-color: rgba(245, 158, 11, 0.62);
}

.vip-teaser-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 18px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14) 0%, rgba(15, 23, 42, 0.65) 100%);
  border: 1px solid rgba(245, 158, 11, 0.42);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.08);
}

html:not(.dark) .vip-teaser-banner {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: rgba(217, 119, 6, 0.38);
}

.vip-upgrade-modal {
  width: min(1080px, 96vw);
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  margin: 0;
  border: 1px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 24px 68px rgba(0, 0, 0, 0.58);
}

.vip-hero-spotlight {
  padding: 13px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16) 0%, rgba(234, 88, 12, 0.07) 55%, transparent 100%);
  border: 1px solid rgba(245, 158, 11, 0.36);
  margin-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.vip-matrix-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
  margin-bottom: 0;
  padding-top: 6px;
}

.vip-plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 15px 14px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  gap: 12px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.vip-plan-card.is-recommended {
  border: 1.5px solid #f59e0b;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.11) 0%, var(--bg) 52%);
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.15);
}

.vip-plan-card.is-spotlight {
  outline: 2px solid rgba(251, 191, 36, 0.65);
  outline-offset: 1px;
}

.vip-plan-ribbon {
  position: absolute;
  top: -10px;
  right: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

.vip-feat-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11.8px;
  line-height: 1.45;
}

.vip-feat-list li {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.vip-feat-list li.is-locked {
  color: var(--text-subtle);
  opacity: 0.72;
}

.us-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 8px;
}

.us-plan-card {
  text-align: left;
  padding: 10px 11px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text);
  transition: border-color 0.14s ease, background 0.14s ease;
}

.us-plan-card:hover {
  border-color: var(--primary);
}

.us-plan-card.is-active {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.11);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.35);
}

.us-feat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}

.us-feat-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 12px;
  cursor: pointer;
}

@media (max-width: 960px) {
  .vip-matrix-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .us-plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .us-feat-grid {
    grid-template-columns: 1fr;
  }
}
