﻿/* =========================================================
   DCA TRACKER â€“ BC + Polish + AnalizÄƒ (modern, robust)
   ========================================================= */

:root{
  /* ===== Premium Modern Theme (Indigo/Cyan) ===== */
  --bg:#f6f7ff;
  /* Glass surfaces (NO white sheets)
     Cards/panels should stay "white glass" on top of the gradient wallpaper. */
  --panel:rgba(255,255,255,.78);
  --panel-2:rgba(255,255,255,.72);
  --panel-3:rgba(255,255,255,.66);
  --border:rgba(15,23,42,.10);
  --text:#0f172a;
  --muted:#64748b;

  /* Accent (primary actions, active tabs) */
  --blue:#4f46e5;      /* indigo */
  --blue-2:#4338ca;    /* deep indigo */
  --cyan:#06b6d4;      /* cyan */
  --blue-soft:rgba(79,70,229,.10);
  --cyan-soft:rgba(6,182,212,.10);

  /* Success / danger (semantic) */
  --green:#22c55e;
  --green-2:#16a34a;
  --green-soft:rgba(34,197,94,.12);

  --red:#ef4444;
  --red-2:#dc2626;
  --red-soft:rgba(239,68,68,.10);

  --amber:#f59e0b;

  /* Brand asset colors (single source of truth for charts) */
  --btc:#f7931a;
  --eth:#3C3C3D;

  --radius:18px;
  --shadow:0 26px 70px rgba(15,23,42,.10);
  --shadow2:0 10px 26px rgba(15,23,42,.08);
  --shadow1:0 3px 10px rgba(15,23,42,.06);
  --ring:0 0 0 4px rgba(79,70,229,.16);

  /* Unified button system */
  --btn-bg:rgba(255,255,255,.80);
  --btn-bg-hover:rgba(255,255,255,.92);
  --btn-border:rgba(15,23,42,.14);
  --btn-text:#0f172a;
  --btn-shadow:0 1px 2px rgba(15,23,42,.06);
  --btn-shadow-hover:0 4px 12px rgba(15,23,42,.07);
  --btn-radius:10px;
  --btn-h:36px;
  --btn-py:7px;
  --btn-px:12px;
}

*{box-sizing:border-box}
html,body{height:100%}
html{background:var(--bg);}

/* Boot strategy: never blank the page.
   During very early boot we show only the initial target view. */
html.js-booting .view{ display:none !important; }
html.js-booting[data-boot-view="dashboard-view"] #dashboard-view{ display:block !important; }
html.js-booting[data-boot-view="transactions-view"] #transactions-view{ display:block !important; }
html.js-booting[data-boot-view="analysis-view"] #analysis-view{ display:block !important; }
html.js-booting[data-boot-view="optimize-view"] #optimize-view{ display:block !important; }
html.js-booting[data-boot-view="goals-view"] #goals-view{ display:block !important; }
html.js-booting[data-boot-view="settings-view"] #settings-view{ display:block !important; }
html.js-booting[data-boot-view="profile-view"] #profile-view{ display:block !important; }
html.js-booting[data-boot-view="admin-view"] #admin-view{ display:block !important; }

body{
  margin:0;
  min-height:100vh;
  /* Use normal page scroll (avoid inner scrollbars) */
  display:block;
  overflow-x:hidden;
  overflow-y:auto;
  background:transparent;
  color:var(--text);
  font:15px/1.45 "Segoe UI",system-ui,-apple-system,Arial,sans-serif;
}

/* Fixed wallpaper layer (prevents "two pages" seam on long scroll) */
body::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:-1;
  pointer-events:none;
  background:
    radial-gradient(1200px 680px at 12% 8%, rgba(79,70,229,.18), transparent 55%),
    radial-gradient(980px 560px at 92% 16%, rgba(6,182,212,.16), transparent 55%),
    radial-gradient(720px 480px at 30% 92%, rgba(245,158,11,.10), transparent 55%),
    var(--bg);
}

/* ===== Topbar ===== */
.topbar{
  position:relative;
  z-index:50;
  /* full-width sticky wrapper; the actual "card" is drawn via ::before to cover both top row + tabs */
  background:transparent;
  border-bottom:none;
  box-shadow:none;
  padding:10px 20px 12px;
}
.topbar::before{
  content:"";
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  top:10px;
  bottom:10px;
  width:min(1600px, calc(100% - 40px));

  background:rgba(15,23,42,.72);
  backdrop-filter:saturate(180%) blur(12px);
  border:1px solid var(--border);
  border-radius:18px;
  box-shadow:0 10px 35px rgba(15,23,42,.06);
  pointer-events:none;
}
.topbar__inner{
  max-width:none;
  width:100%;
  margin:0 auto;
  padding:6px 0 8px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;

  /* background is provided by header ::before (uniform across tabs + top row) */
  background:transparent;
  border:none;
  border-radius:0;
  box-shadow:none;
  position:relative;
  z-index:1;
}
.brand{display:flex; align-items:center; gap:12px}
.brand__icon{
  width:64px;height:64px;
  display:grid;place-items:center;
  border-radius:12px;
  background:linear-gradient(135deg, rgba(79,70,229,.16), rgba(6,182,212,.12));
  border:1px solid rgba(15,23,42,.10);
  box-shadow:var(--shadow2);
  font-size:22px;
}
.brand__title{font-weight:800; letter-spacing:.2px; font-size:16px}
.brand__sub{color:var(--muted); font-size:12px}

/* ===== Layout ===== */
.container{
  max-width:none;
  width:100%;
  margin:0 auto;
  padding:18px 20px 24px;
  /* Let the document scroll, not the container */
  overflow:visible;
}
.footer{
  padding:18px 0 28px;
  text-align:center;
  color:var(--muted);
  font-size:12px;
}

/* ===== Tabs ===== */
.tabs{
  display:flex;
  gap:8px;
  align-items:center;
  margin:10px 0 18px;
  overflow:auto;
  padding:0;
  border:none;
  background:transparent;
  backdrop-filter:none;
  border-radius:999px;
  box-shadow:none;
}
.tab{
  border:none;
  background:transparent;
  padding:10px 14px;
  border-radius:999px;
  cursor:pointer;
  color:var(--muted);
  display:flex; align-items:center; gap:8px;
  white-space:nowrap;
  font-weight:800;
  transition:transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.tab:hover{background:rgba(79,70,229,.08)}
.tab.is-active{
  background:linear-gradient(135deg, var(--blue), var(--cyan));
  color:#fff;
  box-shadow:0 14px 30px rgba(79,70,229,.18);
  transform:translateY(-1px);
}
.ico{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}

/* ===== Views ===== */
.view{
  /* Transparent container: cards/panels provide the surfaces */
  background:transparent;
  border:none;
  border-radius:0;
  backdrop-filter:none;
  box-shadow:none;
  padding:0;
  margin-bottom:18px;
}
.view.is-hidden{display:none}
.is-hidden{display:none !important}
.view__header{
  display:flex; align-items:baseline; justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
  padding:0 6px;
}

/* Analysis toolbar alignment */
#analysis-view .view__header{ padding:0; }
.view__header h2{margin:0; font-size:18px}
.muted{color:var(--muted)}
.small{font-size:12px}

/* ===== Panels ===== */
.panel{
  background:linear-gradient(180deg, var(--panel-2), var(--panel-3));
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:14px;
  box-shadow:var(--shadow2);
  margin-top:10px;
}
.panel--danger{
  background:linear-gradient(180deg, rgba(15,23,42,.06), var(--red-soft));
  border-color:rgba(229,57,53,.25);
}

/* Clean panels (transparent surface) - used in Summary/Analysis */
#analysis-view .panel--clean{
  background:transparent;
  border:none;
  box-shadow:none;
  padding:0;
}
#analysis-view .panel--clean .panel__header{
  padding:0 6px;
  margin-bottom:10px;
}
#analysis-view #analysisMonthlyPanel{
  margin-top:10px;
}
.panel__header{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.panel__header--actions-only{
  justify-content:flex-end;
}
.panel__header--actions-only .panel__actions{
  margin-left:auto;
}
.panel__header h3{margin:0; font-size:14px}
.panel__actions{display:flex; gap:10px; align-items:center}

/* ===== Buttons ===== */
.btn{
  border:1px solid var(--btn-border);
  background:var(--btn-bg);
  padding:var(--btn-py) var(--btn-px);
  min-height:var(--btn-h);
  border-radius:var(--btn-radius);
  cursor:pointer;
  font-weight:700;
  color:var(--btn-text);
  box-shadow:var(--btn-shadow);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  line-height:1.1;
  transition:box-shadow .14s ease, background .14s ease, border-color .14s ease, color .14s ease, transform .06s ease;
}
.btn:hover{
  background:var(--btn-bg-hover);
  border-color:rgba(15,23,42,.22);
  box-shadow:var(--btn-shadow-hover);
}
.btn:active{transform:translateY(1px)}
.btn:disabled{opacity:.52; cursor:not-allowed; box-shadow:none; transform:none}
.btn--primary{
  background:linear-gradient(180deg, rgba(247,250,255,.92), rgba(232,240,254,.84));
  border-color:rgba(37,99,235,.22);
  color:#1e40af;
  box-shadow:0 1px 2px rgba(37,99,235,.06);
}
.btn--primary:hover{
  background:linear-gradient(180deg, rgba(241,245,255,.94), rgba(219,234,254,.86));
  border-color:rgba(37,99,235,.30);
  box-shadow:0 5px 12px rgba(37,99,235,.10);
}
.btn--soft{
  background:linear-gradient(180deg, rgba(248,250,252,.92), rgba(241,245,249,.82));
  border-color:rgba(100,116,139,.24);
  color:#334155;
  box-shadow:var(--btn-shadow);
}
.btn--soft:hover{background:linear-gradient(180deg, rgba(241,245,249,.96), rgba(226,232,240,.86)); border-color:rgba(100,116,139,.34)}
.btn--danger{
  background:linear-gradient(180deg, rgba(254,245,245,.84), rgba(254,235,235,.74));
  border-color:rgba(220,38,38,.22);
  color:#b91c1c;
}
.btn--danger:hover{background:linear-gradient(180deg, rgba(254,236,236,.90), rgba(254,220,220,.78)); border-color:rgba(220,38,38,.30)}
.btn--ghost{
  background:transparent;
  border:1px solid var(--btn-border);
  box-shadow:none;
}
.btn--danger.btn--ghost{border-color:rgba(220,38,38,.28)}
.btn--danger.btn--ghost:hover{background:rgba(220,38,38,.07)}

/* Icon-only button helper (used for topbar Refresh on mobile/desktop) */
.btn--icononly{min-width:36px; width:36px; height:36px; padding:0;}
.btn--icononly .ico{margin-right:0;}

/* Visually hidden, accessible text */
.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

/* ===== Fields / Forms ===== */
.form-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}
.form-grid--2{grid-template-columns:repeat(2,minmax(0,1fr))}
.form-grid--3{grid-template-columns:repeat(3,minmax(0,1fr))}
.field{display:flex; flex-direction:column; gap:6px}
.field--inline{flex-direction:column}
.field label{font-size:12px; color:var(--muted); font-weight:700}
.input,.select{
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  font:inherit;
  background:var(--panel);
}
.input:focus,.select:focus{outline:none; box-shadow:var(--ring); border-color:rgba(79,70,229,.35)}
.select--sm{padding:8px 10px; font-size:13px;}
.menu-item--lang{cursor:default;}
.menu-item--lang:hover{background:transparent;}
.menu-item--lang .select{margin-left:auto; width:auto; min-width:120px;}
.menu-item--currency{cursor:default;}
.menu-item--currency:hover{background:transparent;}
.menu-item--currency .currency-toggle{margin-left:auto;}

/* Premium language toggle (RO/EN) */
.menu-item--lang .lang-toggle{
  margin-left:auto;
  display:inline-flex;
  align-items:center;
  gap:2px;
  padding:2px;
  border:1px solid var(--border);
  background:rgba(0,0,0,.03);
  border-radius:999px;
}
.menu-item--lang .lang-btn{
  border:0;
  background:transparent;
  color:inherit;
  padding:6px 8px;
  border-radius:999px;
  font:inherit;
  font-size:16px;
  font-weight:900;
  line-height:1;
  min-width:34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.menu-item--lang .flag{
  width:18px;
  height:18px;
  border-radius:999px;
  display:inline-block;
  background-size:cover;
  background-position:center;
  background-repeat:no-repeat;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.08);
}
.menu-item--lang .flag-ro{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 3 2'%3E%3Crect width='1' height='2' x='0' y='0' fill='%23002B7F'/%3E%3Crect width='1' height='2' x='1' y='0' fill='%23FCD116'/%3E%3Crect width='1' height='2' x='2' y='0' fill='%23CE1126'/%3E%3C/svg%3E");
}
.menu-item--lang .flag-us{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 19 10'%3E%3Crect width='19' height='10' fill='%23fff'/%3E%3Cg fill='%23B22234'%3E%3Crect y='0' width='19' height='1'/%3E%3Crect y='2' width='19' height='1'/%3E%3Crect y='4' width='19' height='1'/%3E%3Crect y='6' width='19' height='1'/%3E%3Crect y='8' width='19' height='1'/%3E%3C/g%3E%3Crect width='8' height='5' fill='%233C3B6E'/%3E%3Cg fill='%23fff'%3E%3Ccircle cx='1' cy='1' r='0.35'/%3E%3Ccircle cx='3' cy='1' r='0.35'/%3E%3Ccircle cx='5' cy='1' r='0.35'/%3E%3Ccircle cx='7' cy='1' r='0.35'/%3E%3Ccircle cx='2' cy='2.5' r='0.35'/%3E%3Ccircle cx='4' cy='2.5' r='0.35'/%3E%3Ccircle cx='6' cy='2.5' r='0.35'/%3E%3Ccircle cx='1' cy='4' r='0.35'/%3E%3Ccircle cx='3' cy='4' r='0.35'/%3E%3Ccircle cx='5' cy='4' r='0.35'/%3E%3Ccircle cx='7' cy='4' r='0.35'/%3E%3C/g%3E%3C/svg%3E");
}
.menu-item--lang .lang-btn:hover{background:rgba(0,0,0,.04);}
.menu-item--lang .lang-btn.is-selected{
  background:var(--panel);
  box-shadow:var(--shadow1);
}
.menu-item--lang .lang-btn:focus{outline:none; box-shadow:var(--ring);}

.form-actions{display:flex; gap:10px; align-items:center; justify-content:flex-end; grid-column:1/-1}

/* ===== Toolbar ===== */
.toolbar{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:12px;
  flex-wrap:wrap;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  /* White-glass surface (no "white sheet" behind the cards) */
  background:linear-gradient(180deg, rgba(255,255,255,.78), rgba(255,255,255,.70));
  backdrop-filter:saturate(160%) blur(12px);
  box-shadow:var(--shadow2);
}
.toolbar--tight{padding:8px 10px}
.toolbar__left,.toolbar__right{display:flex; gap:10px; align-items:flex-end; flex-wrap:wrap}

/* Transactions: filters/actions should feel native (no extra toolbar "card" surface) */
#transactions-view #txToolbar{
  background:transparent;
  border:none;
  box-shadow:none;
  backdrop-filter:none;
  padding:0;
  margin-bottom:10px;
}

