/* CG Capital HQ — fundația vizuală comună (culori calde, tipografie, componente de bază) */
@import url('../fonts/fonts.css');

:root {
  --bg: #0D0B0C; --bg-2: #121011; --surface: #171416; --surface-2: #1E1A1C; --surface-3: #262124;
  --glass: rgba(30, 26, 28, .62); --glass-2: rgba(39, 34, 37, .55);
  --line: rgba(199, 162, 150, .14); --line-2: rgba(242, 232, 223, .07);
  --text: #ECE7E3; --text-2: #C2B4BC; --text-3: #9A8D94; --text-4: #8E8188;
  --gold: #B78D80; --gold-2: #DEC4B6; --gold-3: #775247; --amber: #B98677; --copper: #AB8478;
  --c-hq: #B78D80; --c-finance: #3DB5AF; --c-tasks: #4D8CF5; --c-message: #9B74F8; --c-security: #F0645A;
  --pos: #4CC38A; --neg: #F0645A; --warn: #F2B84B; --info: #6AA8F7;
  --pos-t: #7BE0AE; --neg-t: #FF9B91; --warn-t: #F7CF7E; --info-t: #9CC6FF;   /* text pe fundal închis */
  --shadow: 0 18px 50px -18px rgba(0, 0, 0, .65), 0 2px 8px rgba(0, 0, 0, .25);
  --shadow-sm: 0 6px 18px -8px rgba(0, 0, 0, .55);
  --r: 18px; --r-sm: 12px; --r-xs: 8px;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Newsreader', Georgia, serif;
  --font-num: 'Inter Tight', 'Manrope', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: dark;
}
html[data-theme="day"] {
  --bg: #F1ECE8; --bg-2: #E7DEE3; --surface: #FDFAF8; --surface-2: #F6F1ED; --surface-3: #E8DEE4;
  --glass: rgba(252, 249, 246, .72); --glass-2: rgba(250, 245, 241, .6);
  --line: rgba(119, 82, 71, .18); --line-2: rgba(46, 29, 39, .08);
  --text: #241C21; --text-2: #43383E; --text-3: #62545C; --text-4: #74666E;
  --gold: #8C5F51; --gold-2: #7A5043; --gold-3: #5E3E34;
  /* culorile cu sens, închise la culoare ca să se citească pe fundal deschis (V1.1) */
  --pos: #1F8A57; --neg: #C23A2C; --warn: #B07408; --info: #2F67C4;
  --pos-t: #17734A; --neg-t: #A82E22; --warn-t: #7F5200; --info-t: #24529E;
  --shadow: 0 18px 50px -22px rgba(68, 48, 42, .35), 0 2px 8px rgba(68, 48, 42, .08);
  --shadow-sm: 0 6px 18px -10px rgba(68, 48, 42, .3);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--gold-2); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(183, 141, 128, .35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(183, 141, 128, .18); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(183, 141, 128, .32); }
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation-duration: .001s !important; transition-duration: .001s !important; }

