:root {
  --bg: #f4f4f2; --panel: #fff; --line: #e3e3e0; --line-2: #f0f0ed; --ink: #1d1d1f; --muted: #6b6b70;
  --soft: #7a7a80; --side: #17171a; --side-on: #2c2c33; --side-ink: #c9c9ce; --accent: #4f46e5;
  --accent-soft: #eef0ff; --red: #b42318; --green: #0f7a4a; --pink-bg: #fdf6f8; --pink: #9d174d;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Inter, system-ui, sans-serif; font-size: 13.5px; line-height: 1.45; color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
.ap { display: flex; min-height: 100vh; }

/* bara laterală */
.side { width: 220px; flex: none; background: var(--side); color: var(--side-ink); padding: 16px 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo { color: #fff; font-weight: 700; font-size: 15px; padding: 2px 10px 16px; letter-spacing: -.01em; }
.side .it { padding: 8px 10px; border-radius: 6px; display: flex; justify-content: space-between; align-items: center; }
.side .it:hover { background: #222228; color: #fff; }
.side .it.on { background: var(--side-on); color: #fff; }
.side .n { font-size: 11px; background: #3a3a44; color: #fff; padding: 0 7px; border-radius: 9px; }
.side .n.r { background: var(--red); }
.side .grp { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: #75757e; padding: 16px 10px 4px; }
.side .src { font-size: 11.5px; color: #9a9aa3; padding: 2px 10px; display: flex; justify-content: space-between; }
.side .src.vechi { color: #f97066; }

.main { flex: 1; min-width: 0; padding: 18px 22px 40px; }
.top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.top .d { font-size: 18px; font-weight: 650; white-space: nowrap; }
.top .d::first-letter { text-transform: uppercase; }
.ask { flex: 1; display: flex; gap: 6px; }
.ask input { flex: 1; }
.b, button.b { font: inherit; font-size: 12.5px; padding: 7px 12px; border-radius: 7px; background: var(--accent); color: #fff;
  border: 1px solid var(--accent); cursor: pointer; white-space: nowrap; }
.b.alb { background: #fff; color: var(--ink); border-color: #d9d9dd; }
.b.mic { padding: 3px 9px; font-size: 11.5px; }
.b:hover { filter: brightness(1.08); color: #fff; }
.b.alb:hover { color: var(--accent); }
input, select, textarea { font: inherit; font-size: 13px; padding: 7px 10px; border: 1px solid #d9d9dd; border-radius: 7px;
  background: #fff; color: var(--ink); min-width: 0; }
textarea { width: 100%; min-height: 70px; }
.raspuns { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 6px;
  padding: 10px 14px; margin: -4px 0 12px; white-space: pre-wrap; display: none; }

.chips { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { font-size: 11.5px; padding: 3px 10px; border-radius: 12px; background: #fff; border: 1px solid #dcdce0; }
.chip.on { background: var(--side); color: #fff; border-color: var(--side); }
.chip i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }

.brief { background: #fff; border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 4px; margin-bottom: 12px; }
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 12px; }
.k { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; }
.k .l { color: var(--muted); font-size: 11.5px; }
.k .v { font-size: 21px; font-weight: 650; margin: 2px 0; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.k .s { font-size: 11.5px; color: var(--soft); }
.up { color: var(--green); } .red { color: var(--red); font-weight: 600; }
.g3 { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.g2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px; margin-bottom: 12px; }
.g2e { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; min-width: 0; }
.box h4 { margin: 0 0 8px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.box h4 a { text-transform: none; letter-spacing: 0; color: var(--accent); font-weight: 500; }
h1 { font-size: 20px; margin: 0 0 14px; letter-spacing: -.01em; }
h3 { font-size: 14px; margin: 0 0 8px; }

.t { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.t:last-child { border-bottom: 0; }
.t .x { flex: 1; min-width: 0; }
.t .x .mu { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chk { width: 14px; height: 14px; border: 1.5px solid #9a9aa0; border-radius: 3px; flex: none; margin-top: 2px; background: #fff;
  cursor: pointer; padding: 0; }
.chk:hover { border-color: var(--green); background: #e7f6ee; }
.tag { font-size: 10.5px; padding: 1px 7px; border-radius: 9px; background: #ececea; color: #55555a; white-space: nowrap; }
.prop { background: var(--pink-bg); margin: 4px -8px 0; padding: 7px 8px; border-radius: 6px; }
.mini { font-size: 11px; color: var(--accent); margin-right: 8px; background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.ch { width: 18px; height: 18px; flex: none; text-align: center; font-size: 10px; font-weight: 700; border-radius: 4px; color: #fff; line-height: 18px; }
.wa { background: #25a35a; } .ml { background: var(--accent); } .ct { background: #e07a00; } .fm { background: #6b6b70; }
.cl { background: var(--pink); } .apl { background: #0e7490; }
.mu { color: var(--soft); font-size: 12px; }
.gol { color: var(--soft); font-size: 12.5px; padding: 8px 0; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th { text-align: left; font-weight: 500; color: var(--soft); padding: 4px 6px; border-bottom: 1px solid #ececea; }
td { padding: 5px 6px; border-bottom: 1px solid #f3f3f0; vertical-align: top; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr:hover td { background: #fafaf8; }
.kan { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.kc { background: #f6f6f4; border-radius: 6px; padding: 7px; min-width: 0; }
.kc .h { font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.card { display: block; background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 6px 8px; margin-bottom: 5px; font-size: 12px; }
.bar { display: flex; align-items: center; gap: 8px; margin: 5px 0; font-size: 12px; }
.bar .lb { width: 86px; color: #55555a; }
.bar .tr { flex: 1; background: #f0f0ed; border-radius: 3px; height: 14px; overflow: hidden; }
.bar .fl { display: block; height: 14px; border-radius: 3px; background: var(--accent); min-width: 2px; }
.bar .nv { width: 52px; text-align: right; font-variant-numeric: tabular-nums; }
.cols { display: flex; align-items: flex-end; gap: 8px; height: 100px; padding-top: 6px; }
.cols div { flex: 1; text-align: center; font-size: 10.5px; color: var(--soft); display: flex; flex-direction: column;
  justify-content: flex-end; height: 100%; }
.cols i { display: block; background: var(--accent); border-radius: 3px 3px 0 0; margin-bottom: 3px; min-height: 2px; }
.cols .now i { background: var(--green); }

.tabs { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs a { padding: 5px 11px; border-radius: 7px; border: 1px solid transparent; font-size: 12.5px; }
.tabs a.on { background: #fff; border-color: var(--line); font-weight: 600; }
.forma { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.inbox { display: grid; grid-template-columns: 320px 1fr 280px; gap: 12px; align-items: start; }
.inbox .lista { max-height: calc(100vh - 170px); overflow-y: auto; padding: 6px 10px; }
.inbox .lista .t.sel { background: var(--accent-soft); margin: 0 -6px; padding: 6px; border-radius: 6px; }
.mesaj { border-bottom: 1px solid var(--line-2); padding: 10px 0; }
.mesaj.out { padding-left: 24px; }
.mesaj .corp { white-space: pre-wrap; font-size: 13px; margin-top: 4px; max-height: 420px; overflow-y: auto; }
.rez { background: var(--accent-soft); border-radius: 6px; padding: 8px 10px; margin-bottom: 10px; }

dialog { border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; width: 440px; max-width: calc(100vw - 32px);
  box-shadow: 0 20px 60px rgba(0,0,0,.18); }
dialog::backdrop { background: rgba(20,20,25,.35); }
dialog h3 { margin: 0 0 12px; }
dialog label { display: block; font-size: 12px; color: var(--muted); margin: 8px 0 3px; }
dialog input, dialog select, dialog textarea { width: 100%; }
dialog .rand { display: flex; gap: 8px; } dialog .rand > * { flex: 1; }
dialog .act { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .g3, .g2, .g2e { grid-template-columns: 1fr; }
  .inbox { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .side { display: none; }
  .main { padding: 14px 16px; }
  .top { flex-wrap: wrap; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kan { grid-template-columns: 1fr 1fr; }
}

/* calendar */
.cal-wrap { display: grid; grid-template-columns: 1fr 320px; gap: 12px; align-items: start; }
.cal-luni { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; min-width: 0; }
.cal-luna { padding: 10px; min-width: 0; }
.cal-luna h3 { margin: 2px 4px 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-cap div { font-size: 10.5px; color: var(--soft); text-align: center; padding-bottom: 2px; }
.cal-zi { display: flex; flex-direction: column; gap: 1px; min-height: 66px; padding: 3px; border-radius: 5px; background: #fafaf8;
  overflow: hidden; min-width: 0; }
.cal-zi:hover { background: var(--accent-soft); color: inherit; }
.cal-zi .nr { font-size: 11px; font-weight: 600; color: #55555a; }
.cal-zi.alta { background: transparent; opacity: .35; }
.cal-zi.azi .nr { background: var(--accent); color: #fff; border-radius: 9px; padding: 0 6px; align-self: flex-start; }
.cal-zi.sel { outline: 2px solid var(--accent); }
.cal-it { font-size: 9.5px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 1px 3px;
  border-radius: 3px; border-left: 3px solid var(--c); background: #fff; }
.cal-it.t-eveniment { background: #eef0ff; font-weight: 600; }
.cal-it.t-facuta { text-decoration: line-through; color: var(--soft); }
.cal-it.t-propusa { border-left-style: dashed; color: #55555a; font-style: italic; background: #fdf6f8; }
.cal-it.t-scadenta { background: #fdecec; }
.cal-it.t-incasare { background: #e7f6ee; }
.cal-mai { font-size: 9.5px; color: var(--soft); }
.cal-leg { display: inline-block; width: 9px; height: 9px; border-radius: 2px; vertical-align: 0; margin: 0 2px 0 8px; flex: none; }
.t .cal-leg { margin: 5px 0 0; }
.cal-leg.ev { background: #4f46e5; } .cal-leg.ta { background: #6b6b70; } .cal-leg.te { background: #b45309; }
.cal-leg.sc { background: #b42318; } .cal-leg.in { background: #0f7a4a; } .cal-leg.apl { background: #0e7490; }
@media (max-width: 1400px) { .cal-wrap { grid-template-columns: 1fr; } }
@media (max-width: 1000px) { .cal-luni { grid-template-columns: 1fr; } }