/* ===== Cards ===== */
.grid.cards{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin-top:8px;
}
.card{
  /* Premium white-glass card */
  background:linear-gradient(180deg, rgba(255,255,255,.82), rgba(255,255,255,.74));
  backdrop-filter:saturate(160%) blur(12px);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:14px;
  box-shadow:var(--shadow2);
  position:relative;
  transform:none;
  backface-visibility:hidden;
  transition:box-shadow .16s ease, border-color .16s ease, background .16s ease;
}
.card:hover{
  transform:none;
  z-index:1;
  box-shadow:0 18px 44px rgba(15,23,42,.10);
  border-color:rgba(79,70,229,.14);
}
.card__label{color:var(--muted); font-weight:800; font-size:12px; display:flex; align-items:center; gap:8px; justify-content:center}
.metric-ico{
  width:18px; height:18px;
  display:inline-grid; place-items:center;
  border-radius:10px;
  background:linear-gradient(135deg, rgba(79,70,229,.14), rgba(6,182,212,.10));
  border:1px solid rgba(79,70,229,.20);
  color:var(--blue-2);
  box-shadow:var(--shadow1);
}
.metric-ico svg{width:14px;height:14px;fill:currentColor}
.card__value{font-weight:900; font-size:22px; margin-top:6px}
.card__hint{margin-top:6px; font-size:12px}

/* ===== KPI/Card alignment (Dashboard / Optimize / Summary) ===== */
#dashboard-view .card,
#optimize-view .card,
#analysis-view .card{
  text-align:center;
}
#dashboard-view .card__label,
#optimize-view .card__label,
#analysis-view .card__label{
  justify-content:center;
}
#dashboard-view .card__hint,
#optimize-view .card__hint,
#analysis-view .card__hint{
  text-align:center;
}

/* Keep complex widgets readable */
#dashboard-view #card-goals .mini-bars{ text-align:left; }
#dashboard-view #card-goals .mini-bar{ justify-content:space-between; }

/* Dashboard row-2 cards: emoji only (no SVG icon chips) */
#dashboard-view #card-goals .metric-ico,
#dashboard-view #card-fng .metric-ico{ display:none !important; }
#dashboard-view #card-goals .card__label::before{ content:"\01F3AF"; }
#dashboard-view #card-fng .card__label::before{content:"\01F631";}
#dashboard-view #card-goals .card__label::before,
#dashboard-view #card-fng .card__label::before{
  display:inline-block;
  width:24px;
  text-align:center;
  font-size:16px;
  line-height:1;
}

/* Summary (Analysis): keep ONLY the emoji that exist in the HTML labels.
   Avoid adding extra emoji via CSS/i18n (prevents 2x/3x emoji). */
#analysis-view .grid.cards .card .card__label::before{
  content:none !important;
  display:none !important;
}

/* Dashboard: keep the playful emoji inside KPI cards */
#dashboard-view .card__label .metric-ico{display:none;}
#dashboard-view #card-value .card__label::before{content:"\01F4C8";}
#dashboard-view #card-pnl .card__label::before{content:"\01F4CA";}
#dashboard-view #card-invested .card__label::before{content:"\01F4B0";}
#dashboard-view #card-fees .card__label::before{content:"\01F9FE";}
#dashboard-view #card-goals .card__label::before{content:"\01F3AF";}
#dashboard-view #card-fng .card__label::before{content:"\01F631";}
#dashboard-view #card-dca-streak .card__label::before{content:"\01F525";}
#dashboard-view #card-avg-fee .card__label::before{content:"\01F4B8";}
#dashboard-view .card__label::before{display:inline-block; width:20px; text-align:center; font-size:16px; line-height:1;}
/* Fear & Greed label: surprised emoji before text, smile emoji after text */
#dashboard-view #card-fng .card__label::before{
  width:auto !important;
  margin-right:4px;
}
#dashboard-view #card-fng .card__label::after{
  content:"\01F604";
  display:inline-block;
  margin-left:6px;
  font-size:16px;
  line-height:1;
  vertical-align:baseline;
}
#card-pnl.is-profit{
  background:linear-gradient(180deg, rgba(255,255,255,.95), rgba(240,253,244,.90));
  border-color:rgba(22,163,74,.20);
  box-shadow:0 12px 24px rgba(22,163,74,.06);
}
#card-pnl.is-loss{
  background:linear-gradient(180deg, rgba(255,255,255,.95), rgba(254,245,245,.90));
  border-color:rgba(220,38,38,.20);
  box-shadow:0 12px 24px rgba(220,38,38,.06);
}
#card-pnl.is-profit .card__hint{color:#166534;}
#card-pnl.is-loss .card__hint{color:#b91c1c;}

/* ===== Tables ===== */
.table-wrap{overflow:auto; border-radius:12px; border:1px solid var(--border)}
.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  min-width:920px;
  background:var(--panel);
}
.table th,.table td{
  padding:10px 10px;
  border-bottom:1px solid var(--border);
  text-align:left;
  white-space:nowrap;
  font-size:13px;
}
.table th{
  position:relative;
  background:linear-gradient(180deg, rgba(255,255,255,.76), rgba(255,255,255,.68));
  backdrop-filter:saturate(160%) blur(12px);
  font-weight:900;
  color:var(--text);
}
#assetMetricsTable th,
#assetMetricsTable td{
  text-align:center;
}
#assetMetricsTable .asset-tag,
#transactions-view #txTable .asset-tag,
#goals-view #goalsTable .asset-tag,
#optimize-view #optRecentFeesTable .asset-tag{
  display:inline-grid;
  grid-template-columns:18px minmax(0,1fr);
  align-items:center;
  justify-content:start;
  width:104px;
  margin:0 auto;
  text-align:left;
}
#assetMetricsTable .asset-tag .asset-code,
#transactions-view #txTable .asset-tag .asset-code,
#goals-view #goalsTable .asset-tag .asset-code,
#optimize-view #optRecentFeesTable .asset-tag .asset-code{
  justify-self:start;
}
.table tbody tr:hover{background:rgba(15,23,42,.02)}
.table tbody tr:nth-child(even){background:rgba(15,23,42,.012)}
.table--sticky thead th{position:sticky; top:0; z-index:2}
.col-check{width:40px}
.sort{margin-left:6px; color:var(--muted); font-weight:900}
.tag{
  display:inline-flex; align-items:center; gap:6px;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid var(--border);
  background:var(--panel);
  font-weight:800;
  font-size:12px;
}
.asset-tag{display:inline-flex; align-items:center; gap:8px; line-height:1; vertical-align:middle}
.asset-tag .asset-icon{display:block; width:18px; height:18px; border-radius:999px; object-fit:cover; object-position:center; flex:0 0 auto; background:#fff; border:1px solid rgba(148,163,184,.22); box-sizing:border-box}
.asset-tag .asset-code{font-weight:900; line-height:1}
.asset-tag--sm .asset-icon{width:18px; height:18px}
.asset-tag--md .asset-icon{width:20px; height:20px}
.asset-tag--lg .asset-icon{width:24px; height:24px}
.asset-tag--code-heart .asset-icon{transform:translateY(-1px);}
.asset-cg-results{
  margin-top:8px;
  display:flex;
  flex-direction:column;
  gap:6px;
  max-height:300px;
  overflow:auto;
  padding-right:2px;
}
.asset-toolbar{
  border:1px solid rgba(79,70,229,.22);
  border-radius:14px;
  padding:12px;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(6,182,212,.10), transparent 52%),
    radial-gradient(120% 120% at 0% 100%, rgba(79,70,229,.10), transparent 52%),
    linear-gradient(180deg, rgba(255,255,255,.82), rgba(255,255,255,.72));
  box-shadow:0 10px 26px rgba(30,41,59,.08);
}
.asset-cg-item{
  width:100%;
  border:1px solid rgba(148,163,184,.35);
  background:linear-gradient(180deg, rgba(255,255,255,.90), rgba(255,255,255,.76));
  border-radius:12px;
  padding:8px 10px;
  display:flex;
  align-items:center;
  gap:10px;
  text-align:left;
  transition:transform .08s ease, box-shadow .14s ease, border-color .14s ease, background .14s ease;
}
.asset-cg-item:hover{
  border-color:rgba(79,70,229,.35);
  background:linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.80));
  box-shadow:0 12px 22px rgba(79,70,229,.12);
  transform:translateY(-1px);
}
.asset-cg-item__logo{
  width:26px;
  height:26px;
  border-radius:999px;
  flex:0 0 auto;
  background:#fff;
  border:1px solid var(--border);
}
.asset-cg-item__meta{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:2px;
}
.asset-cg-item__meta b{ line-height:1; }
.asset-cg-item__id{
  margin-left:auto;
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
}
.asset-cg-item__add{
  margin-left:8px;
  white-space:nowrap;
  min-width:92px;
  border:0;
  background:linear-gradient(135deg, var(--blue), var(--cyan));
  color:#fff;
  box-shadow:0 8px 20px rgba(79,70,229,.22);
}
.asset-cg-item__add:hover{
  background:linear-gradient(135deg, var(--blue-2), var(--cyan));
}
.asset-logo{
  width:22px;
  height:22px;
  border-radius:999px;
  border:1px solid var(--border);
  background:#fff;
}
#settings-view .panel--assets-premium{
  position:relative;
  overflow:hidden;
  border:1px solid rgba(79,70,229,.20);
  background:
    radial-gradient(130% 120% at 100% 0%, rgba(6,182,212,.11), transparent 55%),
    radial-gradient(130% 120% at 0% 100%, rgba(79,70,229,.11), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,.84), rgba(255,255,255,.72));
  box-shadow:0 14px 34px rgba(30,41,59,.10);
}
#settings-view .panel--assets-premium::before{
  content:"";
  position:absolute;
  right:-120px;
  top:-120px;
  width:280px;
  height:280px;
  border-radius:999px;
  background:radial-gradient(circle, rgba(79,70,229,.10), rgba(79,70,229,0));
  pointer-events:none;
}
#settings-view .asset-form{
  grid-template-columns:1fr;
}
#settings-view .panel--assets-premium .table-wrap{
  margin-top:10px;
  border:1px solid rgba(148,163,184,.35);
  border-radius:14px;
  background:rgba(255,255,255,.66);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.55);
}
#settings-view .panel--assets-premium .table{
  min-width:760px;
  background:transparent;
}
#settings-view .panel--assets-premium .table th{
  background:linear-gradient(180deg, rgba(255,255,255,.90), rgba(255,255,255,.78));
  font-size:13px;
  letter-spacing:.01em;
}
#settings-view .panel--assets-premium .table td{
  font-size:13px;
}
#settings-view #assetsTable th,
#settings-view #assetsTable td{
  text-align:center;
}
#settings-view #assetsTable .asset-logo{
  margin-inline:auto;
}
.tag--good{background:var(--green-soft); border-color:rgba(76,175,80,.25)}
.tag--bad{background:var(--red-soft); border-color:rgba(229,57,53,.25)}

/* Metric icon (labels inside cards/panels) */
.metric-ico{
  width:20px;height:20px;
  display:inline-grid;place-items:center;
  border-radius:10px;
  background:linear-gradient(135deg, rgba(79,70,229,.14), rgba(6,182,212,.10));
  border:1px solid rgba(79,70,229,.16);
  color:var(--blue-2);
  box-shadow:var(--shadow1);
  flex:0 0 auto;
}
.metric-ico svg{width:14px;height:14px;fill:currentColor}

/* ===== Charts ===== */
.two-col{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  margin-top:14px;
}
.chart{height:280px}
.chart--wide{height:320px}
.chart canvas{width:100% !important; height:100% !important}
.evo-header-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:nowrap;
  justify-content:flex-end;
  margin-top:6px;
  align-self:flex-end;
}
.evo-legend{
  display:inline-flex;
  align-items:center;
  gap:12px;
  margin-right:2px;
}
.evo-legend__item{
  display:inline-flex;
  align-items:center;
  gap:6px;
  color:var(--muted);
  font-size:12px;
  font-weight:600;
  white-space:nowrap;
}
.evo-legend__swatch{
  width:28px;
  height:0;
  border-top:3px solid transparent;
  border-radius:999px;
  display:inline-block;
}
.evo-legend__swatch--invested{
  border-top-color:#64748b;
}
.evo-legend__swatch--value{
  border-top-color:var(--green);
}
.evo-range{
  display:inline-flex;
  align-items:center;
  gap:2px;
  padding:2px;
  border:1px solid rgba(15,23,42,.10);
  border-radius:12px;
  background:rgba(255,255,255,.58);
}
.evo-range__btn{
  border:0;
  background:transparent;
  color:var(--muted);
  font:inherit;
  font-size:11px;
  font-weight:800;
  line-height:1;
  padding:6px 10px;
  min-width:42px;
  border-radius:10px;
  cursor:pointer;
  transition:background .12s ease, color .12s ease;
}
.evo-range__btn:hover{
  background:rgba(15,23,42,.05);
  color:#334155;
}
.evo-range__btn.is-active{
  background:rgba(37,99,235,.10);
  color:#1d4ed8;
}
@media (max-width:760px){
  .evo-header-actions{
    flex-wrap:wrap;
    width:100%;
    justify-content:space-between;
  }
  .evo-legend{
    width:100%;
    justify-content:flex-start;
    gap:10px;
  }
}

/* Evolution compare: keep controls in normal flow (no overlap with chart labels) */
#evolutionComparePanel .panel__header{
  align-items:center;
  flex-wrap:nowrap;
  margin-bottom:4px;
}
#evolutionComparePanel .evo-header-actions{
  position:static;
  margin-top:0;
  margin-left:10px;
  flex:1 1 auto;
  min-width:0;
  gap:6px;
  flex-wrap:nowrap;
  justify-content:flex-end;
}
#evolutionComparePanel .evo-legend{
  flex:1 1 auto;
  min-width:0;
  justify-content:center;
}
#evolutionComparePanel .panel__header h3{
  margin:0;
  line-height:1.2;
}
#evolutionComparePanel #pricesInfo{
  font-size:13px;
  white-space:nowrap;
}
#evolutionComparePanel .chart--wide{
  height:300px;
}

@media (max-width:1200px){
  #evolutionComparePanel .panel__header{
    align-items:flex-start;
    flex-wrap:wrap;
    row-gap:6px;
  }
  #evolutionComparePanel .panel__header h3{
    flex:1 1 100%;
  }
  #evolutionComparePanel .evo-header-actions{
    margin-left:0;
    width:100%;
    display:grid;
    grid-template-columns:1fr auto auto;
    gap:6px 8px;
    align-items:center;
    justify-content:stretch;
  }
  #evolutionComparePanel .evo-legend{
    grid-column:1 / -1;
    width:100%;
    justify-content:center;
    gap:10px;
  }
  #evolutionComparePanel .evo-legend__item{
    font-size:11px;
    white-space:normal;
  }
  #evolutionComparePanel .evo-range{
    justify-self:end;
  }
  #evolutionComparePanel .evo-range__btn{
    min-width:36px;
    padding:5px 8px;
    font-size:10px;
  }
  #evolutionComparePanel #pricesInfo{
    justify-self:end;
    font-size:12px;
    white-space:nowrap;
  }
}

