:root {
  --bg: #F3F5F8; --surface: #FFFFFF; --ink: #1C2430; --ink-2: #5B6673; --line: #E2E7EE;
  --navy: #163A6B; --navy-soft: #E8EEF8; --amber: #B97A00; --amber-soft: #FFF4DC;
  --green: #1E7A4A; --green-soft: #E3F3EA; --red: #B23A3A; --red-soft: #FBE7E7;
  --radius: 10px; --shadow: 0 1px 2px rgba(28,36,48,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif; font-size: 15px; line-height: 1.5; }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 600; margin: 18px 0 8px; }
p { margin: 0 0 10px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }

/* shell */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 22px 16px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.brand b { font-weight: 600; color: var(--navy); }
.brand-mark { width: 14px; height: 14px; border-radius: 4px; background: linear-gradient(135deg, var(--navy), #2D6CC2); }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--ink); }
.side nav a:hover { background: var(--bg); text-decoration: none; }
.side nav a.active { background: var(--navy-soft); color: var(--navy); font-weight: 500; }
.badge { background: var(--amber); color: #fff; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 999px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.main { padding: 28px 36px 60px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }

/* cards & grid */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 18px; }
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .v { font-size: 22px; font-weight: 600; }
.stat .l { color: var(--ink-2); font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* tables */
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink-2); font-weight: 500; font-size: 13px; background: #FAFBFC; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

/* pills */
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--bg); color: var(--ink-2); white-space: nowrap; }
.pill.ok, .pill.done, .pill.published, .pill.sent, .pill.client, .pill.approved, .pill.meeting { background: var(--green-soft); color: var(--green); }
.pill.warn, .pill.ready, .pill.manual, .pill.draft, .pill.waiting, .pill.replied, .pill.new, .pill.open { background: var(--amber-soft); color: var(--amber); }
.pill.err, .pill.failed, .pill.rejected, .pill.lost, .pill.invalid, .pill.unsubscribed { background: var(--red-soft); color: var(--red); }
.pill.running, .pill.scheduled, .pill.contacted, .pill.queued, .pill.enriched, .pill.in_progress { background: var(--navy-soft); color: var(--navy); }

/* forms & buttons */
label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 12px; }
label input, label select, label textarea, .input { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; color: var(--ink); background: #fff; }
textarea { min-height: 120px; resize: vertical; }
textarea.tall { min-height: 320px; }
.btn { display: inline-block; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; }
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: #1F4D8C; }
.btn.good { background: var(--green); border-color: var(--green); color: #fff; }
.btn.danger { color: var(--red); border-color: #F0C9C9; }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 10px; font-size: 13px; }
form.inline { display: inline; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; background: var(--green-soft); color: var(--green); }
.flash.err { background: var(--red-soft); color: var(--red); }
.flash.warn { background: var(--amber-soft); color: var(--amber); }
.ok { color: var(--green); } .err { color: var(--red); }
pre.box { background: #FAFBFC; border: 1px solid var(--line); border-radius: 8px; padding: 12px; white-space: pre-wrap; word-break: break-word; font-size: 13px; margin: 0 0 10px; }
.post-text { white-space: pre-wrap; }
.thumb { width: 100%; max-width: 280px; border-radius: 8px; border: 1px solid var(--line); display: block; }
.post-card { display: grid; grid-template-columns: 200px 1fr; gap: 18px; }
.post-card .thumb { max-width: 200px; }
details summary { cursor: pointer; color: var(--navy); }
.bar { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--navy); }
.report { white-space: pre-wrap; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.tabs a.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.cost-row { display: grid; grid-template-columns: 140px 1fr 90px; gap: 12px; align-items: center; margin-bottom: 8px; }

/* login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 30px; width: 100%; max-width: 380px; box-shadow: var(--shadow); }
.login-card h1 { margin-bottom: 18px; }

/* responsive: doar layout-ul se adaptează, textul rămâne la fel */
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; }
  .side nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .side-foot { margin-top: 0; flex-direction: row; align-items: center; }
  .main { padding: 18px 16px 50px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post-card { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .cost-row { grid-template-columns: 110px 1fr 80px; }
}
