/* ==========================================================================
   DIGI Finance — Click Dummy
   Design tokens extracted 1:1 from PrimeReact "lara-dark-purple" theme
   (the theme used by digifinance-frontend). Pure CSS, no build step.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Accent / primary (lara purple) */
  --primary: #a78bfa;
  --primary-50: #fbf9ff;
  --primary-100: #eae3fe;
  --primary-200: #d9cdfd;
  --primary-300: #c8b7fc;
  --primary-400: #b8a1fb;
  --primary-500: #a78bfa;
  --primary-text: #ffffff;

  /* Surfaces (gray scale, dark) */
  --surface-ground: #111827; /* page background */
  --surface-section: #111827;
  --surface-card: #1f2937; /* cards / overlays */
  --surface-overlay: #1f2937;
  --surface-0: #111827;
  --surface-50: #1f2937;
  --surface-100: #374151;
  --surface-200: #4b5563;
  --surface-300: #6b7280;
  --surface-400: #9ca3af;
  --surface-500: #d1d5db;
  --surface-border: rgba(255, 255, 255, 0.10);
  --surface-hover: rgba(255, 255, 255, 0.04);

  /* Text */
  --text-color: rgba(255, 255, 255, 0.87);
  --text-color-secondary: rgba(255, 255, 255, 0.60);
  --text-muted: rgba(255, 255, 255, 0.38);

  /* Highlights */
  --highlight-bg: rgba(167, 139, 250, 0.16);

  /* Status */
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.14);
  --red: #ff3d32;
  --red-soft: rgba(255, 61, 50, 0.14);
  --yellow: #eab308;
  --blue: #3b82f6;
  --orange: #f97316;
  --cyan: #06b6d4;
  --pink: #ec4899;

  /* Geometry */
  --sidebar-w: 320px;
  --topbar-h: 72px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

html, body { height: 100%; }

body {
  font-family: var(--font);
  background-color: var(--surface-ground);
  color: var(--text-color);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { display: block; max-width: 100%; }
canvas { display: block; }
::selection { background: var(--highlight-bg); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-100); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--surface-200); }
::-webkit-scrollbar-track { background: transparent; }