@media (max-width:760px){
  #evolutionComparePanel .panel__header{
    align-items:flex-start;
    flex-wrap:wrap;
  }
  #evolutionComparePanel .evo-header-actions{
    margin-top:6px;
    width:100%;
    grid-template-columns:1fr;
    justify-content:stretch;
    gap:6px;
  }
  #evolutionComparePanel .evo-legend{
    width:100%;
    justify-content:flex-start;
  }
  #evolutionComparePanel .evo-range{
    justify-self:start;
  }
  #evolutionComparePanel #pricesInfo{
    justify-self:start;
    white-space:normal;
  }
}

/* ===== Switch ===== */
.switch{display:flex; align-items:center; gap:10px}
.switch__wrap{position:relative; display:inline-block; width:54px; height:30px}
.switch__wrap input{opacity:0; width:0; height:0}
.switch__slider{
  position:absolute; inset:0;
  cursor:pointer;
  background:#d1d5db;
  border-radius:999px;
  transition:.2s;
}
.switch__slider:before{
  content:"";
  position:absolute;
  width:22px;height:22px;
  left:4px; top:4px;
  background:var(--panel);
  border-radius:50%;
  transition:.2s;
  box-shadow:var(--shadow2);
}
.switch__wrap input:checked + .switch__slider{background:linear-gradient(135deg, var(--blue), var(--cyan))}
.switch__wrap input:checked + .switch__slider:before{transform:translateX(24px)}

/* ===== Toast ===== */
.toast{
  position:fixed;
  right:16px;
  bottom:16px;
  width:fit-content;
  max-width:min(360px, calc(100% - 24px));
  z-index:12000;
  margin:0;
  padding:10px 14px;
  border-radius:14px;
  border:1px solid rgba(22,163,74,.26);
  background:linear-gradient(180deg, rgba(240,253,244,.96), rgba(220,252,231,.88));
  color:#166534;
  box-shadow:0 14px 30px rgba(15,23,42,.20), 0 1px 2px rgba(15,23,42,.08);
  font-weight:800;
  display:flex;
  align-items:center;
  gap:10px;
  transform:translateY(8px) scale(.98);
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease, transform .18s ease;
}
.toast::before{
  content:"";
  width:8px;
  height:8px;
  border-radius:999px;
  background:currentColor;
  box-shadow:0 0 0 4px rgba(15,23,42,.10);
  flex:0 0 auto;
}
.toast:not(.is-hidden){
  opacity:1;
  transform:translateY(0) scale(1);
  pointer-events:auto;
}
.toast:empty{
  display:none !important;
}
#uiToast{ bottom:16px; }
#uiError{ bottom:70px; }
.toast--success{
  border-color:rgba(22,163,74,.26);
  background:linear-gradient(180deg, rgba(240,253,244,.96), rgba(220,252,231,.88));
  color:#166534;
}
.toast--warn{
  border-color:rgba(217,119,6,.26);
  background:linear-gradient(180deg, rgba(255,251,235,.96), rgba(254,243,199,.90));
  color:#92400e;
}
.toast--info{
  border-color:rgba(37,99,235,.26);
  background:linear-gradient(180deg, rgba(239,246,255,.96), rgba(219,234,254,.90));
  color:#1d4ed8;
}
.toast--error{
  border-color:rgba(220,38,38,.28);
  background:linear-gradient(180deg, rgba(254,242,242,.96), rgba(254,226,226,.90));
  color:#b91c1c;
}
.toast.is-hidden{display:none}

@media (max-width: 760px){
  .toast{
    right:10px;
    left:10px;
    width:auto;
    bottom:12px;
    padding:9px 12px;
    border-radius:12px;
    font-size:13px;
  }
  #uiError{ bottom:62px; }
}

/* ===== File input ===== */
.file input{display:none}

/* ===== Responsive ===== */
@media (max-width: 1100px){
  .grid.cards{grid-template-columns:repeat(2,minmax(0,1fr))}
  .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width: 720px){
  .two-col{grid-template-columns:1fr}
  .grid.cards{grid-template-columns:1fr}
  .form-grid{grid-template-columns:1fr}
  .topbar__inner{flex-wrap:wrap}
  .container{margin:12px auto; padding:0 12px 20px;}
  .view{padding:14px;}
}


/* =======================
   PREMIUM POLISH (v1.5.0)
   ======================= */
.ico svg{
  width:18px;
  height:18px;
  display:block;
  vertical-align:middle;
  fill:currentColor;
}
.topbar__meta{
  display:flex;
  gap:8px;
  align-items:center;
  margin-left:auto;
}
.version-pill, .stage-pill{
  display:inline-flex;
  align-items:center;
  padding:4px 10px;
  border-radius: 999px;
  border:1px solid var(--border);
  background: #f9fafb;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1;
}
.stage-pill{
  background: linear-gradient(180deg, rgba(79,70,229,.12), rgba(6,182,212,.10));
  border-color: rgba(79,70,229,.24);
  color: var(--blue-2);
}
.footer-meta{
  color: var(--muted);
  font-weight: 500;
}
.badge-up, .badge-down{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:2px 8px;
  border-radius: 999px;
  font-size: 0.85rem;
  border: 1px solid var(--border);
}
.badge-up{ background: var(--green-soft); color: #1b5e20; }
.badge-down{ background: var(--red-soft); color: #b71c1c; }
.highlight{
  outline: 2px solid rgba(245,158,11,0.35);
  box-shadow: 0 10px 30px rgba(245,158,11,0.08);
}

/* ===== Sync pill ===== */
.topbar__right{display:flex;align-items:center;gap:10px;margin-left:auto}
.sync-pill{display:inline-flex;align-items:center;gap:8px;padding:6px 10px;border-radius:999px;border:1px solid var(--border);background:linear-gradient(180deg, rgba(255,255,255,.78), rgba(255,255,255,.70));backdrop-filter:saturate(160%) blur(12px);box-shadow:var(--shadow2);font-weight:800;font-size:12px;color:var(--muted)}
.sync-dot{width:10px;height:10px;border-radius:999px;background:#9ca3af;display:inline-block}
@media(max-width:720px){
  .topbar__right{gap:8px}
  #refreshDataBtn{padding:8px 10px}
}


/* =========================
   UI AUDIT â€“ Dashboard hierarchy (v1.9.2)
   ========================= */
.dashboard-cards{margin-top:12px}
.dashboard-cards .card--main{
  grid-column: 1 / -1;
  text-align:center;
  padding:20px 18px;
  background: linear-gradient(180deg, rgba(15,23,42,.08), var(--blue-soft));
}
.dashboard-cards .card--main .card__value{
  font-size:34px;
  letter-spacing:.2px;
}
.dashboard-cards .card--main .card__hint{
  opacity:.75;
}
.dashboard-cards .card--kpi .card__value{
  font-size:22px;
}
@media (max-width: 1100px){
  .dashboard-cards{grid-template-columns:repeat(2,minmax(0,1fr)) !important;}
  .dashboard-cards .card--main{grid-column:1/-1;}
}
@media (max-width: 720px){
  .dashboard-cards{grid-template-columns:1fr !important;}
  .dashboard-cards .card--main .card__value{font-size:28px;}
}

/* P&L value emphasis */
#pnlTotal.kpi-positive{color: var(--green-2);}
#pnlTotal.kpi-negative{color: var(--red-2);}


/* ================================
   BONDOR STACK - DESIGN TOKENS v1
   (SAFE / NO SELECTOR TOUCH)
================================ */

:root {
  --space-xs: 8px;
  --space-s: 16px;
  --space-m: 24px;
  --space-l: 32px;
  --space-xl: 48px;

  --font-base: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

  --color-accent: #1e3a8a;
  --color-positive: #166534;
}


/* ===== Modal (conflict) ===== */
.modal{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;z-index:9999}
.modal.is-hidden{display:none}
.modal__backdrop{position:absolute;inset:0;z-index:1;background:rgba(15,23,42,.28);backdrop-filter:saturate(160%) blur(10px)}
.modal__card{position:relative;z-index:2;pointer-events:auto;max-width:520px;width:calc(100% - 32px);background:linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.84));border:1px solid rgba(15,23,42,.10);border-radius:18px;padding:16px;box-shadow:0 26px 70px rgba(15,23,42,.22);backdrop-filter:saturate(160%) blur(14px);color:var(--text)}
.modal__actions{display:flex;gap:10px;justify-content:flex-end;margin-top:12px;flex-wrap:wrap}

/* Transaction modal (wide + non-technical friendly) */
body.modal-open{overflow:hidden}
.modal__card--wide{max-width:980px}
.modal__title{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:10px}
.modal__title .btn{min-width:auto;padding:8px 10px;line-height:1}

@media (max-width: 720px){
  .modal__card--wide{max-width:620px}
}


/* ===== BONDOR STACK â€“ Prezentare cards fix ===== */
.prezentare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.prezentare-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 180px;
}
.topbar__meta {
  display: none !important;
}
/* CurÄƒÈ›are completÄƒ topbar */
.topbar__inner::before,
.topbar__inner::after,
.topbar__inner > *::before,
.topbar__inner > *::after {
  content: none !important;
}





/* brand container can shrink */
.brand {
  min-width: 0;
  overflow: hidden;
}

/* motto constrained by layout, logo untouched */
.brand__sub {
  max-width: 260px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* protect right-side buttons */
.topbar__right {
  flex-shrink: 0;
}




.topbar__brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.topbar__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.brand_logo {
  flex-shrink: 0;
}

.brand__sub {
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}




header.topbar .brand{
  display:flex !important;
  align-items:center !important;
  gap:12px !important;
  min-width:0;
}

header.topbar .topbar__right{
  justify-self:end !important;
  display:flex !important;
  align-items:center !important;
  gap:10px !important;
}


/* (removed) absolute positioning hack for header actions */


/* ==================================================
   UI V2.6 - PREZENTARE LAYOUT (FIX REAL)
   Scope: doar tabul Prezentare (#dashboard-view)
   Obiectiv: 4 carduri KPI pe un rand, fara card mare pe rand separat
================================================== */
#dashboard-view .dashboard-cards{
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  gap:10px !important;
}
#dashboard-view .dashboard-cards .card--main{
  grid-column:auto !important;
  text-align:left !important;
  padding:16px !important;
  background:linear-gradient(180deg, rgba(255,255,255,.82), rgba(255,255,255,.74)) !important;
  backdrop-filter:saturate(160%) blur(12px) !important;
}
@media (max-width: 1100px){
  #dashboard-view .dashboard-cards{grid-template-columns:repeat(2,minmax(0,1fr)) !important;}
}
@media (max-width: 720px){
  #dashboard-view .dashboard-cards{grid-template-columns:1fr !important;}
}



/* ===== Dashboard: sub-header blocks ===== */
.view__header--sub{ margin-top:10px; margin-bottom:8px; padding-top:2px; }
.view__header--sub h3{ margin:0; font-size:16px; }






/* Hide the Evolution sub-header on Dashboard (remove text + strip background) */
#dashboard-view .view__header--sub{ display:none !important; }
/* ==================================================
   HEADER LOCK (V1)
   - previne "logo gigantic" + overlap cu acÈ›iunile
   - pÄƒstreazÄƒ topbar compact, stabil pe termen lung
================================================== */
header.topbar .topbar__inner{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:12px !important;
}

header.topbar .brand__logo img{
  height:46px !important;
  width:auto !important;
  max-width:240px !important;
  object-fit:contain !important;
  display:block !important;
}

header.topbar .brand__logo{flex:0 0 auto !important;}

/* anulÄƒm orice hack-uri vechi de poziÈ›ionare absolutÄƒ */
header.topbar .topbar__right{
  position:static !important;
  right:auto !important;
  top:auto !important;
  transform:none !important;
  margin-left:auto !important;
  z-index:auto !important;
}

/* in caz de ecran ingust, permitem wrap curat */
@media (max-width: 820px){
  header.topbar .topbar__inner{flex-wrap:wrap !important;}
  header.topbar .topbar__right{width:100% !important; justify-content:flex-end !important;}
  header.topbar .brand__sub{max-width:100% !important; white-space:normal !important;}
}

/* ==================================================
   DASHBOARD LOCK (V3)
   - 4 KPI cards on first row
   - 4 cards on second row fill full width
================================================== */
#dashboard-view .dashboard-cards--secondary{
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  gap:10px !important;
  margin-top:8px;
}
@media (max-width: 1100px){
  #dashboard-view .dashboard-cards--secondary{grid-template-columns:repeat(2,minmax(0,1fr)) !important;}
}
@media (max-width: 720px){
  #dashboard-view .dashboard-cards--secondary{grid-template-columns:1fr !important;}
}

/* ==================================================
   Transactions: premium table polish
================================================== */
.tx-actions{display:flex;justify-content:center;gap:8px;flex-wrap:nowrap;}
#txTable td:last-child{white-space:nowrap;}

/* center alignment for transactions table */
#transactions-view #txTable th,
#transactions-view #txTable td{ text-align:center; }
#transactions-view #txTable td.num,
#transactions-view #txTable th.num{ text-align:center !important; font-variant-numeric: tabular-nums; }
/* sticky filters toolbar (premium feel) */
.toolbar--sticky{
  position:sticky;
  top:92px; /* under sticky topbar */
  z-index:6;
  background:linear-gradient(180deg, rgba(255,255,255,.78), rgba(255,255,255,.70));
  backdrop-filter:saturate(160%) blur(10px);
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px 12px;
  box-shadow:0 10px 26px rgba(16,24,40,.06);
  margin-top:10px;
}
@media (max-width: 820px){
  .toolbar--sticky{ top:118px; }
}

/* selection chip */
.chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(15,23,42,.04);
  color:var(--text);
  font-weight:800;
  font-size:12px;
  white-space:nowrap;
}

