/* Paleta și spațierea din sheet-ul Dashboard INVEST */
:root {
  --page: #efefef;
  --graphite: #3f3f3f;
  --graphite-dark: #2e2e2e;
  --sage-dark: #4f6345;
  --sage: #7a8f68;
  --sage-light: #a3b18a;
  --pos-1: #e3ebd8;
  --pos-2: #bfd1a9;
  --neg-1: #f6dada;
  --neg-2: #e8a3a3;
  --loss: #c0392b;
  --gold: #b5912f;
  --ink: #1f1f1f;
  --muted: #5f5f5f;
  --line: #e2e2e2;
  --display: "Oswald", "Arial Narrow", sans-serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--sans); font-size: 14px; }
a { color: var(--sage-dark); }
.num { font-variant-numeric: tabular-nums; }

/* Layout */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 1 200px; max-width: 232px; background: var(--graphite-dark); color: #fff; padding: 24px 14px; display: flex; flex-direction: column; gap: 4px; }
.brand { font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: .04em; padding: 0 12px; }
.tag { font-size: 12px; color: #a9a9a9; padding: 0 12px 20px; }
.nav { display: block; padding: 10px 12px; border-radius: 6px; color: #e8e8e8; text-decoration: none; background: none; border: 0; text-align: left; font: inherit; cursor: pointer; }
.nav:hover { background: #525252; color: #fff; }
.nav.on { background: var(--sage); color: #fff; font-weight: 600; }
.nav[disabled] { color: #8a8a8a; cursor: default; background: none; }
.nav-sep { height: 1px; background: #474747; margin: 14px 12px; }
.side-foot { margin-top: auto; padding: 20px 12px 0; font-size: 12px; color: #a9a9a9; line-height: 1.6; }
.content { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }
.main { flex: 1; min-width: 0; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 760px) {
  /* pe telefon meniul devine un rând orizontal care defilează */
  .side { max-width: none; flex-basis: 100%; flex-direction: row; align-items: center; overflow-x: auto; padding: 10px 12px; }
  .brand { font-size: 18px; padding: 0 12px 0 4px; white-space: nowrap; }
  .tag, .nav-sep, .side-foot { display: none; }
  .nav { white-space: nowrap; padding: 8px 12px; }
  .main { padding: 20px 16px 40px; }
  h1.title { font-size: 40px; }
}

/* Antet */
.head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
h1.title { font-family: var(--display); font-size: 52px; line-height: .95; font-weight: 700; margin: 0; }
.sub { margin-top: 10px; font-size: 13px; color: var(--muted); }
.warn { color: var(--loss); font-weight: 600; }
.seg { display: inline-flex; border: 1px solid #c9c9c9; border-radius: 4px; overflow: hidden; }
.seg button { font: 600 13px var(--display); letter-spacing: .04em; min-height: 36px; padding: 0 14px; border: 0; background: #fff; color: var(--graphite); cursor: pointer; }
.seg button.on { background: var(--sage); color: #fff; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 8px; }
.kpi { min-height: 128px; padding: 18px 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; background: var(--graphite); color: #fff; }
.kpi.sage { background: var(--sage); }
.kpi .l { font-family: var(--display); font-size: 14px; font-weight: 600; letter-spacing: .06em; }
.kpi .m { font-family: var(--display); font-size: 27px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .s { font-family: var(--display); font-size: 18px; opacity: .9; font-variant-numeric: tabular-nums; }

/* Tabel poziții */
.positions { background: #fff; border: 1px solid #cfcfcf; overflow-x: auto; }
.group { display: flex; min-width: 1360px; border-bottom: 6px solid var(--page); }
.group-label { flex: 0 0 104px; background: var(--sage); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: .04em; padding: 8px; line-height: 1.1; }
.group-label small { font-family: var(--sans); font-size: 11px; font-weight: 500; margin-top: 6px; opacity: .85; }
table.t { border-collapse: collapse; table-layout: fixed; width: 100%; font-size: 12.5px; }
.t th { background: var(--graphite); color: #fff; font-family: var(--display); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; font-size: 11.5px; padding: 8px; text-align: right; }
.t td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.t .l { text-align: left; }
.t tr:hover td { background: #f7f9f4; }
.t td.sym { font-weight: 700; }
.t td.q { color: var(--muted); }
.t tr.tot td { background: var(--graphite); color: #fff; font-weight: 600; border-bottom: 0; }
.p1 { background: var(--pos-1); color: #2f4a25; }
.p2 { background: var(--pos-2); color: #1f3a17; font-weight: 600; }
.n1 { background: var(--neg-1); color: #9b2c2c; }
.n2 { background: var(--neg-2); color: #6e1c1c; font-weight: 600; }
.up { color: var(--sage-dark); }
.dn { color: var(--loss); }

/* Carduri */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; }
.card { background: #fff; border: 1px solid #dadada; padding: 20px; }
.card h2 { font-family: var(--display); font-weight: 700; font-size: 18px; text-transform: uppercase; margin: 0 0 14px; }
.mini { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.mini td { padding: 7px 8px; border-bottom: 1px solid #eaeaea; }
.mini td:last-child { text-align: right; }
.bar { position: relative; height: 14px; background: #ececec; border-radius: 2px; }
.bar .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; }
.alloc { display: flex; flex-direction: column; gap: 14px; }
.alloc .row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }

/* Login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login form { background: #fff; border: 1px solid #dadada; padding: 32px; width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; }
.login h1 { font-family: var(--display); font-size: 32px; margin: 0; }
.login-box { background: #fff; border: 1px solid #dadada; padding: 32px; width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; }
.login-box h1 { font-family: var(--display); font-size: 32px; margin: 0; }
.login-box p { margin: 0; }
.login input[readonly] { background: #f3f3f3; color: var(--muted); }
.login-note { margin: 0; line-height: 1.45; }
.login-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn.google { gap: 10px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
input { font: inherit; padding: 10px 12px; min-height: 44px; border: 1px solid #c9c9c9; border-radius: 4px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border: 0; border-radius: 4px; background: var(--graphite); color: #fff; font: 600 14px var(--sans); text-decoration: none; cursor: pointer; }
.err { color: var(--loss); font-size: 13px; }
.loading { padding: 40px; color: var(--muted); }

/* Pagina de instalare / verificare */
body.install main { max-width: 1100px; margin: 0 auto; padding: 32px 16px 60px; }
body.install h1 { font-family: var(--display); font-size: 40px; margin: 0 0 16px; }
body.install form { display: flex; flex-direction: column; gap: 14px; max-width: 360px; }
.ok { color: var(--sage-dark); font-weight: 700; }
.bad { color: var(--loss); font-weight: 700; }
.exp { color: var(--gold); font-weight: 700; }
.muted { color: var(--muted); }
table.v { border-collapse: collapse; width: 100%; background: #fff; font-size: 13px; font-variant-numeric: tabular-nums; }
table.v th { background: var(--graphite); color: #fff; text-align: left; padding: 7px 8px; font-weight: 600; }
table.v td { border-bottom: 1px solid var(--line); padding: 6px 8px; }
code { background: #e4e4e4; padding: 1px 5px; border-radius: 3px; }

/* Avertismente, stare goală, import */
.notice { background: #fbf3dc; border: 1px solid #e6cf8a; color: #5a4512; padding: 12px 14px; font-size: 13px; line-height: 1.5; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--sage-dark); text-decoration: underline; cursor: pointer; }
.card.empty { max-width: 560px; }
.card.empty p { line-height: 1.55; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.btn.ghost { background: #fff; color: var(--graphite); border: 1px solid var(--graphite); }
.btn[disabled] { opacity: .5; cursor: default; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; margin-top: 14px; }
label.check input { min-height: 0; width: 18px; height: 18px; }
input[type=file] { padding: 8px; background: #fafafa; }
.small { font-size: 12.5px; }
.mini.small td { padding: 5px 8px; }
.mini.errors td:first-child { white-space: nowrap; color: var(--loss); font-weight: 600; width: 1%; }
.card p { margin: 0 0 10px; }

/* Formulare */
select { font: inherit; padding: 10px 12px; min-height: 44px; border: 1px solid #c9c9c9; border-radius: 4px; background: #fff; width: 100%; min-width: 0; }
input { width: 100%; min-width: 0; }
label.check input { width: 18px; flex: none; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.inst-box { margin-top: 14px; padding: 14px; background: #f7f9f4; border: 1px solid var(--line); }
.note-field { margin-top: 14px; }
.linklike.danger { color: var(--loss); font-weight: 600; }
.tx-scroll { overflow-x: auto; }
table.t.tx-table { table-layout: auto; min-width: 900px; }
.tx-table td.q:last-of-type { max-width: 180px; }
.group-label { overflow-wrap: anywhere; }

/* Wizard */
.wiz { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 860px; }
.wiz-page { max-width: 924px; min-height: 100vh; margin: 0 auto; }
.wiz-first .sub { margin: 0; }
.steps { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.steps li { flex: 1 1 130px; padding: 9px 12px; background: #dfdfdf; color: var(--muted); font-family: var(--display); font-size: 14px; font-weight: 500; letter-spacing: .03em; }
.steps li.on { background: var(--sage); color: #fff; }
.steps li.done { background: var(--graphite); color: #fff; }
.rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.row-edit { display: flex; gap: 8px; align-items: center; }
.row-edit input { flex: 1; }
.row-edit.add { margin-top: 8px; }
.btn.icon { padding: 0; width: 44px; flex: none; font-size: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 14px; }
.chip { border: 1px solid var(--sage); background: #fff; color: var(--sage-dark); border-radius: 999px; padding: 6px 12px; font: 500 13px var(--sans); cursor: pointer; min-height: 32px; }
.chip:hover { background: var(--pos-1); }
.type-group { margin-top: 18px; }
.type-group h3 { font-family: var(--display); font-size: 15px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; margin: 0 0 6px; color: var(--sage-dark); }
.type-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(170px, 230px); gap: 10px; align-items: center; padding: 6px 8px; border-bottom: 1px solid #eee; min-height: 56px; }
.type-row.on { background: #f7f9f4; }
.type-row label.check { margin: 0; grid-column: 1; }
.type-row small { display: block; font-weight: 400; color: var(--muted); margin-top: 2px; }
.account-row { display: grid; grid-template-columns: minmax(160px, 2fr) minmax(90px, 1fr) minmax(130px, 1.4fr) 44px; gap: 8px; align-items: start; padding-bottom: 10px; border-bottom: 1px solid #eee; }
.account-row .btn.icon { margin-top: 22px; }
.account-row small { font-weight: 400; }
.wiz-nav { justify-content: flex-end; }
@media (max-width: 560px) {
  .type-row { grid-template-columns: minmax(0, 1fr); }
  .account-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .account-row label:first-child { grid-column: 1 / -1; }
  .account-row .btn.icon { margin-top: 0; }
}

/* Bara de sus */
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; min-height: 60px; padding: 10px 32px; background: #fff; border-bottom: 1px solid #dadada; }
.topbar-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.switch { display: flex; align-items: center; gap: 10px; min-width: 0; }
.switch-label { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-weight: 400; }
.switch-label span { font-size: 11px; color: var(--muted); }
.switch-label b { font-size: 14px; }
.switch-label select { min-height: 28px; padding: 2px 24px 2px 0; border: 0; background-color: transparent; font-weight: 600; max-width: 220px; cursor: pointer; }
.avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%; color: #fff; font-weight: 600; object-fit: cover; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid #c9c9c9; border-radius: 4px; background: #fff; color: var(--graphite); cursor: pointer; flex: none; }
.icon-btn:hover { background: #f3f3f3; }
.icon-btn.on { background: var(--sage); border-color: var(--sage); color: #fff; }
.user-menu { position: relative; min-width: 0; }
.user-btn { display: flex; align-items: center; gap: 10px; min-height: 44px; max-width: 240px; padding: 3px 6px; border: 0; border-radius: 4px; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.user-btn:hover { background: #f3f3f3; }
.user-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.user-text b, .user-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-text small { color: var(--muted); font-size: 12px; }
.menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 160px; padding: 4px; background: #fff; border: 1px solid #cfcfcf; box-shadow: 0 6px 18px rgba(0, 0, 0, .14); }
.menu button { display: block; width: 100%; min-height: 40px; padding: 8px 12px; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.menu button:hover { background: #f3f3f3; }
.notice.viewing { background: var(--pos-1); border-color: var(--sage-light); color: #2f4a25; }

/* Setări */
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack .actions, .stack label.check { margin-top: 0; }
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.sub-h { font-family: var(--display); font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; margin: 18px 0 6px; }
.people { display: flex; flex-direction: column; gap: 10px; }
.person { display: flex; align-items: center; gap: 10px; }
.person-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.card .ok, .card .err { margin: 10px 0 0; }
@media (max-width: 760px) {
  .topbar { padding: 8px 16px; }
}