/* ==========================================================================
   APP SHELL
   ========================================================================== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface-card);
  border-right: 1px solid var(--surface-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  height: 100vh;
  z-index: 40;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 22px 22px 14px;
  display: flex;
  align-items: center;
}
.sidebar-logo img { width: 76%; height: auto; }

.sidebar-nav { flex: 1; padding: 8px 14px 14px; }

.nav-section { margin-top: 18px; }
.nav-section:first-child { margin-top: 6px; }
.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-color-secondary);
  font-weight: 500;
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.nav-item:hover { background: var(--surface-hover); color: var(--text-color); }
.nav-item.active { background: var(--highlight-bg); color: #fff; }
.nav-item.active .nav-ico { color: var(--primary); }
.nav-item .nav-ico { width: 20px; height: 20px; flex-shrink: 0; color: var(--surface-400); }
.nav-item.active .nav-ico { color: var(--primary); }
.nav-label { flex: 1; font-size: 14px; }

.nav-badge {
  min-width: 20px; height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

.sidebar-footer {
  border-top: 1px solid var(--surface-border);
  padding: 12px 14px;
}

/* Sidebar "Finanzübersicht" widget (mirrors FinancialOverview) */
.fin-overview { margin: 4px 14px 8px; border: 1px solid var(--surface-border); border-radius: var(--radius); background: var(--surface-50); }
.fin-overview-head { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 14px 16px; font-weight: 700; color: var(--text-color); }
.fin-overview-head:hover { color: #fff; }
.fin-overview-head svg { width: 18px; height: 18px; color: var(--text-color-secondary); }
.fin-overview-body { padding: 0 16px 14px; }
.fin-row { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; font-size: 13.5px; }
.fin-row .fin-label { color: var(--text-color-secondary); }
.fin-row .fin-val { font-weight: 600; }
.fin-row.total { padding-top: 10px; }
.fin-row.total .fin-label { color: var(--text-color); font-weight: 700; }
.fin-row.total .fin-val { font-weight: 800; }
.fin-divider { height: 1px; background: var(--surface-border); margin: 8px 0 2px; }

/* Sidebar profile row in footer */
.profile-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.profile-row .pr-main { min-width: 0; }
.profile-row .pr-name { font-weight: 600; font-size: 14px; }
.profile-row .pr-mail { font-size: 12px; color: var(--text-color-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* "Vermögen hinzufügen" selection cards (mirror CreateAssetCard) */
.create-list { display: flex; flex-direction: column; gap: 16px; }
.create-card { display: flex; align-items: center; gap: 22px; padding: 22px; text-align: left; width: 100%; background: var(--surface-50); border: 1px solid var(--surface-border); border-radius: var(--radius); transition: background 0.15s, border-color 0.15s; }
.create-card:hover { background: var(--surface-100); border-color: var(--primary); }
.create-card .cc-img { width: 104px; height: 104px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.create-card .cc-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.create-card .cc-body { flex: 1; min-width: 0; }
.create-card .cc-cat { text-transform: uppercase; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: var(--text-color-secondary); }
.create-card .cc-title { font-size: 19px; font-weight: 700; margin: 4px 0 8px; }
.create-card .cc-desc { color: var(--text-color-secondary); font-size: 13.5px; line-height: 1.55; }
.create-card .cc-arrow { color: var(--text-color-secondary); flex-shrink: 0; }
@media (max-width: 640px) {
  .create-card { flex-direction: column; align-items: flex-start; text-align: center; }
  .create-card .cc-img { margin: 0 auto; }
  .create-card .cc-arrow { display: none; }
}

/* Main area */
.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--topbar-h);
  position: sticky; top: 0; z-index: 30;
  background: rgba(17, 24, 39, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--surface-border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px;
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.menu-toggle { display: none; width: 40px; height: 40px; border-radius: var(--radius-sm); align-items: center; justify-content: center; color: var(--text-color-secondary); }
.menu-toggle:hover { background: var(--surface-hover); }

.breadcrumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-color-secondary); flex-wrap: wrap; }
.breadcrumbs .crumb-sep { color: var(--text-muted); }
.breadcrumbs .crumb-current { color: var(--text-color); font-weight: 600; }

.page { padding: 28px 36px; max-width: 100%; width: 100%; }
.page-wide { max-width: 100%; }

.page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.page-subtitle { color: var(--text-color-secondary); margin-top: 4px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 14px; line-height: 1;
  transition: filter 0.15s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); color: #1f1147; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-secondary:hover { background: var(--highlight-bg); }
.btn-text { background: transparent; color: var(--text-color-secondary); padding: 9px 12px; }
.btn-text:hover { background: var(--surface-hover); color: var(--text-color); }
.btn-danger { background: transparent; color: var(--red); border: 1px solid rgba(255,61,50,0.4); }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-block { width: 100%; }

.icon-btn {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-color-secondary); position: relative;
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text-color); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .dot-badge { position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); border: 2px solid var(--surface-card); }

/* ==========================================================================
   CARDS / WIDGETS
   ========================================================================== */
.card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-pad-lg { padding: 24px; }

.widget { background: var(--surface-card); border: 1px solid var(--surface-border); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; }
.widget-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.widget-title { font-size: 15px; font-weight: 600; color: var(--text-color); }
.widget-link { font-size: 13px; font-weight: 600; color: var(--primary); display: inline-flex; align-items: center; gap: 4px; }
.widget-link:hover { text-decoration: underline; }
.widget-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--highlight-bg); display: inline-flex; align-items: center; justify-content: center; color: var(--primary); }
.widget-icon svg { width: 20px; height: 20px; }