/* Icon buttons (row actions) */
.icon-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  padding:0;
  border-radius:9px;
  border:1px solid var(--btn-border);
  background:var(--btn-bg);
  cursor:pointer;
  transition:box-shadow .12s ease, border-color .12s ease, background .12s ease, color .12s ease;
}
.icon-btn svg{width:16px;height:16px;fill:currentColor}
.icon-btn:hover{background:var(--btn-bg-hover); box-shadow:var(--btn-shadow-hover);}
.icon-btn--danger{color:#b91c1c;border-color:rgba(220,38,38,.22);background:rgba(254,245,245,.78);}
.icon-btn--danger:hover{background:rgba(254,236,236,.88);}
.icon-btn--primary{color:#1e40af;border-color:rgba(37,99,235,.24);background:rgba(241,245,255,.88);}
.icon-btn--primary:hover{background:rgba(232,240,254,.94);}
.icon-btn--soft{color:#334155;border-color:rgba(100,116,139,.28);background:rgba(248,250,252,.86);}
.icon-btn--soft:hover{background:rgba(241,245,249,.94);}

/* Row hover + selected state */
#txTable tbody tr:hover td{background:rgba(15,23,42,.02);}
#txTable tbody tr.is-selected td{background:rgba(34,197,94,.06);}
#txTable tbody tr.is-selected:hover td{background:rgba(34,197,94,.08);}

/* Highlight (after add/update/undo) */
@keyframes txPulse{
  0%{box-shadow:0 0 0 0 rgba(34,197,94,.25);}
  100%{box-shadow:0 0 0 10px rgba(34,197,94,0);}
}
#txTable tbody tr.is-just-updated{
  position:relative;
  animation:txPulse 1.2s ease-out;
}

/* Toast action button (Undo) */
.toast__action{
  margin-left:auto;
  border:1px solid rgba(15,23,42,.14);
  background:rgba(255,255,255,.72);
  color:#0f172a;
  font-weight:700;
  padding:4px 10px;
  border-radius:999px;
  cursor:pointer;
  text-decoration:none;
}
.toast__action:hover{
  background:rgba(255,255,255,.90);
  border-color:rgba(15,23,42,.22);
}

/* GOALS mini bars */
.mini-bars{display:flex;flex-direction:column;gap:8px;margin-top:10px;}
.mini-bar{display:grid;grid-template-columns:38px 1fr auto;gap:10px;align-items:center;}
.mini-bar__label{font-weight:800;font-size:12px;color:var(--muted)}
.mini-bar__track{height:10px;background:#eef2ff;border:1px solid var(--border);border-radius:999px;overflow:hidden;}
.mini-bar__fill{height:100%;width:0%;background:var(--green);border-radius:999px;transition:width .25s ease;}
.mini-bar__value{font-size:12px;color:var(--muted);white-space:nowrap;}

/* Tabs are inside header; keep spacing stable and avoid overlap */
header.topbar .tabs{
  margin:0 !important;
  padding:0 !important;
  padding-bottom:2px !important;
  border-bottom:none;
  background:transparent;
  justify-content:center;
  position:relative;
  z-index:1;
}

/* ==================================================
   HEADER / SWITCH (compact)
================================================== */
.view__header{display:flex;align-items:center;justify-content:space-between;gap:16px;}
.view__header-right{display:flex;align-items:center;gap:14px;margin-left:auto;justify-content:flex-end;}

/* Premium icon actions in Settings + Goals (keep actions visible, avoid solid blobs) */
#settings-view .icon-btn--primary,
#goals-view .icon-btn--primary{
  background:linear-gradient(180deg, rgba(255,255,255,.86), rgba(255,255,255,.74));
  border:1px solid rgba(34,197,94,.35);
  color:var(--green-2);
}
#settings-view .icon-btn--primary:hover,
#goals-view .icon-btn--primary:hover{
  background:linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.78));
}

#settings-view .icon-btn--soft,
#goals-view .icon-btn--soft{
  background:linear-gradient(180deg, rgba(255,255,255,.86), rgba(255,255,255,.74));
  border:1px solid rgba(79,70,229,.28);
  color:var(--blue-2);
}
#settings-view .icon-btn--soft:hover,
#goals-view .icon-btn--soft:hover{
  background:linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.78));
}

/* Ensure SVG icons never look clipped */
.icon-btn svg{overflow:visible;}
.switch--compact{display:flex;align-items:center;gap:8px;}
.switch--compact .muted{font-size:12px;}

/* Currency toggle: premium clean compact (discreet, not flashy) */
.currency-toggle{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:2px 6px;
  border-radius:999px;
  border:1px solid rgba(15,23,42,.10);
  background:rgba(255,255,255,.40);
  box-shadow:none;
  backdrop-filter:saturate(120%) blur(6px);
}
.currency-toggle .currency-toggle__label{
  min-width:30px;
  text-align:center;
  font-size:11px;
  line-height:1;
  font-weight:600;
  letter-spacing:.02em;
  color:#64748b;
  opacity:.6;
  transition:opacity .18s ease, color .18s ease;
}
.currency-toggle .switch__wrap{width:38px;height:20px;}
.currency-toggle .switch__slider{
  background:rgba(148,163,184,.20);
  border:1px solid rgba(100,116,139,.22);
  box-shadow:inset 0 1px 1px rgba(15,23,42,.06);
}
.currency-toggle .switch__slider:before{
  width:16px;height:16px;
  left:1px; top:1px;
  background:#ffffff;
  border:1px solid rgba(100,116,139,.24);
  box-shadow:0 1px 2px rgba(15,23,42,.10);
}
.currency-toggle .switch__wrap input:checked + .switch__slider{
  background:rgba(79,70,229,.20);
  border-color:rgba(79,70,229,.30);
}
.currency-toggle .switch__wrap input:checked + .switch__slider:before{transform:translateX(18px);}
.currency-toggle .switch__wrap input:focus-visible + .switch__slider{
  box-shadow:0 0 0 2px rgba(15,23,42,.12), inset 0 1px 1px rgba(15,23,42,.06);
}
.currency-toggle.is-ron .currency-toggle__label--ron,
.currency-toggle.is-usd .currency-toggle__label--usd{
  opacity:1;
  color:#334155;
}
.currency-toggle.is-ron .currency-toggle__label--usd,
.currency-toggle.is-usd .currency-toggle__label--ron{
  opacity:.5;
}

.menu-item--currency .currency-toggle{
  background:linear-gradient(180deg, rgba(255,255,255,.84), rgba(248,250,252,.76));
  border-color:rgba(15,23,42,.14);
  box-shadow:0 1px 2px rgba(15,23,42,.06);
}

/* ==================================================
   SETTINGS: 3 panels on one row
================================================== */
.settings-triple{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:10px;
  align-items:stretch;
  margin-top:10px;
}
@media (max-width: 1100px){
  .settings-triple{grid-template-columns:repeat(2, minmax(0,1fr));}
}
@media (max-width: 720px){
  .settings-triple{grid-template-columns:1fr;}
}

/* Settings: butoane centrate in cele 3 panouri (Export/Import, Pericol, Invita) */
.settings-triple .form-actions{
  justify-content:center;
  flex-wrap:wrap;
}
.settings-triple .invite-actions{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
  margin-top:10px;
}

/* ==================================================
   FINAL POLISH (2025-12-28c)
   - Center text inside ALL KPI cards
   - Bigger header logo + full motto (no ellipsis)
   - Keep GOALS mini-bars readable
================================================== */

/* 1) Center KPI text everywhere */
.card {
  text-align: center;
}
.card__label,
.card__value,
.card__hint {
  text-align: center !important;
}

/* dashboard had a forced left alignment earlier */
#dashboard-view .dashboard-cards .card--main,
#dashboard-view .dashboard-cards .card--kpi,
#dashboard-view .dashboard-cards--secondary .card {
  text-align: center !important;
}

/* Keep GOALS bars aligned nicely */
#card-goals .mini-bars,
#card-goals .mini-bar {
  text-align: left;
}
#card-goals .mini-bars { width: 100%; }

/* 2) Header branding: bigger logo + full motto (no truncation) */
header.topbar .brand__logo img{
  height: 56px !important;
  width: auto !important;
  max-width: 280px !important;
  object-fit: contain !important;
}

header.topbar .brand__sub{
  font-style: italic !important;
  font-size: 13.5px !important;
  line-height: 1.25 !important;

  /* show the whole motto */
  max-width: 640px !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

@media (max-width: 900px){
  header.topbar .brand__logo img{ height: 48px !important; }
  header.topbar .brand__sub{ max-width: 56vw !important; font-size: 13px !important; }
}

@media (max-width: 720px){
  header.topbar .brand__logo img{ height: 42px !important; }
  header.topbar .brand__sub{ max-width: 66vw !important; font-size: 12px !important; }
}

/* ===== Settings: compact + aerisit ===== */
#settings-view .two-col{
  grid-template-columns:repeat(auto-fit,minmax(320px,1fr));
  gap:12px;
  margin-top:10px;
}
#settings-view .panel{
  margin-top:0;
  padding:12px;
}
#settings-view .panel__header{ margin-bottom:8px; }
#settings-view .panel__header h3{ font-size:15px; }
#settings-view input,#settings-view .select{ padding:8px 10px; }
#settings-view .btn{ padding:var(--btn-py) var(--btn-px); min-height:var(--btn-h); }
#settings-view .view__header{ margin-bottom:10px; }
#settings-view .form-grid{ gap:10px; }
#settings-view .form-actions{ gap:8px; }
#settings-view .muted.small{ font-size:12px; }

/* ===== Goals + Settings: narrower panels (more PWA-friendly) ===== */
#goals-view,
#settings-view{
  display:flex;
  flex-direction:column;
  align-items:center;
}

/* Goals: form/list doesn't need full width on desktop */
#goals-view > .panel{ width:min(980px, 100%); }
#goals-view #goalsTable th,
#goals-view #goalsTable td{ text-align:center; }
/* Settings: keep page wide, but cards centered and not overly stretched */
#settings-view > .two-col,
#settings-view > .panel{ width:min(1100px, 100%); }

/* ==================================================
   HEADER BRAND CENTER + COMPACT (V2)
   - logo + titlu + motto centrate deasupra taburilor
   - topbar mai mic (fara a mari fundalul alb)
================================================== */
header.topbar .topbar__inner{
  position: relative !important;
  justify-content: center !important;
  padding: 10px 20px 6px !important;
  gap: 8px !important;
}

header.topbar .brand{
  margin: 0 auto !important;
  max-width: calc(100% - 360px) !important;
}

header.topbar .brand__logo img{
  height: 56px !important;
  width: auto !important;
  max-width: 260px !important;
}

header.topbar .brand__text{
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  line-height: 1.12 !important;
}

header.topbar .brand__title{
  font-weight: 900 !important;
  letter-spacing: .2px !important;
  font-size: 18px !important;
  line-height: 1.1 !important;
}

