/* CRM — stil cald, aceleași valori ca în mockup. Fără build: fișier CSS simplu. */
:root {
  --bg: #FBF6EE;
  --card: #FFFFFF;
  --soft: #F6EFE5;
  --soft-2: #FBF6EE;
  --line: #F3EADF;
  --line-2: #E8DCCB;
  --ink: #2B2620;
  --muted: #6B6259;
  --accent: #B04A26;
  --accent-ink: #8F3B1D;
  --accent-soft: #F8E6DA;
  --accent-tint: #FBEDE3;
  --good: #24552E;
  --good-bg: #E5F2E3;
  --good-strong: #2F7A3E;
  --warn: #7A4F00;
  --warn-bg: #FFF1D6;
  --bad: #7E2626;
  --bad-bg: #FBEBEB;
  --bad-line: #E7B3B3;
  --info: #2C4A5E;
  --info-bg: #DCE6EE;
  --admin: #3E2F6B;
  --admin-bg: #ECE8F8;
  --radius: 26px;
  --shadow: 0 4px 16px rgba(60, 40, 20, 0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.45;
}
a { color: var(--accent-ink); }
a:hover { color: #6E2C14; }
h1, h2, h3 { margin: 0; font-weight: 900; line-height: 1.2; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 15px; }
input, select, button, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid #E7B49B; outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Bara de sus */
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 14px 32px; background: #FFFDF9; border-bottom: 1px solid #F0E4D3; }
.brandmark { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brandmark .logo { width: 42px; height: 42px; border-radius: 14px; background: var(--accent); display: flex; align-items: center; justify-content: center; }
.brandmark .name { font-weight: 900; font-size: 18px; }
.nav { flex: 1 1 420px; display: flex; flex-wrap: wrap; gap: 4px; }
.nav a { display: flex; align-items: center; height: 40px; padding: 0 14px; border-radius: 999px; color: var(--ink); font-weight: 600; text-decoration: none; }
.nav a:hover { background: var(--soft); }
.nav a.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; }
.userbox { display: flex; align-items: center; gap: 10px; }
.avatar { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; background: #F6D9C6; color: #6E2C14; }
.avatar.sm { width: 36px; height: 36px; flex-basis: 36px; font-size: 13px; }

/* Pagina */
.page { max-width: 1440px; margin: 0 auto; padding: 24px 32px 48px; display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.page-head { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.full { flex: 1 1 100%; min-width: 0; }
.card { background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.grow { flex: 999 1 640px; }
.side { flex: 1 1 360px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kpis { flex: 1 1 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kpi { background: var(--card); border-radius: 20px; padding: 16px 18px; box-shadow: 0 2px 8px rgba(60, 40, 20, 0.05); }
.kpi .label { font-size: 13px; font-weight: 800; color: var(--muted); }
.kpi .value { font-size: 30px; font-weight: 900; }
.kpi .value.good { color: var(--good); }
.kpi .value.warn { color: var(--warn); }
.kpi .value.bad { color: var(--bad); }

/* Formulare */
label, .label { font-size: 13px; font-weight: 800; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.input, select.input, textarea.input { height: 46px; width: 100%; border: 1px solid var(--line-2); border-radius: 14px; padding: 0 14px; font-size: 15px; background: #FFFDF9; color: var(--ink); min-width: 0; }
textarea.input { height: auto; padding: 12px 14px; }
.input.big { height: 56px; font-size: 22px; font-weight: 900; letter-spacing: 0.2em; text-align: center; }
.error { color: var(--bad); font-size: 13px; font-weight: 700; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); font-size: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

/* Butoane */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 18px; border-radius: 14px; border: 0; font-weight: 900; font-size: 15px; cursor: pointer; text-decoration: none; background: var(--accent); color: #fff; }
.btn:hover { background: #9A3F20; color: #fff; }
.btn.block { width: 100%; height: 52px; border-radius: 16px; font-size: 16px; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line-2); font-weight: 800; }
.btn.ghost:hover { background: var(--soft); color: var(--ink); }
.btn.danger { background: #fff; color: var(--bad); border: 1px solid var(--bad-line); font-weight: 800; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.good { background: var(--good-bg); color: #1F4A27; }
.btn.sm { height: 36px; padding: 0 12px; border-radius: 999px; font-size: 13px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent-ink); font-weight: 800; cursor: pointer; }

/* Pastile și taburi */
.pill { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 800; white-space: nowrap; background: var(--soft); color: #5A5148; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.admin { background: var(--admin-bg); color: var(--admin); }
.pill.agent { background: var(--accent-soft); color: var(--accent-ink); }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tab { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 8px 0 14px; border-radius: 999px; font-weight: 800; font-size: 13px; text-decoration: none; background: #fff; color: var(--ink); border: 1px solid var(--line-2); }
.tab .count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; background: var(--soft); }
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tab.active .count { background: rgba(255, 255, 255, 0.25); }

/* Mesaje */
.toast { flex: 1 1 100%; display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-radius: 18px; background: var(--good-bg); color: #1F4A27; font-weight: 800; border: 1px solid #BFDDBF; }
.toast .dot { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; background: var(--good-strong); display: flex; align-items: center; justify-content: center; }
.toast.bad { background: var(--bad-bg); color: #6E1F1F; border-color: var(--bad-line); }
.toast.bad .dot { background: #B23B3B; }
.notice { font-size: 14px; color: #5A5148; background: var(--soft-2); border-radius: 14px; padding: 12px 14px; }
.notice.warn { background: #FFF6E5; color: #6B5A3A; }
.secret-box { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: 20px; background: #FFF6E5; border: 2px solid #EBCB8B; }
.secret-box code { font-size: 22px; font-weight: 900; letter-spacing: 0.08em; color: #5C3B00; word-break: break-all; }

/* Tabele */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: separate; border-spacing: 0 6px; min-width: 720px; }
table.list th { text-align: left; font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; padding: 0 12px; }
table.list td { padding: 10px 12px; background: #fff; border-top: 2px solid var(--line); border-bottom: 2px solid var(--line); vertical-align: middle; }
table.list td:first-child { border-left: 2px solid var(--line); border-radius: 16px 0 0 16px; }
table.list td:last-child { border-right: 2px solid var(--line); border-radius: 0 16px 16px 0; }
table.list tr.dim td { background: #F6F2EC; opacity: 0.85; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who .n { font-weight: 800; white-space: nowrap; }
.who .s { font-size: 13px; color: var(--muted); }

/* Jurnal */
.feed-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: var(--soft-2); }
.feed-item .t { font-size: 13px; font-weight: 800; color: var(--muted); width: 92px; flex: 0 0 92px; }
.feed-item .dot { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; margin-top: 6px; background: #8A7E72; }
.dot.good { background: #4E9A5B; } .dot.warn { background: #D9A441; } .dot.bad { background: #B23B3B; }
details.changes summary { cursor: pointer; font-size: 13px; font-weight: 800; color: var(--accent-ink); }
.diff { margin-top: 6px; font-size: 13px; display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; }
.diff .k { font-weight: 800; color: var(--muted); }
.diff del { color: var(--bad); }
.diff ins { color: var(--good); text-decoration: none; font-weight: 700; }

/* Ecrane de autentificare */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth .card { width: 100%; max-width: 440px; padding: 32px; gap: 18px; }
.auth .qr { display: flex; justify-content: center; padding: 16px; background: #fff; border-radius: 20px; border: 2px solid var(--line); }
.auth .qr svg { width: 220px; height: 220px; }

/* Comutator */
.switch { position: relative; display: inline-flex; width: 52px; height: 30px; flex: 0 0 52px; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #D8CCBC; transition: background 0.15s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: transform 0.15s; }
.switch input:checked + span { background: var(--good-strong); }
.switch input:checked + span::after { transform: translateX(22px); }
.switch input:focus-visible + span { outline: 2px solid #E7B49B; outline-offset: 2px; }

.empty { padding: 28px 12px; text-align: center; color: var(--muted); }
.pagination { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

@media (max-width: 640px) {
  .topbar, .page { padding-left: 16px; padding-right: 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  h1 { font-size: 22px; }
}