/* ── componente ─────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 13.5px; cursor: pointer;
  transition: transform .18s var(--ease), background .2s, border-color .2s, box-shadow .2s; white-space: nowrap; }
.btn:hover { border-color: rgba(183, 141, 128, .35); background: var(--surface-3); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, #EAD3C6, #CBA79B 50%, #A98073); color: #2A1822; border: 0;
  box-shadow: 0 8px 24px -10px rgba(183, 141, 128, .8), inset 0 1px 0 rgba(255, 255, 255, .45); }
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 10px 30px -10px rgba(183, 141, 128, .95), inset 0 1px 0 rgba(255,255,255,.5); }
.btn.danger { background: rgba(240, 100, 90, .12); border-color: rgba(240, 100, 90, .35); color: var(--neg-t); }
.btn.danger:hover { background: rgba(240, 100, 90, .2); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 10px; }
.btn.icon { width: 40px; padding: 0; }
.btn.sm.icon { width: 32px; }
.btn svg { width: 17px; height: 17px; flex: none; }
.input, .select, .textarea { width: 100%; height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); outline: none; transition: border-color .2s, box-shadow .2s, background .2s; }
.textarea { height: auto; min-height: 90px; padding: 10px 14px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: rgba(183, 141, 128, .6); box-shadow: 0 0 0 4px rgba(183, 141, 128, .12); }
.input.mono { font-family: var(--font-mono); letter-spacing: .5px; }
.field { display: grid; gap: 6px; }
.field > label { font-size: 12px; font-weight: 700; color: var(--text-3); letter-spacing: .4px; text-transform: uppercase; }
.field .help { font-size: 12px; color: var(--text-3); }
.field .err { font-size: 12px; color: var(--neg-t); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 11.5px; font-weight: 700;
  background: var(--surface-3); color: var(--text-2); border: 1px solid var(--line-2); white-space: nowrap; }
.chip.gold { background: rgba(183, 141, 128, .14); color: var(--gold-2); border-color: rgba(183, 141, 128, .3); }
.chip.pos { background: rgba(76, 195, 138, .13); color: var(--pos-t); border-color: rgba(76, 195, 138, .3); }
.chip.neg { background: rgba(240, 100, 90, .13); color: var(--neg-t); border-color: rgba(240, 100, 90, .3); }
.chip.warn { background: rgba(242, 184, 75, .13); color: var(--warn-t); border-color: rgba(242, 184, 75, .3); }
.chip.info { background: rgba(106, 168, 247, .13); color: var(--info-t); border-color: rgba(106, 168, 247, .3); }
.switch { width: 44px; height: 26px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-3); position: relative; cursor: pointer; flex: none;
  transition: background .25s var(--ease); padding: 0; }
.switch i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-3); transition: transform .3s var(--spring), background .2s; }
.switch.on { background: linear-gradient(135deg, #B78D80, #906356); border-color: transparent; }
.switch.on i { transform: translateX(18px); background: #fff; }
.muted { color: var(--text-3); } .soft { color: var(--text-2); } .small { font-size: 12.5px; }
.mono { font-family: var(--font-mono); }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12.5px; color: #140E11;
  background: var(--av, #B78D80); flex: none; position: relative; box-shadow: inset 0 0 0 2px rgba(255,255,255,.18); }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; } .avatar.lg { width: 46px; height: 46px; font-size: 15px; }
.avatar .dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #554C51; border: 2px solid var(--surface); }
.avatar .dot.on { background: var(--pos); box-shadow: 0 0 8px rgba(76, 195, 138, .8); }
kbd { font-family: var(--font-mono); font-size: 11px; padding: 2px 6px; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--line-2); color: var(--text-2); }
.keybox { font-family: var(--font-mono); font-size: 15px; letter-spacing: 1px; padding: 12px 14px; border-radius: 12px; background: var(--bg-2);
  border: 1px dashed rgba(183, 141, 128, .45); color: var(--gold-2); user-select: all; word-break: break-all; }
.note { padding: 12px 14px; border-radius: 12px; font-size: 13px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2); }
.note.warn { border-color: rgba(242, 184, 75, .35); background: rgba(242, 184, 75, .08); color: var(--warn-t); }
.note.neg { border-color: rgba(240, 100, 90, .35); background: rgba(240, 100, 90, .08); color: var(--neg-t); }
.note.pos { border-color: rgba(76, 195, 138, .35); background: rgba(76, 195, 138, .08); color: var(--pos-t); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.2); border-top-color: var(--gold); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(183, 141, 128, .5); } 100% { box-shadow: 0 0 0 14px rgba(183, 141, 128, 0); } }
@keyframes shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%;
  animation: shimmer 1.4s infinite; border-radius: 10px; }

/* ── dialoguri + toast ──────────────────────────────────────────────── */
.scrim { position: fixed; inset: 0; background: rgba(7, 5, 6, .62); backdrop-filter: blur(6px); z-index: 900; animation: fadein .2s; }
.dialog { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 40px);
  overflow: auto; z-index: 901; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 24px;
  animation: dlg .35s var(--spring); }
.dialog.wide { width: min(760px, calc(100vw - 32px)); }
@keyframes dlg { from { opacity: 0; transform: translate(-50%, -46%) scale(.96); } to { opacity: 1; transform: translate(-50%, -50%); } }
.dialog h3 { margin: 0 0 6px; font-family: var(--font-display); font-weight: 500; font-size: 24px; }
.dialog .sub { color: var(--text-3); margin: 0 0 18px; font-size: 13.5px; }
.dialog .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.dialog .form { display: grid; gap: 14px; }
@keyframes toastin { from { opacity: 0; transform: translateX(40px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes toastout { to { opacity: 0; transform: translateX(40px) scale(.95); } }