/* KPI */
.kpi-label { font-size: 13px; color: var(--text-color-secondary); font-weight: 500; }
.kpi-value { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin-top: 6px; }
.kpi-value.lg { font-size: 34px; }
.kpi-sub { font-size: 13px; color: var(--text-color-secondary); margin-top: 6px; }
.trend { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.trend svg { width: 14px; height: 14px; }
.trend.up { color: var(--green); background: var(--green-soft); }
.trend.down { color: var(--red); background: var(--red-soft); }

/* ==========================================================================
   GRID HELPERS
   ========================================================================== */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }
/* Asymmetric two-column splits (e.g. chart + list) that collapse on small screens */
.grid-split { display: grid; gap: 20px; grid-template-columns: 1fr 1.6fr; }
.grid-split-rev { display: grid; gap: 20px; grid-template-columns: 1.6fr 1fr; }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } .col-span-3 { grid-column: span 2; } }
@media (max-width: 980px) { .grid-split, .grid-split-rev { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .col-span-2, .col-span-3 { grid-column: span 1; } }

/* ==========================================================================
   AVATAR
   ========================================================================== */
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-100); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; overflow: hidden; flex-shrink: 0; }
.avatar.sm { width: 34px; height: 34px; font-size: 13px; }
.avatar.lg { width: 60px; height: 60px; font-size: 20px; }
.avatar.purple { background: linear-gradient(135deg, var(--primary), var(--blue)); }

/* ==========================================================================
   ACCORDION
   ========================================================================== */
.accordion { display: flex; flex-direction: column; gap: 12px; }
.accordion-item { background: var(--surface-card); border: 1px solid var(--surface-border); border-radius: var(--radius); overflow: hidden; }
.accordion-header { display: flex; align-items: center; gap: 14px; padding: 16px 20px; cursor: pointer; user-select: none; transition: background 0.15s; }
.accordion-header:hover { background: var(--surface-hover); }
.accordion-cat-icon { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--highlight-bg); color: var(--primary); flex-shrink: 0; }
.accordion-cat-icon svg { width: 20px; height: 20px; }
.accordion-title { font-weight: 600; font-size: 15px; }
.accordion-meta { color: var(--text-color-secondary); font-size: 13px; margin-top: 2px; }
.accordion-value { margin-left: auto; text-align: right; }
.accordion-value .amount { font-weight: 700; font-size: 16px; }
.accordion-chevron { color: var(--text-color-secondary); transition: transform 0.2s; }
.accordion-item.open .accordion-chevron { transform: rotate(180deg); }
.accordion-body { display: none; padding: 0 20px 8px; }
.accordion-item.open .accordion-body { display: block; }

/* List rows (assets / transactions) */
.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--surface-border); }
.list-row:first-child { border-top: none; }
.list-row .row-icon { width: 38px; height: 38px; border-radius: 9px; background: var(--surface-100); display: inline-flex; align-items: center; justify-content: center; color: var(--text-color); flex-shrink: 0; }
.list-row .row-icon svg { width: 19px; height: 19px; }
.list-row .row-main { flex: 1; min-width: 0; }
.list-row .row-title { font-weight: 600; font-size: 14px; }
.list-row .row-sub { color: var(--text-color-secondary); font-size: 12.5px; margin-top: 2px; }
.list-row .row-amount { font-weight: 700; text-align: right; white-space: nowrap; }
.row-actions { display: flex; gap: 4px; }

/* ==========================================================================
   TABLE (PrimeReact DataTable look)
   ========================================================================== */
.table-wrap { background: var(--surface-card); border: 1px solid var(--surface-border); border-radius: var(--radius); overflow: hidden; }
table.data { width: 100%; border-collapse: collapse; }
table.data thead th {
  text-align: left; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--text-color-secondary);
  padding: 14px 18px; background: var(--surface-50); border-bottom: 1px solid var(--surface-border);
}
table.data tbody td { padding: 14px 18px; border-bottom: 1px solid var(--surface-border); font-size: 14px; vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background 0.12s; }
table.data tbody tr:hover { background: var(--surface-hover); }
.th-sort::after { content: '⇅'; margin-left: 6px; color: var(--text-muted); font-size: 11px; }

