/* app.css — stilul comun al platformei · identitatea Ads Performance (negru + auriu) */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=Montserrat:ital,wght@0,500;0,600;0,700;0,800;1,700;1,800&display=swap');

:root {
  --bg: #F5F5F3;
  --card: #FFFFFF;
  --line: #E5E2DA;
  --line-soft: #EFEDE7;
  --text: #16161A;
  --muted: #5E5C66;
  --side: #0B0B0E;
  --side-hover: #1D1D23;
  --side-text: #C4C4CC;
  --gold: #F2BA40;          /* auriul din logo */
  --gold-hover: #E0A72A;
  --accent: #F2BA40;        /* bare, sublinieri, bife */
  --accent-dark: #7A5200;   /* text auriu pe fundal deschis (contrast bun) */
  --accent-soft: #FCF1D8;
  --good: #13733A;
  --good-soft: #E6F4EA;
  --warn: #8A4500;
  --warn-soft: #FDF0E1;
  --bad: #B42318;
  --bad-soft: #FDE8E7;
  --radius: 10px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent-dark); }
a:hover { color: #000; }
h1 { font-size: 26px; margin: 0; line-height: 1.2; }
h2 { font-size: 18px; margin: 0; }
:focus-visible { outline: 3px solid #C98E12; outline-offset: 2px; }
h1, h2, .kpi .value, .pf-name { font-family: 'Montserrat', 'IBM Plex Sans', system-ui, sans-serif; letter-spacing: -0.01em; }

/* ---------- Așezarea paginii ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex: 0 0 248px; background: var(--side); color: #fff;
  display: flex; flex-direction: column; padding: 20px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar > * { flex-shrink: 0; }
.brand { padding: 6px 12px 22px; }
.brand img { display: block; width: 100%; max-width: 190px; height: auto; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav span {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 11px 12px; border-radius: 8px; color: var(--side-text); text-decoration: none; font-size: 15px;
}
.nav a:hover { background: var(--side-hover); color: #fff; }
.nav a.active { background: var(--side-hover); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--gold); }
.nav span.soon { color: #77777F; cursor: default; }
.nav span.soon small { font-size: 12px; }
.side-user { margin-top: auto; padding: 14px 12px 4px; border-top: 1px solid #26262E; font-size: 14px; color: var(--side-text); }
.side-user strong { color: #fff; display: block; }
.side-user button {
  background: none; border: 0; color: var(--side-text); padding: 6px 0; font: inherit; cursor: pointer; text-decoration: underline;
}
.side-user button:hover { color: #fff; }

.main { flex: 1 1 auto; min-width: 0; padding: 28px 32px 48px; }
.container { max-width: 1320px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.topbar { display: none; }

/* ---------- Carduri și grile ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.kpi .label { color: var(--muted); font-size: 14px; }
.kpi .value { font-size: 28px; font-weight: 700; margin-top: 6px; }
.kpi .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.cols > .wide { flex: 2 1 560px; min-width: 0; }
.cols > .narrow { flex: 1 1 300px; min-width: 0; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 24px 0; text-align: center; }

/* ---------- Butoane și câmpuri ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 0 16px; border-radius: 8px; border: 1px solid #D9D6CE;
  background: #fff; color: var(--text); font: inherit; font-weight: 500; cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: #B3AD9F; }
.btn-primary { background: var(--gold); border-color: var(--gold); color: #111; font-weight: 700; }
.btn-primary:hover { background: var(--gold-hover); border-color: var(--gold-hover); color: #000; }
.btn-danger { color: var(--bad); border-color: #F1B8B3; }
.btn-sm { min-height: 34px; padding: 0 10px; font-size: 14px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 14px; color: var(--muted); }
.field input, .field select, .field textarea, .input {
  min-height: 42px; border: 1px solid #D9D6CE; border-radius: 8px; padding: 8px 12px;
  font: inherit; color: var(--text); background: #fff; width: 100%;
}
.field textarea { min-height: 80px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--text); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }

/* ---------- Tabele ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tr:hover td { background: #FAFBFC; }
.tbl td.num, .tbl th.num { text-align: right; white-space: nowrap; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--accent-soft); color: var(--accent-dark); }
.badge.grey { background: #EEECE6; color: var(--muted); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs button {
  background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px;
  font: inherit; color: var(--muted); cursor: pointer; margin-bottom: -1px;
}
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

/* ---------- Fereastra (dialog) și mesaje ---------- */
dialog {
  border: 0; border-radius: 14px; padding: 0; width: min(640px, calc(100vw - 24px));
  box-shadow: 0 20px 60px rgba(20, 28, 45, .25); color: var(--text);
}
dialog::backdrop { background: rgba(20, 28, 45, .45); }
.dlg-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.dlg-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; max-height: 70vh; overflow-y: auto; }
.dlg-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.dlg-close { background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--muted); width: 40px; height: 40px; }
.error-msg { color: var(--bad); font-size: 14px; min-height: 1em; }

#toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 50; background: var(--text); color: #fff;
  padding: 12px 18px; border-radius: 10px; font-size: 14px; opacity: 0; transform: translateY(8px);
  transition: opacity .2s, transform .2s; pointer-events: none; max-width: calc(100vw - 40px);
}
#toast.show { opacity: 1; transform: none; }
#toast.err { background: var(--bad); }

/* ---------- Căutare globală ---------- */
.gsearch { position: relative; padding: 0 4px 14px; }
.gsearch input {
  width: 100%; min-height: 40px; border-radius: 8px; border: 1px solid #2C2C34; background: #17171C;
  color: #fff; padding: 0 12px; font: inherit; font-size: 14px;
}
.gsearch input::placeholder { color: #8E8E98; }
.gresults {
  position: absolute; left: 4px; right: 4px; top: 44px; z-index: 30; background: #fff; color: var(--text);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.3); max-height: 360px; overflow-y: auto;
}
.gresults a { display: block; padding: 10px 12px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line-soft); font-weight: 600; font-size: 14px; }
.gresults a:hover { background: var(--accent-soft); }
.gresults small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.gresults span { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
.gresults .none { padding: 12px; color: var(--muted); font-size: 14px; }

/* ---------- Notificări ---------- */
.bell { margin: 0 4px 10px; min-height: 40px; border-radius: 8px; border: 1px solid #2C2C34; background: #17171C; color: #fff;
  font: inherit; font-size: 14px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; cursor: pointer; }
.bell-n { background: #D92D20; color: #fff; border-radius: 999px; min-width: 22px; height: 22px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.bell-box { background: #fff; color: var(--text); border-radius: 10px; margin: 0 4px 12px; max-height: 420px; overflow-y: auto; box-shadow: 0 12px 32px rgba(0,0,0,.3); }
.bell-g { font-size: 12px; font-weight: 700; color: var(--muted); padding: 10px 12px 4px; text-transform: uppercase; letter-spacing: .03em; }
.bell-i { display: block; padding: 8px 12px; text-decoration: none; color: var(--text); border-left: 3px solid transparent; font-size: 14px; }
.bell-i:hover { background: var(--accent-soft); }
.bell-i.bad { border-left-color: var(--bad); }
.bell-i.warn { border-left-color: #C25E00; }
.bell-i.info { border-left-color: var(--accent); }
.bell-i span { display: block; color: var(--muted); font-size: 13px; }
.bell-box .none { padding: 12px; color: var(--muted); font-size: 14px; }

/* ---------- Taskuri (coloane) ---------- */
.kanban { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; align-items: start; }
.kcol { background: #ECEAE4; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.kcol h3 { font-size: 14px; margin: 4px 4px 2px; }
.kcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%; }
.kcard:hover { border-color: #B3AD9F; }
.kcard .t { font-weight: 600; font-size: 14px; }
.kcard .s { color: var(--muted); font-size: 13px; margin-top: 4px; }
.kcard .f { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 13px; }

/* ---------- Telefon și tabletă ---------- */
@media (max-width: 900px) {
  .layout { display: block; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: var(--side); color: #fff; padding: 10px 16px; position: sticky; top: 0; z-index: 20;
  }
  .topbar button { background: none; border: 1px solid #33333C; color: #fff; border-radius: 8px; min-height: 40px; padding: 0 14px; font: inherit; }
  .topbar img { height: 30px; width: auto; display: block; }
  .sidebar { display: none; position: fixed; inset: 60px 0 0 0; width: auto; height: auto; z-index: 19; }
  .sidebar.open { display: flex; }
  .sidebar .brand { display: none; }
  .main { padding: 20px 16px 40px; }
}
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }

/* ---------- Profilul meu (cabinetul angajatului) ---------- */
.profile-card { margin-bottom: 20px; border-top: 4px solid var(--gold); }
.pf-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.pf-avatar { width: 64px; height: 64px; border-radius: 50%; background: #0B0B0E; color: var(--gold); display: grid; place-items: center;
  font: 800 22px 'Montserrat', sans-serif; flex: 0 0 auto; }
.pf-kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-dark); font-weight: 700; }
.pf-name { font-size: 22px; margin: 2px 0; }
.pf-role { color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pf-stats { margin-left: auto; display: flex; gap: 22px; }
.pf-stats div { text-align: center; }
.pf-stats b { display: block; font: 800 24px 'Montserrat', sans-serif; }
.pf-stats span { font-size: 12px; color: var(--muted); }
.pf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 18px; }
.pf-item { background: var(--bg); border-radius: 8px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pf-item span { font-size: 13px; color: var(--muted); }
.pf-item strong { font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 700px) { .pf-stats { margin-left: 0; width: 100%; justify-content: space-between; } }
.info-row { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.info-row span:first-child { color: var(--muted); }
/* ---------- Întâlniri ---------- */
.meet { display: grid; grid-template-columns: 190px 1fr auto; gap: 14px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.meet:first-child { border-top: 0; }
.meet.past { opacity: .7; }
.meet-when { display: flex; flex-direction: column; gap: 2px; border-left: 3px solid var(--gold); padding-left: 10px; }
.meet-when span { font-size: 13px; color: var(--muted); }
.meet-title { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.meet-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.meet-banner { background: #0B0B0E; color: #fff; border-radius: 12px; padding: 16px 20px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; border-left: 5px solid var(--gold); }
.meet-banner strong { color: var(--gold); }
@media (max-width: 760px) { .meet { grid-template-columns: 1fr; } .meet-actions { flex-direction: row; flex-wrap: wrap; } }
/* fișiere atașate (taskuri, cabinetul clientului) */
.file-item { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.file-item .btn { min-height: 30px; padding: 0 10px; font-size: 12px; }
.ctask { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; overflow: hidden; background: var(--card); }
.ctask > summary { list-style: none; cursor: pointer; padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center; }
.ctask > summary::-webkit-details-marker { display: none; }
.ctask > summary::after { content: "▾"; grid-column: 2; grid-row: 1; justify-self: end; color: var(--muted); }
.ctask[open] > summary { border-bottom: 1px solid var(--line-soft); background: var(--bg); }
.ctask[open] > summary::after { content: "▴"; }
.ctask .ct-title { font-weight: 700; }
.ctask .ct-meta { font-size: 13px; color: var(--muted); grid-column: 1 / -1; }
.ctask .ct-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.ctask.todo { border-left: 4px solid var(--gold); }
/* ---------- Analiza lunară a monitorizării (tabel zi cu zi) ---------- */
.mg-wrap { border: 1px solid var(--line); border-radius: 10px; }
.mg { border-collapse: separate; border-spacing: 0; font-size: 13px; width: max-content; min-width: 100%; }
.mg th, .mg td { padding: 6px 4px; text-align: center; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.mg thead th { background: #0B0B0E; color: #fff; font-weight: 600; position: sticky; top: 0; z-index: 1; }
.mg thead th small { display: block; font-size: 11px; font-weight: 400; color: #B9B9C2; }
.mg .mg-name { text-align: left; padding: 6px 10px; position: sticky; left: 0; background: var(--card); z-index: 2; min-width: 170px; max-width: 240px; white-space: normal; }
.mg thead .mg-name { background: #0B0B0E; z-index: 3; }
.mg .mg-name small { display: block; color: var(--muted); font-size: 11px; }
.mg .mg-d { width: 28px; min-width: 28px; }
.mg .mg-wkh { background: #2A2A31; }
.mg .mg-todayh, .mg thead .mg-todayh { background: var(--gold); color: #111; }
.mg .mg-todayh small { color: #333; }
.mg-ok { background: #E3F3E7; color: #13733A; font-weight: 700; }
.mg-ok.mg-bad { background: #FDE5E3; color: #B42318; }
.mg-miss { background: #FBEAEA; color: #C0362C; }
.mg-we { background: #F1EFEA; color: #9A968C; }
.mg td.mg-today { box-shadow: inset 2px 0 0 var(--gold), inset -2px 0 0 var(--gold); }
.mg .mg-sum { min-width: 64px; font-weight: 600; background: var(--bg); }
.mg tfoot td { background: #F7F3E8; font-weight: 700; }
.mg tfoot .mg-name { background: #F7F3E8; }
.mg-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; margin-bottom: 10px; align-items: center; }
.mg-legend b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 4px; margin-right: 4px; }
.bar { height: 8px; background: var(--line-soft); border-radius: 4px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--gold); }
/* taskuri pe conturi */
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.acc-card { text-align: left; font: inherit; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; border-left: 5px solid #CFC9BA; }
.acc-card:hover { border-color: #B3AD9F; }
.acc-card.open { border-left-color: var(--gold); }
.acc-card.late { border-left-color: var(--bad); }
.acc-name { font-weight: 700; margin-bottom: 8px; }
.acc-name small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.acc-nums { display: flex; align-items: center; gap: 8px; }
.acc-open { display: inline-grid; place-items: center; min-width: 38px; height: 38px; padding: 0 8px; border-radius: 10px; background: var(--gold); color: #111; font: 800 20px 'Montserrat', sans-serif; }
.acc-card:not(.open):not(.late) .acc-open { background: var(--line-soft); color: var(--muted); }
.acc-late { background: #FDE5E3; color: #B42318; font-weight: 700; font-size: 12px; padding: 3px 8px; border-radius: 999px; }
/* insigne alăturate fără suprapuneri */
.badges { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.badge { white-space: nowrap; line-height: 1.4; }
.acc-nums { flex-wrap: wrap; row-gap: 6px; }
.acc-late, .acc-nums .badge { white-space: nowrap; }
/* strategii, rapoarte, analize */
.lib-list { display: flex; flex-direction: column; gap: 10px; }
.lib-item { display: flex; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.lib-ico { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border-radius: 10px; background: #FBF3DD; font-size: 20px; }
/* sub-taskuri și istoric */
.sub-list { display: flex; flex-direction: column; gap: 6px; }
.sub-item { display: flex; align-items: center; gap: 10px; text-align: left; font: inherit; color: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; }
.sub-item:hover { border-color: #B3AD9F; }
.sub-item small { display: block; color: var(--muted); font-size: 12px; }
.sub-item.done strong { text-decoration: line-through; color: var(--muted); }
.sub-n { width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center; border-radius: 50%; background: #FBF3DD; font-weight: 700; font-size: 13px; }
.note.ev { color: var(--muted); font-size: 13px; }
.note small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 2px; }
/* platforme și resurse digitale */
.plat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.plat-card { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.plat-card.off { opacity: .6; border-style: dashed; }
.plat-ico { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border-radius: 12px; background: #F2F0EA; font-size: 22px; }
.news-i { display: block; padding: 8px 0; border-top: 1px solid var(--line-soft); text-decoration: none; color: inherit; }
.news-i strong { display: block; font-size: 14px; }
.news-i span { font-size: 12px; color: var(--muted); }
.note { border-top: 1px solid var(--line-soft); padding: 6px 0; font-size: 14px; }
/* sub-taskuri vizibile în fișa taskului */
.sub-box { border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 12px; padding: 14px 16px; background: #FFFCF3; }
.sub-item { cursor: default; }
.sub-open { flex: 1; min-width: 0; text-align: left; background: none; border: 0; font: inherit; color: inherit; cursor: pointer; padding: 0; }
.sub-open small { display: block; color: var(--muted); font-size: 12px; }
.sub-st { width: auto; min-width: 130px; min-height: 34px; font-size: 13px; font-weight: 600; }
.sub-st.st-done { background: #E3F3E7; color: #13733A; }
.sub-st.st-work { background: #E6EEFB; color: #1D4F91; }
.sub-st.st-todo { background: #FBF3DD; color: #7A5A00; }
/* bandă: administratorul e în cabinetul altcuiva */
.imp-bar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 14px;
  padding: 8px 16px; background: #F2BA40; color: #111; font-size: 14px; text-align: center; }
.imp-bar .btn { background: #0B0B0E; color: #fff; border-color: #0B0B0E; }