header.topbar .brand__sub{
  font-style: italic !important;
  font-size: 13.5px !important;
  line-height: 1.2 !important;
  margin-top: 2px !important;
  max-width: 720px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* actiuni in dreapta, fara sa impinga brandul din centru */
header.topbar .topbar__right{
  position: absolute !important;
  right: 20px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  margin-left: 0 !important;
}

/* Tabs: integrate in acelasi header (fara bara/"card" separat sub tabs) */
header.topbar .tabs{
  padding: 0 !important;
  margin-top: 6px !important;
  margin-bottom: 0 !important;
}

@media (max-width: 900px){
  header.topbar .brand{ max-width: 100% !important; }
  header.topbar .brand__logo img{ height: 50px !important; }
  header.topbar .brand__sub{ white-space: normal !important; overflow: visible !important; text-overflow: clip !important; max-width: 66vw !important; }
  header.topbar .topbar__right{
    position: static !important;
    transform: none !important;
    width: 100% !important;
    justify-content: flex-end !important;
    margin-left: auto !important;
    padding-top: 4px;
  }
  header.topbar .topbar__inner{
    flex-wrap: wrap !important;
    justify-content: center !important;
    padding: 10px 14px 6px !important;
  }
}

/* =========================
   Account dropdown (Topbar)
   ========================= */
.account{position:relative}
.account__btn{
  display:flex;align-items:center;gap:10px;
  padding:8px 10px;
  border:1px solid var(--border);
  background:linear-gradient(180deg, rgba(255,255,255,.78), rgba(255,255,255,.70));
  border-radius:14px;
  box-shadow:var(--shadow2);
  cursor:pointer;
}
.account__btn:focus{outline:none; box-shadow:var(--ring);}
.account__avatar{
  width:34px;height:34px;border-radius:999px;
  background:var(--blue-soft);
  color:#1e3a8a;
  display:flex;align-items:center;justify-content:center;
  font-weight:900;
  position:relative;
  overflow:hidden;
}
.account__avatar-img{width:100%;height:100%;object-fit:cover;display:block}
.account__avatar-img.is-hidden{display:none}
.account__avatar-initial{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}
.account__avatar-initial.is-hidden{display:none}
.account__meta{display:flex;flex-direction:column;line-height:1.1;text-align:left;min-width:0}
.account__title{font-weight:900;font-size:13px}
.account__email{font-size:12px;color:var(--muted);font-weight:700;max-width:190px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.account__chev{margin-left:4px;color:var(--muted);font-size:12px}

.account__menu{
  position:absolute;right:0;top:calc(100% + 10px);
  width:300px;
  background:linear-gradient(180deg, rgba(255,255,255,.82), rgba(255,255,255,.74));
  backdrop-filter:saturate(160%) blur(12px);
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow:var(--shadow2);
  padding:10px;
  z-index:60;
}
.account__menu-head{padding:8px 10px}
.account__menu-title{font-weight:900}
.account__menu-email{color:var(--muted);font-weight:700;font-size:13px;margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.menu-sep{height:1px;background:rgba(0,0,0,0.06);margin:8px 0}
.menu-section__title{display:flex;align-items:center;gap:10px;padding:6px 10px;color:var(--muted);font-weight:900;font-size:12px}

.menu-item{
  width:100%;
  display:flex;align-items:center;gap:10px;
  padding:10px 10px;
  border-radius:12px;
  border:0;
  background:transparent;
  cursor:pointer;
  font-weight:800;
  font-size:14px;
  text-align:left;
}
.menu-item:hover{background:rgba(79,70,229,.07)}
.menu-item .ico{display:inline-flex;align-items:center;justify-content:center;color:inherit}
.menu-item .ico svg{width:18px;height:18px;fill:currentColor}
.menu-check{margin-left:auto;opacity:0;font-weight:900}
.menu-item.is-selected .menu-check{opacity:1}

.menu-item--danger{color:#dc2626}
.menu-item--danger:hover{background:rgba(220,38,38,0.08)}

@media(max-width:720px){
  .account__meta{display:none}
  .account__btn{padding:8px}
  .account__menu{width:min(300px, calc(100vw - 24px))}
}

/* iPad/iPhone: when Account menu is open, prevent overlap confusion with tabs */
@media (max-width:1024px){
  html.account-open .tabs{opacity:0; pointer-events:none;}
}

/* ===== Admin Panel (owner) ===== */

/* Keep header on a single clean row on desktop; allow wrap on small screens */
.admin-header{align-items:center; flex-wrap:wrap;}
.admin-header__left{
  flex:1 1 auto;
  min-width:0; /* allow ellipsis */
}
.admin-header__left .muted{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.admin-header__right{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
}

@media (min-width: 721px){
  .admin-header{flex-wrap:nowrap;}
  .admin-header__right{flex-wrap:nowrap;}
  .pill-tabs{flex-wrap:nowrap;}
}

/* Tablet/iPad: allow wrap + horizontal tab scroll (avoid overflow / overlapping) */
@media (max-width: 1024px){
  .admin-header{flex-wrap:wrap; align-items:flex-start;}
  .admin-header__right{width:100%; justify-content:flex-start;}
  .pill-tabs{
    flex-wrap:nowrap;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    padding-bottom:4px;
    max-width:100%;
  }
  .pill-tabs::-webkit-scrollbar{display:none}
  .pill-tab{flex:0 0 auto; white-space:nowrap;}

  .panel__header{flex-wrap:wrap; align-items:flex-start;}
  .panel__actions{flex-wrap:wrap; width:100%; justify-content:flex-start;}
  .panel__actions .input{flex:1 1 220px; min-width:220px;}
}

/* Phone: actions become full-width to prevent overlap */
@media (max-width: 520px){
  .panel__actions .btn,
  .panel__actions .input{flex:1 1 100%; width:100%}
}

/* Admin content: stack the two columns on tablets to keep cards inside viewport */
@media (max-width: 980px){
  #admin-view .two-col{grid-template-columns:1fr}
}

/* Tables: keep inside cards on PWA (scroll horizontally instead of overflowing) */
.table-wrap{overflow-x:auto; max-width:100%; -webkit-overflow-scrolling:touch;}
#admin-view .table th,
#admin-view .table td{white-space:nowrap;}
#admin-view .table-wrap .table{min-width:860px;}

@media (max-width: 720px){
  .admin-header{align-items:flex-start}
  .admin-header__left{width:100%}
  .admin-header__right{width:100%; justify-content:flex-start}
  .admin-header__left .muted{white-space:normal; overflow:visible; text-overflow:clip;}
}

.pill-tabs{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.pill-tab{
  border:1px solid var(--btn-border);
  background:var(--btn-bg);
  border-radius:10px;
  padding:7px 12px;
  font-weight:800;
  cursor:pointer;
  display:flex;
  gap:8px;
  align-items:center;
  min-height:36px;
  box-shadow:var(--btn-shadow);
}
.pill-tab:hover{background:var(--btn-bg-hover); border-color:rgba(15,23,42,.24);}
.pill-tab.is-active{
  background:linear-gradient(180deg, rgba(239,246,255,.94), rgba(219,234,254,.84));
  border-color:rgba(37,99,235,.34);
  color:#1d4ed8;
  box-shadow:0 6px 16px rgba(37,99,235,.12);
}
.pill-badge{
  min-width:22px;
  height:22px;
  padding:0 8px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  font-weight:900;
  background:rgba(0,0,0,.06);
  color:var(--text);
}
.pill-tab.is-active .pill-badge{background:rgba(37,99,235,.12);color:#1d4ed8}

.admin-tab{margin-top:12px}
.admin-tab.is-hidden{display:none}

/* ==================================================
   HEADER CLEAN (no background slab under title/tabs)
   ================================================== */
/* Force-remove any "glass" slab behind header/title/tabs. */
.topbar::before,
header.topbar::before,
.topbar::after,
header.topbar::after{display:none !important; content:none !important;}
header.topbar,
.topbar{background:transparent !important; backdrop-filter:none !important;}
header.topbar .tabs,
header.topbar nav.tabs,
header.topbar .tabs.bs-tabs{
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  backdrop-filter:none !important;
}

.invite-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px}

.admin-audit-filters{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  padding:12px 0 6px;
}
.admin-audit-filters .input{min-width:220px;flex:1}
.admin-audit-filters .select{min-width:160px}

.input--search{min-width:240px}

.table .btn{padding:6px 11px;border-radius:9px;min-height:32px}
.table .btn.btn--primary{box-shadow:0 1px 2px rgba(37,99,235,.10)}

/* Admin PWA: avoid cards spilling outside viewport (tables scroll inside cards) */
.table-wrap{max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch;}
.table-wrap::-webkit-scrollbar{height:10px}

/* Scope the "no-wrap" behaviour to admin tables only */
#admin-view .table th,
#admin-view .table td{white-space:nowrap;}

/* Ensure admin tables have a natural minimum width, but stay contained */
#admin-view .table-wrap .table{min-width:860px;}

/* Admin layout: stacked cards, centered (PWA) */
#admin-view{display:flex; flex-direction:column; align-items:center;}
#admin-view .admin-header,
#admin-view .admin-tab{max-width:1100px; width:100%; margin-left:auto; margin-right:auto;}

/* Admin header: keep everything visually centered on desktop & mobile */
#admin-view .admin-header{width:100%; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding-left:0; padding-right:0;}
#admin-view .admin-header__left{align-items:center;}
#admin-view .admin-header__right{justify-content:center; width:100%;}
#admin-view .admin-cards{
  display:flex;
  flex-direction:column;
  gap:14px;
  margin-top:14px;
  width:100%;
  max-width:1000px;
  margin-left:auto;
  margin-right:auto;
}

/* Admin: keep same compact button system as the rest of the app */
#admin-view .btn{border-radius:var(--btn-radius); padding:var(--btn-py) var(--btn-px); min-height:var(--btn-h);}
#admin-view .table .btn{border-radius:9px; padding:6px 11px; min-height:32px;}


/* iPad/phone: stack the two admin cards (Invites / Users) to prevent squeeze */
@media (max-width: 980px){
  #admin-view .two-col{grid-template-columns:1fr;}
}

/* Profile view */
#profile-view{display:flex;flex-direction:column;align-items:center;}
.profile-layout{
  display:grid;
  /* 2-col layout: keep cards aligned, 50/50 split */
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  grid-template-rows:1fr 1fr;
  gap:10px;
  align-items:stretch;
  margin-top:12px;
  width:100%;
  max-width:1120px;
  margin-left:auto;
  margin-right:auto;
  padding-left:12px;
  padding-right:12px;
}
.profile-panel{grid-row:1 / span 2}
.profile-export{grid-column:2;grid-row:1}
.profile-danger{grid-column:2;grid-row:2}
.profile-layout .panel{margin-top:0}
.profile-panel{display:flex;flex-direction:column}
.profile-panel .profile-grid-wrap{flex:1}
/* Keep 2 columns on larger tablets (landscape). */
@media (max-width: 980px){
  .profile-layout{grid-template-columns:1fr;grid-template-rows:auto}
  .profile-panel{grid-row:auto}
  .profile-export{grid-column:auto;grid-row:auto}
  .profile-danger{grid-column:auto;grid-row:auto}
}

/* Profile actions (Export/Import + Danger) should wrap nicely inside their cards */
.profile-export .form-actions{justify-content:flex-start;flex-wrap:wrap}
.profile-export .form-actions .file{display:inline-flex;align-items:center}
.profile-export .form-actions .btn,
.profile-export .form-actions .file .btn{white-space:nowrap}
.profile-danger .form-actions{flex-wrap:wrap}

@media (max-width: 520px){
  .profile-export .form-actions > .btn,
  .profile-export .form-actions > .file,
  .profile-danger .form-actions > .btn{flex:1 1 100%}
  .profile-export .form-actions .file .btn,
  .profile-export .form-actions > .btn,
  .profile-danger .form-actions > .btn{width:100%;justify-content:center}
}

.profile-panel__header{display:flex;flex-direction:column;align-items:stretch;gap:6px;margin-bottom:6px}
.profile-panel__head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.profile-email-head{display:flex;flex-direction:column;gap:2px}
.profile-panel__actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.profile-save-status{min-height:16px;align-self:flex-end;text-align:right}

/* Profile avatar (local) */
.profile-avatar-row{
  display:flex;
  align-items:center;
  gap:14px;
  padding:4px 0 14px;
  margin-bottom:12px;
  border-bottom:1px solid rgba(0,0,0,0.06);
}
.profile-avatar-preview{
  width:56px;height:56px;border-radius:999px;
  background:var(--blue-soft);
  display:flex;align-items:center;justify-content:center;
  position:relative;overflow:hidden;
  flex:0 0 auto;
}
.profile-avatar-preview img{width:100%;height:100%;object-fit:cover;display:block}
.profile-avatar-fallback{font-weight:900;color:#1e3a8a}
.profile-avatar-meta{min-width:0;display:flex;flex-direction:column;gap:6px;flex:1}
.profile-avatar-title{font-weight:900}
.profile-avatar-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
@media (max-width: 520px){
  .profile-avatar-row{align-items:flex-start}
  .profile-avatar-actions > .btn,
  .profile-avatar-actions > .file{flex:1 1 100%}
  .profile-avatar-actions .file .btn,
  .profile-avatar-actions > .btn{width:100%;justify-content:center}
}

/* Keep the Profile content visually centered horizontally, but avoid vertical centering
   that creates a large empty area above the fields. */
.profile-grid-wrap{display:flex;align-items:flex-start;justify-content:flex-start;min-height:100%;padding-top:6px}

.profile-grid{display:flex;flex-direction:column;gap:12px;max-width:720px;margin:0;width:100%}
.profile-email{font-weight:900;font-size:18px;padding:6px 0}
.profile-preview{font-weight:900;font-size:20px;padding:6px 0;line-height:1.2}
.profile-value{font-weight:800;font-size:16px;padding:6px 0}

/* Small */
.small{font-size:12px}

@media(max-width:720px){
  .admin-audit-filters .select{min-width:140px}
  .admin-audit-filters .input{min-width:180px}
}

.admin-tab.is-hidden{display:none}
.row-actions{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap;margin-top:8px}

/* =======================
   Fear & Greed card (SAFE)
   - No conic-gradient, no page-level side effects
   ======================= */
/* Fear & Greed widget (Alternative.me-like, SAFE) */
.fng.fng--widget{display:flex;flex-direction:column;gap:10px;margin-top:6px}
.fng__nowblock{display:flex;flex-direction:column;gap:2px}
.fng__nowlabel{font-size:14px;color:var(--muted)}
.fng__nowvalue{font-weight:900;font-size:20px;line-height:1.1}
.fng__gaugewrap{position:relative;display:flex;justify-content:center;align-items:center;padding:4px 0 0}
.fng__svg{max-width:320px;height:auto;display:block}
.fng__bubble{position:absolute;left:18px;top:26px;width:44px;height:44px;border-radius:999px;display:flex;align-items:center;justify-content:center;font-weight:900;font-size:16px;background:#f3f4f6;color:#111827;border:1px solid #e5e7eb;box-shadow:0 6px 18px rgba(15,23,42,.06)}
.fng__footer{display:flex;justify-content:space-between;gap:12px;font-size:12px;margin-top:2px}

/* sentiment coloring (match Alternative.me feel) */
#card-fng.fng--fear .fng__nowvalue{color:#d97706}
#card-fng.fng--greed .fng__nowvalue{color:#16a34a}
#card-fng.fng--neutral .fng__nowvalue{color:#334155}


/* --- Fear & Greed (compact size + centered, matches other KPI cards) --- */
#card-fng .fng.fng--widget{gap:6px;margin-top:2px}
#card-fng .fng__nowblock{align-items:center;text-align:center}
#card-fng .fng__nowlabel{font-size:12px}
#card-fng .fng__nowvalue{font-size:18px}
#card-fng .fng__gaugewrap{padding:0;margin-top:2px}
#card-fng .fng__svg{max-width:220px}
#card-fng .fng__bubble{
  left:10px;
  top:52%;
  transform:translateY(-50%);
  width:36px;height:36px;
  font-size:13px;
}
#card-fng .fng__footer{margin-top:0;font-size:11px}
@media (max-width: 520px){
  #card-fng .fng__svg{max-width:200px}
  #card-fng .fng__bubble{left:8px;width:34px;height:34px}
}


/* === Fear & Greed (dashboard - stable) ===
   Render the value bubble inside the SVG (no absolute positioning drift).
   Keep the widget compact so row-2 height is driven by GOALS (not F&G).
*/
#card-fng .fng.fng--widget{gap:4px !important;margin-top:2px !important;}
#card-fng .fng__gaugewrap{height:auto !important;padding:0 !important;margin-top:0 !important;}
#card-fng .fng__svg{max-width:190px !important;height:80px !important;width:100% !important;display:block;margin:0 auto;}
#card-fng #fngBubble{filter:drop-shadow(0 6px 16px rgba(15,23,42,.08));}
#card-fng .fng__footer{margin-top:-2px !important;font-size:10px !important;line-height:1.1;}

/* === Row 2 (Dashboard): MATCH GOALS height (stretch in grid) ===
   Goal is the tallest card; the other 3 should fill the same row height.
*/
#dashboard-view .dashboard-cards--secondary{
  align-items: stretch !important;
}
#dashboard-view .dashboard-cards--secondary > .card{
  height: 100% !important;
}
/* Ensure any previous flex-centering hacks don't force extra height */
#dashboard-view #card-dca-streak,
#dashboard-view #card-avg-fee,
#dashboard-view #card-fng{
  display:flex !important;
  flex-direction:column;
}


/* Row 2: make KPI cards look "full" while still matching GOALS height */
#dashboard-view #card-fng .fng__footer{
  margin-top:auto !important;
}

/* Center content in simple KPI cards (keep Goals/Fear&Greed custom layouts) */
#dashboard-view #card-value,
#dashboard-view #card-pnl,
#dashboard-view #card-invested,
#dashboard-view #card-fees,
#dashboard-view #card-dca-streak,
#dashboard-view #card-avg-fee{
  display:flex !important;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  text-align:center;
}
#dashboard-view #card-value .card__label,
#dashboard-view #card-pnl .card__label,
#dashboard-view #card-invested .card__label,
#dashboard-view #card-fees .card__label,
#dashboard-view #card-dca-streak .card__label,
#dashboard-view #card-avg-fee .card__label{
  width:100%;
  justify-content:center;
  text-align:center;
}
#dashboard-view #card-value .card__hint,
#dashboard-view #card-pnl .card__hint,
#dashboard-view #card-invested .card__hint,
#dashboard-view #card-fees .card__hint,
#dashboard-view #card-dca-streak .card__hint,
#dashboard-view #card-avg-fee .card__hint{
  width:100%;
  text-align:center;
}

/* DCA card: current month status */
#dashboard-view #card-dca-streak .dca-month-status{
  margin-top:6px;
  font-weight:800;
  font-size:13px;
  text-align:center;
}
#dashboard-view #card-dca-streak .dca-month-status.is-yes{color:#166534;}
#dashboard-view #card-dca-streak .dca-month-status.is-no{color:#b91c1c;}
#dashboard-view #card-dca-streak .dca-month-meta{
  margin-top:2px;
  font-size:12px;
  opacity:.9;
  text-align:center;
}

/* ==================================================
   PREMIUM REDESIGN v2 (2026-01-18)
   - lighter surfaces for cards
   - custom checkboxes in tables
   - tighter, more premium action blocks
================================================== */

/* Lighter surfaces (subtle) */
.panel,
.card{
  background:linear-gradient(180deg, var(--panel-2), var(--panel-3));
}

/* Keep wallpaper visible behind cards (views must stay transparent) */
.view{background:transparent !important;}
/* Table checkboxes (avoid affecting custom switch) */
.table input[type="checkbox"]{
  -webkit-appearance:none;
  appearance:none;
  width:18px;
  height:18px;
  border-radius:6px;
  border:1px solid rgba(15,23,42,.18);
  background:linear-gradient(180deg, rgba(255,255,255,.88), rgba(255,255,255,.80));
  box-shadow:0 1px 0 rgba(15,23,42,.04), 0 6px 16px rgba(15,23,42,.06);
  display:inline-grid;
  place-items:center;
  cursor:pointer;
  transition:background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .06s ease;
}
.table input[type="checkbox"]:hover{
  border-color:rgba(79,70,229,.38);
  box-shadow:0 0 0 4px rgba(79,70,229,.08);
}
.table input[type="checkbox"]:active{transform:scale(.98)}
.table input[type="checkbox"]:focus-visible{
  outline:none;
  box-shadow:var(--ring);
  border-color:rgba(79,70,229,.45);
}
.table input[type="checkbox"]:checked{
  background:linear-gradient(135deg, var(--blue), var(--cyan));
  border-color:transparent;
  box-shadow:0 10px 24px rgba(79,70,229,.18);
}
.table input[type="checkbox"]:checked::after{
  content:"";
  width:9px;
  height:5px;
  border-left:2px solid #fff;
  border-bottom:2px solid #fff;
  transform:rotate(-45deg);
  margin-top:-1px;
}