/* ==========================================================================
   BADGES / CHIPS / TAGS
   ========================================================================== */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-100); color: var(--text-color); }
.chip.purple { background: var(--highlight-bg); color: var(--primary); }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.blue { background: rgba(59,130,246,0.16); color: #93c5fd; }
.chip.yellow { background: rgba(234,179,8,0.16); color: var(--yellow); }
.chip-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ==========================================================================
   PROGRESS
   ========================================================================== */
.progress { height: 8px; border-radius: 999px; background: var(--surface-100); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.progress.green > span { background: var(--green); }

/* ==========================================================================
   FORMS
   ========================================================================== */
.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-color-secondary); margin-bottom: 7px; }
.input, .select, textarea.input {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--surface-50); border: 1px solid var(--surface-border); color: var(--text-color);
  font-family: inherit; font-size: 14px; transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--highlight-bg); }
.input::placeholder { color: var(--text-muted); }
.input-group { position: relative; }
.input-group .input-ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.input-group .input { padding-left: 40px; }

/* ==========================================================================
   MODAL
   ========================================================================== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(2px); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface-card); border: 1px solid var(--surface-border); border-radius: var(--radius-lg); width: 100%; max-width: 520px; box-shadow: var(--shadow); animation: pop 0.16s ease; max-height: 90vh; overflow-y: auto; }
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--surface-border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 17px; font-weight: 700; }
.modal-body { padding: 24px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--surface-border); display: flex; justify-content: flex-end; gap: 10px; }
@keyframes pop { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ==========================================================================
   TABS
   ========================================================================== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--surface-border); margin-bottom: 22px; }
.tab { padding: 12px 16px; font-weight: 600; color: var(--text-color-secondary); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text-color); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */
.empty { text-align: center; padding: 48px 20px; color: var(--text-color-secondary); }
.empty .empty-ico { width: 56px; height: 56px; border-radius: 14px; background: var(--surface-50); display: inline-flex; align-items: center; justify-content: center; color: var(--surface-300); margin-bottom: 16px; }
.empty .empty-ico svg { width: 28px; height: 28px; }

/* ==========================================================================
   CHART
   ========================================================================== */