/* Icon action blocks (Profile / Settings): premium spacing + consistent height */
.iconbtn{
  min-height:var(--btn-h);
  padding:var(--btn-py) var(--btn-px);
  border-radius:var(--btn-radius);
  justify-content:center;
  width:auto;
}
.iconbtn--neutral{
  background:var(--btn-bg);
  border-color:var(--btn-border);
  color:var(--btn-text);
}
.iconbtn--green{
  background:linear-gradient(180deg, rgba(244,253,248,.92), rgba(224,247,236,.84));
  border-color:rgba(22,163,74,.24);
  color:#166534;
}
.iconbtn--blue{
  background:linear-gradient(180deg, rgba(247,250,255,.92), rgba(232,240,254,.84));
  border-color:rgba(37,99,235,.24);
  color:#1e40af;
}
.iconbtn--danger{
  background:linear-gradient(180deg, rgba(254,245,245,.84), rgba(254,235,235,.74));
  border-color:rgba(220,38,38,.22);
  color:#b91c1c;
}
.profile-icon-actions .btn{
  width:auto;
}

/* Date inputs: align baseline & keep premium focus */
input[type="date"].input{
  padding-right:10px;
}


/* ICON SYSTEM (premium consistency) */
.tab .ico svg{width:18px;height:18px;}
.tab{font-weight:800;}
.tab:not(.is-active) .ico{color:rgba(15,23,42,.65);} 
.tab:not(.is-active):hover .ico{color:var(--blue-2);} 
.btn .ico{margin-right:8px;}
.btn .ico svg{width:18px;height:18px;}
.icon-btn .ico{margin:0;}

/* =========================
   ICON CONSISTENCY (vNext)
   ========================= */
.ico{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}
.ico svg{width:18px;height:18px;display:block;fill:currentColor;vertical-align:-0.12em}
.tab .ico svg{width:18px;height:18px}
.btn .ico svg{width:18px;height:18px}
.icon-btn svg{opacity:1;fill:currentColor}
.menu-item .ico svg{opacity:1;fill:currentColor}







/* GOALS card label centered (Dashboard) */
#card-goals .card__label{justify-content:center; text-align:center;}

/* Analysis/Summary: hide SVG metric icons (emoji-only labels) */
#analysis-view .card__label .metric-ico{display:none !important;}



/* =========================
   VIEW HEADERS - remove legacy titles/subtitles strip
   (keep functional controls like currency toggle & filters)
   ========================= */
.view__header{
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  padding:0 6px;
}

/* Hide legacy view titles/subtitles (top nav already indicates page) */
.view__header > h2,
.view__header > .muted,
.view__header > div > h2,
.view__header > div > .muted{display:none !important;}

/* =========================================================
   WALLPAPER UNDER CARDS â€“ continuous background (SAFE)
   Goal: the page wallpaper should be visible BETWEEN cards,
   as if the wallpaper is one single layer under everything.
   ========================================================= */

/* More breathing room so wallpaper is visible between cards */
.grid.cards{ gap:16px; }
@media(max-width:1100px){ .grid.cards{ gap:14px; } }
@media(max-width:720px){ .grid.cards{ gap:12px; } }

/* Make cards slightly more translucent so wallpaper subtly shows through */
.card{
  background:linear-gradient(180deg, rgba(255,255,255,.76), rgba(255,255,255,.64));
}

/* Dashboard main card: remove the grey-ish overlay so it matches the rest */
#dashboard-view .dashboard-cards .card--main{
  background:linear-gradient(180deg, rgba(255,255,255,.78), rgba(255,255,255,.66)) !important;
}

/* Settings: make rate row compact (avoid oversized empty space) */
#settings-view #rateForm{grid-template-columns:minmax(220px,340px) auto;}
#settings-view #rateInput{max-width:340px;}

#analysis-view .view__header{ padding:0; }


/* Analysis toolbar polish */
#analysis-view .view__header{ padding:0; margin-bottom:10px; }
/* ANALIZA: keep year/asset/PDF controls clean (no toolbar background) and centered */
#analysis-view .view__header{ justify-content:center; }
#analysis-view .view__actions.analysis-controls{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  width:100%;
  padding:0;
  border:none;
  background:transparent;
  box-shadow:none;
  backdrop-filter:none;
}
#analysis-view .view__actions.analysis-controls .select{ min-width:140px; }

/* ==================================================
   Transactions Toolbar + Action Buttons (Premium)
================================================== */
#transactions-view #txToolbar .toolbar__right{
  gap:8px;
  align-items:center;
}
#transactions-view #txToolbar .toolbar__right .btn{
  min-height:var(--btn-h);
  padding:var(--btn-py) var(--btn-px);
}

/* Table row actions: same compact system */
#transactions-view .tx-actions .icon-btn{
  width:34px;
  height:34px;
  border-radius:9px;
}

@media (max-width: 880px){
  #transactions-view #txToolbar .toolbar__right .btn{
    min-height:34px;
    padding:6px 10px;
  }
  #transactions-view .tx-actions .icon-btn{
    width:32px;
    height:32px;
  }
}

/* ==================================================
   UNIFIED BUTTONS (premium clean compact)
   Single visual language for .btn / .iconbtn / .icon-btn
================================================== */
.btn,
.iconbtn{
  min-height:34px;
  padding:6px 12px;
  border-radius:10px;
  border:1px solid rgba(15,23,42,.14);
  background:linear-gradient(180deg, rgba(255,255,255,.82), rgba(248,250,252,.74));
  color:#0f172a;
  font-weight:700;
  box-shadow:0 1px 2px rgba(15,23,42,.06);
}
.btn:hover,
.iconbtn:hover{
  background:linear-gradient(180deg, rgba(255,255,255,.90), rgba(241,245,249,.82));
  border-color:rgba(15,23,42,.20);
  box-shadow:0 3px 8px rgba(15,23,42,.08);
}
.btn:active,
.iconbtn:active{transform:translateY(1px);}

.btn:focus-visible,
.iconbtn:focus-visible,
.icon-btn:focus-visible{
  outline:none;
  box-shadow:0 0 0 3px rgba(15,23,42,.12);
}

.btn:disabled,
.iconbtn:disabled,
.icon-btn:disabled{
  opacity:.54;
  cursor:not-allowed;
  box-shadow:none;
  transform:none;
}

.btn--primary,
.iconbtn--blue,
.icon-btn--primary,
#settings-view .icon-btn--primary,
#goals-view .icon-btn--primary{
  background:linear-gradient(180deg, rgba(247,250,255,.88), rgba(238,244,255,.80));
  border-color:rgba(59,130,246,.26);
  color:#1d4ed8;
}
.btn--primary:hover,
.iconbtn--blue:hover,
.icon-btn--primary:hover,
#settings-view .icon-btn--primary:hover,
#goals-view .icon-btn--primary:hover{
  background:linear-gradient(180deg, rgba(243,248,255,.92), rgba(231,240,255,.84));
  border-color:rgba(59,130,246,.34);
}

.btn--soft,
.iconbtn--neutral,
.icon-btn--soft,
#settings-view .icon-btn--soft,
#goals-view .icon-btn--soft{
  background:linear-gradient(180deg, rgba(250,252,255,.86), rgba(244,247,252,.78));
  border-color:rgba(100,116,139,.26);
  color:#334155;
}
.btn--soft:hover,
.iconbtn--neutral:hover,
.icon-btn--soft:hover,
#settings-view .icon-btn--soft:hover,
#goals-view .icon-btn--soft:hover{
  background:linear-gradient(180deg, rgba(247,250,255,.90), rgba(238,243,250,.82));
  border-color:rgba(100,116,139,.34);
}

.btn--danger,
.iconbtn--danger,
.icon-btn--danger{
  background:linear-gradient(180deg, rgba(254,246,246,.84), rgba(254,237,237,.76));
  border-color:rgba(220,38,38,.24);
  color:#b91c1c;
}
.btn--danger:hover,
.iconbtn--danger:hover,
.icon-btn--danger:hover{
  background:linear-gradient(180deg, rgba(254,241,241,.88), rgba(254,230,230,.80));
  border-color:rgba(220,38,38,.34);
}

.iconbtn--green{
  background:linear-gradient(180deg, rgba(244,253,248,.84), rgba(234,250,242,.76));
  border-color:rgba(22,163,74,.24);
  color:#166534;
}
.iconbtn--green:hover{
  background:linear-gradient(180deg, rgba(240,252,246,.88), rgba(227,248,238,.80));
  border-color:rgba(22,163,74,.32);
}

.icon-btn{
  width:32px;
  height:32px;
  border-radius:10px;
  border:1px solid rgba(15,23,42,.14);
  background:linear-gradient(180deg, rgba(255,255,255,.84), rgba(248,250,252,.76));
  color:#334155;
  box-shadow:0 1px 2px rgba(15,23,42,.06);
}
.icon-btn:hover{
  box-shadow:0 3px 8px rgba(15,23,42,.08);
}

.profile-icon-actions .btn,
#transactions-view #txToolbar .toolbar__right .btn{
  min-height:34px;
}

/* ==================================================
   HEADER CONTROLS (Account + Language) - unified
================================================== */
.account__btn{
  min-height:34px;
  padding:6px 10px;
  border-radius:12px;
  border:1px solid rgba(15,23,42,.14);
  background:linear-gradient(180deg, rgba(255,255,255,.84), rgba(248,250,252,.76));
  box-shadow:0 1px 2px rgba(15,23,42,.06);
  transition:background .14s ease, border-color .14s ease, box-shadow .14s ease, transform .06s ease;
}
.account__btn:hover{
  background:linear-gradient(180deg, rgba(255,255,255,.90), rgba(241,245,249,.82));
  border-color:rgba(15,23,42,.20);
  box-shadow:0 3px 8px rgba(15,23,42,.08);
}
.account__btn:active{transform:translateY(1px);}
.account__btn:focus-visible{
  outline:none;
  box-shadow:0 0 0 3px rgba(15,23,42,.12);
}
.account__btn:focus:not(:focus-visible){
  outline:none;
  box-shadow:0 1px 2px rgba(15,23,42,.06);
}
.account__btn[aria-expanded="true"]{
  border-color:rgba(79,70,229,.30);
  background:linear-gradient(180deg, rgba(255,255,255,.92), rgba(239,246,255,.78));
  box-shadow:0 7px 18px rgba(79,70,229,.12), 0 1px 2px rgba(15,23,42,.06);
}

.account__avatar{
  width:32px;
  height:32px;
  background:linear-gradient(180deg, rgba(79,70,229,.16), rgba(6,182,212,.12));
  color:#1e3a8a;
  box-shadow:inset 0 0 0 1px rgba(79,70,229,.18);
}

.account__menu{
  border-radius:18px;
  border-color:rgba(15,23,42,.10);
  background:linear-gradient(180deg, rgba(255,255,255,.92), rgba(248,252,255,.84));
  box-shadow:0 24px 56px rgba(15,23,42,.14), 0 6px 18px rgba(15,23,42,.08);
}
.account__menu-head{
  padding:12px 14px 10px;
}
.account__menu-title{
  font-size:15px;
  letter-spacing:0;
}
.account__menu-email{
  margin-top:4px;
  font-size:12px;
}
.menu-sep{
  background:rgba(15,23,42,.07);
  margin:9px 4px;
}
.account__menu .menu-item{
  min-height:42px;
  padding:9px 12px;
  border-radius:14px;
  color:#0f172a;
}
.account__menu .menu-item .ico{
  width:28px;
  height:28px;
  flex:0 0 28px;
  border-radius:10px;
  color:#475569;
  background:rgba(15,23,42,.045);
}
.account__menu .menu-item .ico svg{
  width:16px;
  height:16px;
}
.account__menu .menu-item:hover{
  background:rgba(79,70,229,.07);
}
.menu-item--lang,
.menu-item--currency{
  min-height:56px !important;
  background:linear-gradient(180deg, rgba(255,255,255,.68), rgba(248,250,252,.52)) !important;
  border:1px solid rgba(15,23,42,.07);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.70);
}
.menu-item--lang + .menu-item--currency{
  margin-top:8px;
}
.menu-item--lang > span:not(.ico),
.menu-item--currency > span:not(.ico){
  font-size:14px;
  font-weight:900;
}

.menu-item--lang .lang-toggle{
  margin-left:auto;
  display:inline-flex;
  align-items:center;
  gap:3px;
  padding:2px;
  border:1px solid rgba(15,23,42,.14);
  background:linear-gradient(180deg, rgba(255,255,255,.84), rgba(248,250,252,.76));
  border-radius:999px;
  box-shadow:0 1px 2px rgba(15,23,42,.06);
}
.menu-item--lang .lang-btn{
  border:1px solid transparent;
  background:transparent;
  color:#64748b;
  padding:5px 8px;
  border-radius:999px;
  min-width:32px;
  transition:background .14s ease, color .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.menu-item--lang .lang-btn:hover{
  background:rgba(15,23,42,.05);
  color:#334155;
}
.menu-item--lang .lang-btn.is-selected{
  background:rgba(255,255,255,.92);
  color:#0f172a;
  border-color:rgba(15,23,42,.14);
  box-shadow:0 1px 2px rgba(15,23,42,.06);
}
.menu-item--currency .currency-toggle{
  min-height:32px;
  padding:3px 6px;
  gap:5px;
  background:linear-gradient(180deg, rgba(255,255,255,.92), rgba(248,250,252,.82));
  border-color:rgba(15,23,42,.12);
  box-shadow:0 1px 3px rgba(15,23,42,.07);
}
.menu-item--currency .currency-toggle__label{
  min-width:28px;
  font-size:11px;
  font-weight:800;
}
.menu-item--currency .currency-toggle.is-ron .currency-toggle__label--ron,
.menu-item--currency .currency-toggle.is-usd .currency-toggle__label--usd{
  color:#1e293b;
}
.menu-item--lang .lang-btn:focus-visible{
  outline:none;
  box-shadow:0 0 0 2px rgba(15,23,42,.12);
}

/* ==================================================
   BUTTON MICRO-TUNING (dense zones + unified hover)
================================================== */
#transactions-view #txToolbar .toolbar__right .btn,
#admin-view .admin-header__right .btn,
#admin-view .panel__actions .btn,
#admin-view .admin-audit-filters .btn,
#profile-view .profile-icon-actions .btn{
  min-height:32px;
  padding:5px 11px;
  border-radius:9px;
  font-size:13px;
  line-height:1.05;
}

#transactions-view .tx-actions .icon-btn,
#admin-view .table .icon-btn{
  width:30px;
  height:30px;
  border-radius:9px;
}

@media (max-width: 880px){
  #transactions-view #txToolbar .toolbar__right .btn,
  #admin-view .admin-header__right .btn,
  #admin-view .panel__actions .btn,
  #admin-view .admin-audit-filters .btn{
    min-height:31px;
    padding:5px 10px;
  }
  #transactions-view .tx-actions .icon-btn,
  #admin-view .table .icon-btn{
    width:29px;
    height:29px;
  }
}

/* Lock hover border behavior so variants look from the same family */
.btn:hover,
.iconbtn:hover,
.icon-btn:hover{
  border-width:1px;
  border-style:solid;
}
.btn:hover,
.iconbtn:hover{
  border-color:rgba(15,23,42,.22);
}
.btn--primary:hover,
.iconbtn--blue:hover,
.icon-btn--primary:hover,
#settings-view .icon-btn--primary:hover,
#goals-view .icon-btn--primary:hover{
  border-color:rgba(59,130,246,.34);
}
.btn--soft:hover,
.iconbtn--neutral:hover,
.icon-btn--soft:hover,
#settings-view .icon-btn--soft:hover,
#goals-view .icon-btn--soft:hover{
  border-color:rgba(100,116,139,.34);
}
.btn--danger:hover,
.iconbtn--danger:hover,
.icon-btn--danger:hover{
  border-color:rgba(220,38,38,.34);
}
.iconbtn--green:hover{
  border-color:rgba(22,163,74,.32);
}