.chart-box { position: relative; display: flex; align-items: center; justify-content: center; }
.doughnut-center { position: absolute; text-align: center; }
.doughnut-center .dc-value { font-size: 20px; font-weight: 800; }
.doughnut-center .dc-label { font-size: 12px; color: var(--text-color-secondary); }
.legend { display: flex; flex-direction: column; gap: 10px; }
.legend-item { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.legend-item .sw { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.legend-item .lg-name { color: var(--text-color-secondary); }
.legend-item .lg-val { margin-left: auto; font-weight: 600; }

/* Allocation widget — vertical fill with per-category bars */
.alloc-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.al-row + .al-row { margin-top: 16px; }
.al-top { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.al-top .sw { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.al-top .al-name { color: var(--text-color-secondary); }
.al-top .al-val { margin-left: auto; font-weight: 600; }
.al-top .al-pct { width: 52px; text-align: right; color: var(--text-color-secondary); }
.al-bar { height: 6px; border-radius: 999px; background: var(--surface-100); overflow: hidden; margin-top: 7px; }
.al-bar > span { display: block; height: 100%; border-radius: 999px; }

/* Uniform circular badge for crypto logos on the create page */
.create-card .cc-img .crypto-badge { width: 78px; height: 78px; border-radius: 50%; background: rgba(255,255,255,0.05); border: 1px solid var(--surface-border); display: flex; align-items: center; justify-content: center; }
.create-card .cc-img .crypto-badge img { width: 56px; height: 56px; object-fit: contain; }

/* Household breakdown columns — pin the "Summe" footer to the bottom so totals align */
.hh-col { display: flex; flex-direction: column; }
.hh-col .hh-list { flex: 1; }
.hh-col .hh-sum { margin-top: 16px; }

/* Horizontal bar overview (fills width cleanly) */
.hbars { display: flex; flex-direction: column; gap: 16px; }
.hbar-row { display: flex; align-items: center; gap: 16px; }
.hbar-row .hb-label { width: 142px; flex-shrink: 0; font-size: 13.5px; color: var(--text-color-secondary); }
.hbar-row .hb-track { flex: 1; height: 22px; border-radius: 6px; background: var(--surface-100); overflow: hidden; }
.hbar-row .hb-fill { display: block; height: 100%; border-radius: 6px; min-width: 4px; }
.hbar-row .hb-val { width: 120px; flex-shrink: 0; text-align: right; font-weight: 700; }
@media (max-width: 560px) { .hbar-row .hb-label { width: 96px; } .hbar-row .hb-val { width: 92px; } }

/* Real-estate detail */
.re-hero { width: 100%; height: 340px; object-fit: cover; border-radius: var(--radius); display: block; }
.map-placeholder { height: 220px; border-radius: var(--radius-sm); background:
  repeating-linear-gradient(45deg, var(--surface-50), var(--surface-50) 14px, var(--surface-100) 14px, var(--surface-100) 28px);
  border: 1px solid var(--surface-border); display: flex; align-items: center; justify-content: center; color: var(--text-color-secondary); gap: 8px; }
.detail-row { display: flex; justify-content: space-between; padding: 11px 0; border-top: 1px solid var(--surface-border); font-size: 14px; }
.detail-row:first-child { border-top: none; }
.detail-row .dr-label { color: var(--text-color-secondary); }
.detail-row .dr-val { font-weight: 600; }
/* dashed "add" tile */
.add-tile { border: 1.5px dashed var(--surface-200); border-radius: var(--radius); background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--text-color-secondary); min-height: 160px; transition: border-color .15s, color .15s; }
.add-tile:hover { border-color: var(--primary); color: var(--primary); }
.add-tile svg { width: 30px; height: 30px; }

/* ==========================================================================
   MISC UTILITIES
   ========================================================================== */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; } .mb-20 { margin-bottom: 20px; } .mb-24 { margin-bottom: 24px; }
.text-secondary { color: var(--text-color-secondary); }
.text-muted { color: var(--text-muted); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-primary { color: var(--primary); }
.fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; } .fw-800 { font-weight: 800; }
.fs-12 { font-size: 12px; } .fs-13 { font-size: 13px; } .fs-16 { font-size: 16px; } .fs-18 { font-size: 18px; } .fs-22 { font-size: 22px; } .fs-28 { font-size: 28px; }
.full { width: 100%; }
.divider { height: 1px; background: var(--surface-border); margin: 16px 0; }
.section-title { font-size: 16px; font-weight: 700; margin: 28px 0 14px; }
.lang-select { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text-color-secondary); font-weight: 600; font-size: 13px; }
.lang-select:hover { background: var(--surface-hover); }

/* ==========================================================================
   RESPONSIVE — sidebar collapses under 1024px
   ========================================================================== */
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 39; }
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.25s ease; }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
}
@media (max-width: 560px) {
  .page { padding: 18px; }
  .topbar { padding: 0 16px; }
  .hide-sm { display: none !important; }
}

/* Staggered widget fade-in (matches Motion on real dashboard) */
.fade-in { opacity: 0; transform: translateY(8px); animation: fadeUp 0.4s ease forwards; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

/* ==========================================================================
   DigiPilot — AI assistant (consultant portal, floating bottom-right)
   ========================================================================== */
.dp-root { position: fixed; right: 24px; bottom: 24px; z-index: 1200; }

/* Floating launcher button */
.dp-fab {
  width: 60px; height: 60px; border-radius: 50%; position: relative;
  background: linear-gradient(145deg, #b8a1fb 0%, #7c5cf0 100%);
  box-shadow: 0 10px 28px rgba(124, 92, 240, 0.45), 0 2px 8px rgba(0,0,0,0.3);
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.dp-fab:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 14px 34px rgba(124, 92, 240, 0.55); }
.dp-fab img { width: 40px; height: 40px; }
.dp-fab .dp-fab-close { display: none; color: #fff; }
.dp-fab .dp-pulse {
  position: absolute; inset: 0; border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(167, 139, 250, 0.55);
  animation: dpPulse 2.4s ease-out infinite;
}
@keyframes dpPulse { 70% { box-shadow: 0 0 0 16px rgba(167, 139, 250, 0); } 100% { box-shadow: 0 0 0 0 rgba(167, 139, 250, 0); } }

body.dp-open .dp-fab img,
body.dp-open .dp-fab .dp-pulse { display: none; }
body.dp-open .dp-fab .dp-fab-close { display: inline-flex; }

/* Panel */
.dp-panel {
  position: absolute; right: 0; bottom: 76px; width: 400px; max-width: calc(100vw - 32px);
  height: 600px; max-height: calc(100vh - 120px);
  background: var(--surface-card); border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  display: none; flex-direction: column; overflow: hidden;
  transform-origin: bottom right;
}
body.dp-open .dp-panel { display: flex; animation: dpPop 0.22s cubic-bezier(.2,.8,.3,1.1); }
@keyframes dpPop { from { opacity: 0; transform: translateY(12px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* Header */
.dp-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--surface-border); }
.dp-head .dp-ava { width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0; }
.dp-head .dp-title { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.dp-head .dp-title .dp-spark { color: var(--primary); display: inline-flex; }
.dp-head .dp-sub { font-size: 12px; color: var(--text-color-secondary); }
.dp-head .dp-head-main { flex: 1; min-width: 0; }

/* Client filter */
.dp-filter { position: relative; }
.dp-filter-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px;
  background: var(--surface-100); border: 1px solid var(--surface-border);
  border-radius: 999px; font-size: 12px; color: var(--text-color); max-width: 188px;
}
.dp-filter-btn:hover { background: var(--surface-200); }
.dp-filter-btn .dp-fb-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-filter-btn .avatar { width: 22px; height: 22px; font-size: 10px; }
.dp-filter-menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 256px; max-height: 320px; overflow-y: auto;
  background: var(--surface-overlay); border: 1px solid var(--surface-border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; display: none; z-index: 5;
}
.dp-filter-menu.open { display: block; }
.dp-filter-menu .dp-fm-search { padding: 4px 4px 8px; }
.dp-opt { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.dp-opt:hover { background: var(--surface-hover); }
.dp-opt.active { background: var(--highlight-bg); }
.dp-opt .avatar { width: 28px; height: 28px; font-size: 11px; }
.dp-opt .dp-opt-main { flex: 1; min-width: 0; }
.dp-opt .dp-opt-name { font-size: 13px; font-weight: 600; }
.dp-opt .dp-opt-sub { font-size: 11px; color: var(--text-color-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-opt .dp-opt-check { color: var(--primary); display: none; }
.dp-opt.active .dp-opt-check { display: inline-flex; }

/* Context bar (selected client) */
.dp-context { display: none; align-items: center; gap: 8px; padding: 8px 16px; font-size: 12px;
  background: var(--highlight-bg); color: var(--text-color-secondary); border-bottom: 1px solid var(--surface-border); }
.dp-context.show { display: flex; }
.dp-context strong { color: var(--text-color); font-weight: 600; }

/* Messages (mirrors existing chat bubbles) */
.dp-msgs { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; }
.dp-row { display: flex; gap: 8px; max-width: 90%; }
.dp-row.them { align-self: flex-start; }
.dp-row.me { align-self: flex-end; flex-direction: row-reverse; }
.dp-row .dp-msg-ava { width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0; margin-top: 2px; }
.dp-bubble { padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; }
.dp-row.them .dp-bubble { background: var(--surface-100); color: var(--text-color); border-bottom-left-radius: 4px; }
.dp-row.me .dp-bubble { background: var(--primary); color: #1f1147; border-bottom-right-radius: 4px; }

/* Suggestion chips */
.dp-suggests { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.dp-suggest {
  text-align: left; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 12.5px;
  background: var(--surface-hover); border: 1px solid var(--surface-border); color: var(--text-color);
  display: flex; align-items: center; gap: 8px;
}
.dp-suggest:hover { background: var(--highlight-bg); border-color: var(--primary); }
.dp-suggest .dp-sg-ico { color: var(--primary); display: inline-flex; flex-shrink: 0; }

/* Typing indicator */
.dp-typing { display: inline-flex; gap: 4px; align-items: center; padding: 12px 14px; }
.dp-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-color-secondary); animation: dpBlink 1.2s infinite ease-in-out; }
.dp-typing span:nth-child(2) { animation-delay: 0.2s; }
.dp-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dpBlink { 0%, 60%, 100% { opacity: 0.25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* Active tool chips */
.dp-tool-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px; }
.dp-tool-chips:empty { display: none; }
.dp-tool-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px 5px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; background: var(--highlight-bg); color: var(--primary);
  border: 1px solid rgba(167,139,250,0.35);
}
.dp-tool-chip button { display: inline-flex; color: inherit; opacity: 0.8; }
.dp-tool-chip button:hover { opacity: 1; }

/* Composer */
.dp-composer { padding: 10px 12px 12px; border-top: 1px solid var(--surface-border); }
.dp-inputbar {
  display: flex; align-items: flex-end; gap: 8px; background: var(--surface-100);
  border: 1px solid var(--surface-border); border-radius: 16px; padding: 6px 6px 6px 6px;
}
.dp-inputbar:focus-within { border-color: var(--primary); }
.dp-plus, .dp-send {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; transition: background 0.15s, transform 0.15s;
}
.dp-plus { color: var(--text-color-secondary); background: var(--surface-200); }
.dp-plus:hover { color: var(--text-color); background: var(--surface-300); }
.dp-plus.active { color: var(--primary); background: var(--highlight-bg); }
.dp-send { background: var(--primary); color: #1f1147; }
.dp-send:hover { transform: scale(1.06); }
.dp-textarea {
  flex: 1; resize: none; border: none; outline: none; background: transparent; color: var(--text-color);
  font-size: 14px; line-height: 1.4; padding: 8px 4px; max-height: 96px; min-height: 20px; font-family: inherit;
}
.dp-textarea::placeholder { color: var(--text-muted); }

/* Tools popover (the "+" menu) */
.dp-tools-pop {
  position: absolute; left: 12px; bottom: 60px; width: 268px;
  background: var(--surface-overlay); border: 1px solid var(--surface-border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; display: none; z-index: 6;
}
.dp-tools-pop.open { display: block; }
.dp-tools-pop .dp-tp-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); padding: 8px 10px 6px; }
.dp-tool-item { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--radius-sm); cursor: pointer; width: 100%; text-align: left; }
.dp-tool-item:hover { background: var(--surface-hover); }
.dp-tool-item .dp-ti-ico { width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--highlight-bg); color: var(--primary); }
.dp-tool-item .dp-ti-main { flex: 1; min-width: 0; }
.dp-tool-item .dp-ti-name { display: block; font-size: 13.5px; font-weight: 600; }
.dp-tool-item .dp-ti-desc { display: block; font-size: 11.5px; color: var(--text-color-secondary); }
.dp-tool-item .dp-ti-toggle { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--surface-300); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; color: transparent; }
.dp-tool-item.active .dp-ti-toggle { background: var(--primary); border-color: var(--primary); color: #1f1147; }

@media (max-width: 560px) {
  .dp-root { right: 16px; bottom: 16px; }
  .dp-panel { width: calc(100vw - 32px); height: calc(100vh - 96px); }
}