/* ==================================================
   CONTROL ALIGNMENT (inputs/selects with button system)
================================================== */
#transactions-view #txToolbar .input,
#transactions-view #txToolbar .select,
#transactions-view #txToolbar input[type="date"].input,
#admin-view .panel__actions .input,
#admin-view .panel__actions .select,
#admin-view .admin-audit-filters .input,
#admin-view .admin-audit-filters .select,
#settings-view #rateForm .input{
  min-height:32px;
  padding:5px 10px;
  border-radius:9px;
  border:1px solid rgba(15,23,42,.14);
  background:linear-gradient(180deg, rgba(255,255,255,.86), rgba(248,250,252,.78));
}

#transactions-view #txToolbar .field label,
#admin-view .admin-audit-filters label{
  font-size:11px;
  font-weight:700;
  letter-spacing:.01em;
}

#transactions-view #txToolbar{
  padding:9px 10px;
}
#transactions-view #txToolbar .toolbar__left,
#transactions-view #txToolbar .toolbar__right{
  gap:7px;
}

#admin-view .panel__actions{
  gap:8px;
}
#admin-view .admin-header__right{
  gap:8px;
}

/* Better icon optical balance in compact buttons */
#transactions-view .tx-actions .icon-btn svg,
#admin-view .table .icon-btn svg{
  width:15px;
  height:15px;
}

@media (max-width: 880px){
  #transactions-view #txToolbar .input,
  #transactions-view #txToolbar .select,
  #transactions-view #txToolbar input[type="date"].input,
  #admin-view .panel__actions .input,
  #admin-view .panel__actions .select,
  #admin-view .admin-audit-filters .input,
  #admin-view .admin-audit-filters .select,
  #settings-view #rateForm .input{
    min-height:31px;
    padding:5px 9px;
  }
  #transactions-view #txToolbar .field label{
    font-size:10.5px;
  }
}

/* ==================================================
   BUTTON TONE POLISH (same structure, calmer premium tones)
================================================== */
.btn--primary,
.iconbtn--blue,
.icon-btn--primary,
#settings-view .icon-btn--primary,
#goals-view .icon-btn--primary{
  background:linear-gradient(180deg, rgba(246,249,255,.86), rgba(236,243,255,.78));
  border-color:rgba(59,130,246,.22);
  color:#1e40af;
}
.btn--primary:hover,
.iconbtn--blue:hover,
.icon-btn--primary:hover,
#settings-view .icon-btn--primary:hover,
#goals-view .icon-btn--primary:hover{
  background:linear-gradient(180deg, rgba(243,247,255,.90), rgba(231,240,255,.82));
  border-color:rgba(59,130,246,.30);
  box-shadow:0 2px 7px rgba(37,99,235,.08);
}

.btn--soft,
.iconbtn--neutral,
.icon-btn--soft,
#settings-view .icon-btn--soft,
#goals-view .icon-btn--soft{
  background:linear-gradient(180deg, rgba(251,253,255,.86), rgba(245,248,252,.78));
  border-color:rgba(100,116,139,.24);
  color:#334155;
}
.btn--soft:hover,
.iconbtn--neutral:hover,
.icon-btn--soft:hover,
#settings-view .icon-btn--soft:hover,
#goals-view .icon-btn--soft:hover{
  background:linear-gradient(180deg, rgba(248,251,255,.90), rgba(241,246,251,.82));
  border-color:rgba(100,116,139,.30);
}

.btn--danger,
.iconbtn--danger,
.icon-btn--danger{
  background:linear-gradient(180deg, rgba(254,248,248,.84), rgba(252,240,240,.76));
  border-color:rgba(220,38,38,.22);
  color:#b42318;
}
.btn--danger:hover,
.iconbtn--danger:hover,
.icon-btn--danger:hover{
  background:linear-gradient(180deg, rgba(254,244,244,.88), rgba(251,235,235,.80));
  border-color:rgba(220,38,38,.30);
  box-shadow:0 2px 7px rgba(220,38,38,.08);
}

.iconbtn--green{
  background:linear-gradient(180deg, rgba(246,253,249,.84), rgba(237,250,243,.76));
  border-color:rgba(22,163,74,.22);
  color:#166534;
}
.iconbtn--green:hover{
  background:linear-gradient(180deg, rgba(242,252,247,.88), rgba(232,248,240,.80));
  border-color:rgba(22,163,74,.30);
  box-shadow:0 2px 7px rgba(22,163,74,.08);
}

/* ==================================================
   NAV TONE POLISH (top tabs + admin pills)
================================================== */
.tab{
  border:1px solid transparent;
  transition:transform .12s ease, background .14s ease, box-shadow .14s ease, border-color .14s ease, color .14s ease;
}
.tab:hover{
  background:rgba(15,23,42,.05);
  border-color:rgba(15,23,42,.10);
}
.tab.is-active{
  background:linear-gradient(180deg, rgba(247,250,255,.88), rgba(236,243,255,.80));
  border:1px solid rgba(59,130,246,.24);
  color:#1e40af;
  box-shadow:0 2px 8px rgba(37,99,235,.08);
  transform:none;
}
.tab.is-active .ico{
  color:#1d4ed8;
}
.tab:focus-visible{
  outline:none;
  box-shadow:0 0 0 3px rgba(15,23,42,.12);
}

.pill-tab{
  border-color:rgba(15,23,42,.14);
  background:linear-gradient(180deg, rgba(255,255,255,.82), rgba(248,250,252,.74));
}
.pill-tab:hover{
  background:linear-gradient(180deg, rgba(255,255,255,.90), rgba(241,245,249,.82));
  border-color:rgba(15,23,42,.20);
  box-shadow:0 3px 8px rgba(15,23,42,.08);
}
.pill-tab.is-active{
  background:linear-gradient(180deg, rgba(246,249,255,.88), rgba(236,243,255,.80));
  border-color:rgba(59,130,246,.26);
  color:#1e40af;
  box-shadow:0 2px 8px rgba(37,99,235,.08);
}
.pill-tab.is-active .pill-badge{
  background:rgba(59,130,246,.12);
  color:#1e40af;
}

/* ==================================================
   SETTINGS: actions bottom-right + compact rate field
================================================== */
#settings-view #ratePanel,
#settings-view #pricesPanel{
  min-height:170px;
  display:flex;
  flex-direction:column;
}

#settings-view #ratePanel #rateForm{
  display:flex;
  flex-direction:column;
  gap:10px;
  flex:1 1 auto;
}

#settings-view #ratePanel #rateForm .field{
  max-width:170px;
}

#settings-view #ratePanel #rateInput{
  width:100%;
  max-width:120px;
}

#settings-view #ratePanel #rateForm .form-actions{
  margin-top:auto;
  width:100%;
  justify-content:flex-end;
  align-items:flex-end;
}

#settings-view #pricesPanel .form-actions{
  margin-top:auto;
  justify-content:flex-end;
  align-items:flex-end;
}

#settings-view #ratePanel #rateStatus,
#settings-view #pricesPanel #pricesStatus{
  margin:2px 0 0;
}

@media (max-width: 900px){
  #settings-view #ratePanel,
  #settings-view #pricesPanel{
    min-height:unset;
  }
  #settings-view #ratePanel #rateForm .field{
    max-width:100%;
  }
  #settings-view #ratePanel #rateInput{
    max-width:100%;
  }
}

/* ==================================================
   ADMIN: premium ultra-compact
================================================== */
#admin-view .view__header.admin-header{
  margin-bottom:8px;
}

#admin-view .admin-header__left .muted{
  font-size:13px;
}

#admin-view .admin-header__right{
  gap:8px;
}

#admin-view .pill-tabs{
  gap:6px;
}

#admin-view .pill-tab{
  min-height:32px;
  padding:5px 10px;
  border-radius:9px;
}

#admin-view .pill-badge{
  min-width:20px;
  height:20px;
  font-size:11px;
  padding:0 7px;
}

#admin-view .admin-tab{
  margin-top:8px;
}

#admin-view .panel{
  margin-top:0;
  padding:10px;
}

#admin-view .panel__header{
  margin-bottom:6px;
}

#admin-view .panel__body{
  padding-top:4px;
}

/* Users + Invites side-by-side on desktop for denser layout */
#adminTabUsers .admin-cards{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
  align-items:stretch;
  max-width:1100px;
}

#adminTabUsers .admin-cards > .panel{
  min-width:0;
}

#admin-view .admin-audit-filters{
  padding:6px 0 4px;
  gap:8px;
}

#admin-view .admin-audit-filters .input,
#admin-view .admin-audit-filters .select{
  min-height:32px;
  padding:5px 9px;
  border-radius:9px;
}

#admin-view .input--search{
  min-width:180px;
}

#admin-view .table th{
  font-size:11px;
  padding:7px 8px;
}

#admin-view .table td{
  padding:7px 8px;
  font-size:13px;
}

#admin-view .row-actions{
  display:flex;
  gap:6px;
  margin-top:4px;
}

#admin-view .row-actions .btn{
  min-height:30px;
  padding:4px 9px;
  border-radius:8px;
}

/* Users panel as compact list (instead of wide table) */
#adminUsersList{
  display:flex;
  flex-direction:column;
  gap:7px;
  margin-top:8px;
}

.admin-user-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  grid-template-rows:auto auto;
  gap:6px 10px;
  align-items:center;
  padding:8px 10px;
  border:1px solid rgba(15,23,42,.10);
  border-radius:10px;
  background:linear-gradient(180deg, rgba(255,255,255,.68), rgba(248,250,252,.60));
}

.admin-user-main{
  min-width:0;
}

.admin-user-name{
  font-size:15px;
  font-weight:900;
  line-height:1.2;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.admin-user-email{
  margin-top:2px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.admin-user-meta{
  grid-column:1 / 2;
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}

.admin-user-pill{
  display:inline-flex;
  align-items:center;
  min-height:22px;
  padding:0 8px;
  border-radius:999px;
  border:1px solid rgba(15,23,42,.10);
  background:rgba(255,255,255,.65);
}

.admin-user-actions{
  grid-column:2 / 3;
  grid-row:1 / 3;
  display:flex;
  gap:6px;
  align-items:center;
}

.admin-user-actions .btn{
  min-height:29px;
  padding:4px 9px;
  border-radius:8px;
}

/* Invite panel: ultra compact */
#admin-view .panel--invites .panel__body{
  padding-top:1px;
  display:grid;
  grid-template-columns:auto minmax(220px, 300px);
  column-gap:8px;
  row-gap:5px;
  align-items:center;
}

#admin-view .panel--invites .muted.small{
  font-size:11px;
  line-height:1.2;
}

#admin-view .panel--invites .panel__body > .invite-actions{
  grid-column:1 / 2;
  gap:5px;
  margin-top:0;
  align-items:center;
}

#admin-view .panel--invites .panel__body > .invite-actions .btn{
  min-height:28px;
  height:28px;
  padding:3px 9px;
  border-radius:8px;
  font-size:13px;
}

#admin-view .panel--invites .admin-invite-link-row{
  grid-column:2 / 3;
  margin-top:0;
}

#admin-view .panel--invites #adminInviteLink{
  min-height:28px;
  height:28px;
  width:100%;
  max-width:260px;
  padding:3px 9px;
  border-radius:9px;
  font-size:11.5px;
}

#admin-view .panel--invites .admin-invites-block{
  grid-column:1 / -1;
  margin-top:4px;
}

#adminInvitesList{
  display:flex;
  flex-direction:column;
  gap:2px;
  margin-top:3px;
  max-height:260px;
  overflow:auto;
  padding-right:1px;
}

.invite-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:4px;
  padding:2px 7px;
  border:1px solid rgba(15,23,42,.10);
  border-radius:7px;
  background:linear-gradient(180deg, rgba(255,255,255,.66), rgba(248,250,252,.60));
}

.invite-row .invite-meta{
  min-width:0;
}

.invite-row .invite-meta--list{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
  white-space:nowrap;
}

.invite-row .invite-code{
  font-size:12.5px;
  line-height:1;
  font-weight:900;
  letter-spacing:.01em;
  flex:0 0 auto;
}

.invite-row .invite-used-email{
  min-width:0;
  max-width:280px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:10.5px;
  line-height:1.1;
  color:var(--muted);
  font-weight:700;
}

.invite-row .invite-date{
  margin-left:auto;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:10px;
  color:var(--muted);
  font-weight:600;
}

.invite-row .invite-actions{
  grid-column:2 / 3;
  justify-self:end;
  display:flex;
  align-items:center;
  flex-wrap:nowrap;
  margin-top:0;
  gap:0;
}

.invite-row .invite-actions .btn{
  min-height:22px;
  height:22px;
  padding:0 8px;
  border-radius:7px;
  font-size:11px;
}

#admin-view .panel--invites .admin-invites-kpi{
  grid-column:1 / -1;
  margin-top:4px;
}

/* Deploy details tighter */
#admin-view #adminDeployResult{
  max-height:190px !important;
  padding:8px !important;
  border-radius:9px !important;
  font-size:12px;
}

@media (max-width: 980px){
  #adminTabUsers .admin-cards{
    grid-template-columns:1fr;
  }
  #admin-view .panel--invites .panel__body{
    grid-template-columns:1fr;
    row-gap:6px;
  }
  #admin-view .panel--invites .panel__body > .invite-actions,
  #admin-view .panel--invites .admin-invite-link-row{
    grid-column:1 / -1;
  }
  #admin-view .panel--invites #adminInviteLink{
    max-width:100%;
  }
  .invite-row{
    grid-template-columns:1fr auto;
  }
  #adminInvitesList{
    max-height:235px;
  }
  .admin-user-row{
    grid-template-columns:1fr;
    grid-template-rows:auto auto auto;
  }
  .admin-user-actions{
    grid-column:1 / 2;
    grid-row:auto;
    justify-content:flex-start;
    flex-wrap:wrap;
  }
}

/* ==================================================
   TRANSACTIONS: ultra compact
================================================== */
#transactions-view .panel{
  padding:6px;
}

#transactions-view #txToolbar{
  padding:4px 5px;
  gap:4px;
}

#transactions-view #txToolbar .toolbar__left,
#transactions-view #txToolbar .toolbar__right{
  gap:4px;
}

#transactions-view #txToolbar .field{
  margin:0;
}

#transactions-view #txToolbar .field label{
  font-size:9.5px;
  margin-bottom:1px;
  letter-spacing:.01em;
  line-height:1.1;
}

#transactions-view #txToolbar .input,
#transactions-view #txToolbar .select,
#transactions-view #txToolbar input[type="date"].input{
  min-height:28px;
  height:28px;
  padding:3px 7px;
  border-radius:7px;
  font-size:11.5px;
}

#transactions-view #txToolbar .btn{
  min-height:28px;
  height:28px;
  padding:3px 8px;
  border-radius:7px;
  font-size:11.5px;
}

#transactions-view #txToolbar #txSearch{
  width:188px;
}

#transactions-view #txToolbar #txFilterAsset{
  width:96px;
}

#transactions-view #txToolbar #txFilterStart,
#transactions-view #txToolbar #txFilterEnd{
  width:112px;
}

#transactions-view #txCountLabel{
  font-size:11px;
  white-space:nowrap;
}

#transactions-view .table-wrap{
  margin-top:4px;
}

#txTable thead th{
  padding:6px 6px;
  font-size:11px;
  line-height:1.15;
}

#txTable tbody td{
  padding:6px 6px;
  font-size:11.5px;
  line-height:1.2;
  vertical-align:middle;
}

#txTable tbody td .muted{
  font-size:10.5px;
}

#txTable .col-check{
  width:30px;
}

#transactions-view .tx-actions{
  gap:4px;
}

#transactions-view .tx-actions .icon-btn{
  width:24px;
  height:24px;
  border-radius:7px;
}

#transactions-view .tx-actions .icon-btn svg{
  width:13px;
  height:13px;
}

@media (max-width: 980px){
  #transactions-view #txToolbar #txSearch{
    width:162px;
  }
  #transactions-view #txToolbar #txFilterStart,
  #transactions-view #txToolbar #txFilterEnd{
    width:108px;
  }
}

@media (max-width: 760px){
  #transactions-view .panel{
    padding:6px;
  }
  #transactions-view #txToolbar{
    padding:5px;
  }
  #transactions-view #txToolbar .btn,
  #transactions-view #txToolbar .input,
  #transactions-view #txToolbar .select,
  #transactions-view #txToolbar input[type="date"].input{
    min-height:27px;
    height:27px;
    font-size:11px;
  }
  #txTable thead th,
  #txTable tbody td{
    padding:6px 5px;
    font-size:11px;
  }
}

/* ==================================================
   TRANSACTIONS: Add/Edit modal (compact premium)
================================================== */
#txModal .modal__card--wide{
  max-width:800px;
  width:calc(100% - 28px);
  padding:12px 12px 10px;
  border-radius:16px;
}

#txModal .modal__title{
  margin-bottom:6px;
  align-items:center;
}

#txModal .modal__title h3{
  font-size:18px;
  letter-spacing:.01em;
}

#txModal #editModeLabel{
  margin-top:1px;
  font-size:11px;
}

#txModal .tx-modal__close{
  min-width:34px;
  width:34px;
  height:34px;
  padding:0;
  border-radius:10px;
  font-size:18px;
  line-height:1;
}

#txModal .tx-form{
  --txFormColW: 228px;
  grid-template-columns:repeat(3,minmax(0,var(--txFormColW)));
  gap:6px 10px;
  align-items:start;
  justify-content:center;
}

#txModal .tx-form .field{
  gap:4px;
  max-width:var(--txFormColW);
}

#txModal .tx-form .field label{
  font-size:11px;
  letter-spacing:.01em;
}

#txModal .tx-form .input,
#txModal .tx-form .select{
  min-height:40px;
  height:40px;
  padding:8px 11px;
  border-radius:11px;
  border-color:rgba(15,23,42,.12);
  background:linear-gradient(180deg, rgba(255,255,255,.88), rgba(248,250,252,.80));
}

#txModal .tx-form .muted.small{
  font-size:11px;
  line-height:1.25;
}

#txModal .tx-field--qty{
  grid-column:1;
  max-width:var(--txFormColW) !important;
}

#txModal .tx-form-actions{
  grid-column:2 / span 2;
  align-self:start;
  justify-content:flex-end;
  margin-top:20px;
  gap:8px;
  max-width:none;
  width:auto;
}

#txModal .tx-form-actions .btn{
  min-height:40px;
  border-radius:11px;
  padding:8px 14px;
  min-width:126px;
}

@media (max-width: 1100px){
  #txModal .modal__card--wide{
    max-width:900px;
  }
  #txModal .tx-form{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  #txModal .tx-form .field,
  #txModal .tx-form-actions{
    max-width:none;
  }
  #txModal .tx-field--qty{
    grid-column:1 / -1;
    max-width:none !important;
  }
  #txModal .tx-form-actions{
    grid-column:1 / -1;
    justify-content:flex-end;
    margin-top:2px;
  }
}

@media (max-width: 760px){
  #txModal .modal__card--wide{
    width:calc(100% - 14px);
    padding:10px;
    border-radius:14px;
  }
  #txModal .tx-form{
    grid-template-columns:1fr;
    gap:7px;
  }
  #txModal .tx-form-actions{
    grid-column:1;
    justify-content:stretch;
    gap:6px;
  }
  #txModal .tx-form-actions .btn{
    width:100%;
    min-width:0;
    min-height:38px;
  }
}

/* ==================================================
   OPTIMIZE: ultra compact
================================================== */
#optimize-view{
  gap:8px;
}

#optimize-view .view__header{
  margin-bottom:8px;
}

#optimize-view .view__header h2{
  font-size:22px;
}

#optimize-view .view__header .muted{
  font-size:12px;
}

#optimize-view .panel{
  margin-top:8px;
  padding:9px;
}

#optimize-view .panel__header{
  margin-bottom:5px;
  gap:6px;
}

#optimize-view .panel__header h3{
  font-size:15px;
  line-height:1.2;
}

#optimize-view .panel__header .muted.small{
  font-size:12px;
}

#optimize-view .form-grid{
  gap:8px;
}

#optimize-view #optCalcGrid{
  width:100%;
  max-width:336px;
  margin-inline:auto;
  grid-template-columns:repeat(2,minmax(0,1fr));
}

#optimize-view #optCalcGrid .field{
  min-width:0;
}

#optimize-view #optQuickCalcPanel{
  --optQuickRowHeight: 110px;
  display:grid;
  grid-template-columns:minmax(300px,360px) minmax(0,1fr);
  grid-template-areas:
    "header header"
    "calc cards";
  gap:6px 10px;
  align-items:start;
}

#optimize-view #optQuickCalcPanel .panel__header{
  grid-area:header;
  justify-content:flex-start;
  margin-bottom:0;
}

#optimize-view #optQuickCalcPanel .panel__header h3{
  text-align:left;
}

#optimize-view #optQuickCalcPanel #optCalcGrid{
  grid-area:calc;
  max-width:none;
  margin:0;
  min-height:var(--optQuickRowHeight);
  padding:5px 7px;
  border:1px solid rgba(15,23,42,.10);
  border-radius:10px;
  background:linear-gradient(180deg, rgba(255,255,255,.62), rgba(248,250,252,.54));
}

#optimize-view #optQuickCalcPanel .grid.cards{
  grid-area:cards;
  margin-top:0 !important;
  gap:6px;
  grid-template-columns:repeat(4,minmax(0,1fr));
  justify-content:stretch;
  align-self:start;
}

#optimize-view #optQuickCalcPanel .card{
  padding:6px 7px;
  min-height:var(--optQuickRowHeight);
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}

#optimize-view #optQuickCalcPanel .card__label{
  font-size:10px;
}

#optimize-view #optQuickCalcPanel .card__value{
  margin-top:1px;
  font-size:15px;
}

#optimize-view #optQuickCalcPanel .card__hint{
  margin-top:1px;
  font-size:9.5px;
}

@media (max-width: 1180px){
  #optimize-view #optQuickCalcPanel{
    display:block;
  }
  #optimize-view #optQuickCalcPanel .panel__header{
    justify-content:center;
    margin-bottom:4px;
  }
  #optimize-view #optQuickCalcPanel .panel__header h3{
    text-align:center;
  }
  #optimize-view #optQuickCalcPanel #optCalcGrid{
    max-width:336px;
    margin-inline:auto;
    min-height:auto;
  }
  #optimize-view #optQuickCalcPanel .grid.cards{
    margin-top:8px !important;
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  #optimize-view #optQuickCalcPanel .card{
    min-height:58px;
  }
}

#optimize-view .field label{
  font-size:11px;
  margin-bottom:3px;
}

#optimize-view .input,
#optimize-view .select{
  min-height:30px;
  height:30px;
  padding:4px 8px;
  border-radius:8px;
  font-size:12px;
}

#optimize-view .grid.cards{
  gap:8px;
  margin-top:6px;
}

#optimize-view .card{
  padding:10px;
  border-radius:12px;
}

#optimize-view .card__label{
  font-size:11px;
  gap:6px;
}

#optimize-view .card__value{
  font-size:18px;
  margin-top:4px;
}

#optimize-view .card__hint{
  margin-top:4px;
  font-size:11px;
}

#optimize-view .table-wrap{
  margin-top:5px;
}

#optimize-view .table th{
  padding:7px 8px;
  font-size:12px;
}

#optimize-view .table td{
  padding:7px 8px;
  font-size:12px;
}

#optimize-view #optRecentFeesPanel .panel__header{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

#optimize-view #optRecentFeesToggle{
  margin-left:auto !important;
  min-height:29px;
  height:29px;
  padding:4px 9px;
  border-radius:8px;
  font-size:12px;
}

/* Optimize tables: ultra compact (Sweet spots + Recent fees) */
#optimize-view #optSweetSpots,
#optimize-view #optRecentFeesTable{
  min-width:640px;
}

#optimize-view #optSweetSpotsPanel,
#optimize-view #optRecentFeesPanel{
  padding:8px 10px;
}

#optimize-view #optSweetSpotsPanel .panel__header,
#optimize-view #optRecentFeesPanel .panel__header{
  gap:6px;
  margin-bottom:1px;
}

#optimize-view #optSweetSpots th,
#optimize-view #optRecentFeesTable th{
  padding:4px 6px;
  font-size:10.5px;
  line-height:1.15;
  text-align:center;
  white-space:nowrap;
}

#optimize-view #optSweetSpots td,
#optimize-view #optRecentFeesTable td{
  padding:4px 6px;
  font-size:11px;
  line-height:1.16;
  text-align:center;
  white-space:nowrap;
}

#optimize-view #optSweetSpots tbody tr,
#optimize-view #optRecentFeesTable tbody tr{
  height:28px;
}

#optimize-view #optSweetSpotsPanel .panel__header h3,
#optimize-view #optRecentFeesPanel .panel__header h3{
  font-size:13px;
}

#optimize-view #optSweetSpotsPanel .panel__header .muted.small,
#optimize-view #optRecentFeesPanel .panel__header .muted.small{
  font-size:11px;
}

#optimize-view #optRecentFeesToggle{
  min-height:27px;
  height:27px;
  padding:3px 8px;
  border-radius:7px;
  font-size:11.5px;
}

#optimize-view #optRecentFeesPanel .table-wrap,
#optimize-view #optSweetSpotsPanel .table-wrap{
  margin-top:2px;
}

@media (max-width: 980px){
  #optimize-view .panel{
    padding:8px;
  }
  #optimize-view .grid.cards{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media (max-width: 760px){
  #optimize-view #optQuickCalcPanel #optCalcGrid{
    max-width:100%;
    margin-inline:0;
    padding:0;
    border:0;
    border-radius:0;
    background:transparent;
    grid-template-columns:1fr;
  }
  #optimize-view #optCalcGrid{
    max-width:100%;
    margin-inline:0;
    padding:0;
    border:0;
    border-radius:0;
    background:transparent;
    grid-template-columns:1fr;
  }
  #optimize-view .panel{
    padding:7px;
    margin-top:7px;
  }
  #optimize-view .view__header h2{
    font-size:20px;
  }
  #optimize-view .input,
  #optimize-view .select,
  #optimize-view #optRecentFeesToggle{
    min-height:29px;
    height:29px;
    font-size:11.5px;
  }
  #optimize-view .table th,
  #optimize-view .table td{
    padding:6px 7px;
    font-size:11.5px;
  }
  #optimize-view #optSweetSpots th,
  #optimize-view #optRecentFeesTable th{
    padding:4px 5px;
    font-size:10px;
  }
  #optimize-view #optSweetSpots td,
  #optimize-view #optRecentFeesTable td{
    padding:4px 5px;
    font-size:10.5px;
  }
  #optimize-view #optSweetSpots tbody tr,
  #optimize-view #optRecentFeesTable tbody tr{
    height:26px;
  }
}

/* ==================================================
   SUMMARY (analysis-view): ultra compact premium
================================================== */
#analysis-view{
  gap:8px;
}

#analysis-view .view__header{
  margin-bottom:7px;
}

#analysis-view .view__actions.analysis-controls{
  gap:6px;
}

#analysis-view .view__actions.analysis-controls .select,
#analysis-view #exportPdfBtn{
  min-height:30px;
  height:30px;
  padding:4px 9px;
  border-radius:8px;
  font-size:12px;
}

#analysis-view .view__actions.analysis-controls .select{
  min-width:118px;
}

#analysis-view #analysisHint{
  margin-top:5px;
  font-size:12px;
}

#analysis-view .panel{
  margin-top:8px;
  padding:8px;
}

#analysis-view .panel__header{
  margin-bottom:5px;
}

#analysis-view .panel__header h3{
  font-size:14px;
  line-height:1.2;
}

#analysis-view .grid.cards{
  gap:8px;
  margin-top:6px;
}

#analysis-view .card{
  padding:10px;
  border-radius:12px;
}

#analysis-view .card__label{
  font-size:11px;
  gap:6px;
}

/* Dashboard/KPI hover stability: avoid transform + backdrop-filter repaint flicker. */
.card,
.card:hover{
  transform:none !important;
}
.card{
  transition:box-shadow .16s ease, border-color .16s ease, background .16s ease !important;
}

#analysis-view .card__value{
  font-size:18px;
  margin-top:4px;
}

#analysis-view .card__hint{
  margin-top:4px;
  font-size:11px;
}

#analysis-view #analysisMonthlyPanel{
  margin-top:6px;
  padding:6px;
}

#analysis-view #analysisMonthlyPanel .table-wrap{
  margin-top:3px;
}

#analysis-view #monthlyTable{
  min-width:700px;
}

#analysis-view #monthlyTable th{
  padding:5px 6px;
  font-size:11px;
  line-height:1.15;
  white-space:nowrap;
}

#analysis-view #monthlyTable td{
  padding:5px 6px;
  font-size:11.5px;
  line-height:1.18;
  white-space:nowrap;
}

#analysis-view .two-col{
  gap:8px;
  margin-top:8px;
}

#analysis-view .chart{
  height:220px;
}

#analysis-view .chart--wide{
  height:250px;
}

@media (max-width: 980px){
  #analysis-view .panel{
    padding:7px;
  }
  #analysis-view .grid.cards{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media (max-width: 760px){
  #analysis-view .view__actions.analysis-controls .select,
  #analysis-view #exportPdfBtn{
    min-height:29px;
    height:29px;
    font-size:11.5px;
    padding:4px 8px;
  }
  #analysis-view #analysisHint{
    font-size:11.5px;
  }
  #analysis-view .panel{
    padding:6px;
    margin-top:7px;
  }
  #analysis-view #analysisMonthlyPanel{
    padding:5px;
  }
  #analysis-view #monthlyTable th{
    padding:5px 6px;
    font-size:10.5px;
  }
  #analysis-view #monthlyTable td{
    padding:5px 6px;
    font-size:11px;
  }
  #analysis-view .chart{
    height:200px;
  }
  #analysis-view .chart--wide{
    height:220px;
  }
}

