/* Argonmark CRM. Brand colours from argonmark.com (ink green, cream, gold). Solid colours only. */
:root {
  --ink: #14261F; --ink-2: #24392f; --cream: #F4F1E8; --gold: #C89B3C; --red: #a8322a;
  --bg: #f7f6f2; --card: #fff; --line: #e2ded2; --text: #1d2420; --muted: #66706a; --green: #2f7d4f; --blue: #2b5c8a;
  --radius: 8px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* layout */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: var(--cream); padding: 18px 12px; position: sticky; top: 0; height: 100vh; }
.brand { font-weight: 700; letter-spacing: .5px; padding: 0 10px 18px; color: #fff; }
.brand span { color: var(--gold); }
.side a { display: flex; justify-content: space-between; align-items: center; color: var(--cream); padding: 9px 10px; border-radius: 6px; }
.side a:hover, .side a.on { background: var(--ink-2); text-decoration: none; }
.side .count { background: var(--gold); color: var(--ink); border-radius: 10px; font-size: 12px; padding: 0 7px; font-weight: 700; }
.side .foot { position: absolute; bottom: 14px; left: 12px; right: 12px; font-size: 13px; }
.side .foot a { padding: 6px 10px; }
.main { padding: 22px 26px 60px; min-width: 0; }
.top { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; }
.top h1 { margin: 0; }
.btn.menu-btn { display: none; }

/* cards & grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(20,38,31,.05); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: 2fr 1fr; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat b { display: block; font-size: 24px; color: var(--ink); }
.stat span { color: var(--muted); font-size: 13px; }

/* lists */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 600; }
tr:hover td { background: #fbfaf6; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.empty { color: var(--muted); padding: 8px 0; }

/* badges */
.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; background: #ece9df; color: var(--ink); white-space: nowrap; }
.b-whatsapp, .b-whatsapp_cw { background: #dcefe2; color: #1d5e36; }
.b-email { background: #e0e9f3; color: #234b70; }
.b-webchat { background: #eee4f5; color: #5b3478; }
.b-website, .b-comment { background: #f6ecd6; color: #7a5a17; }
.b-won, .b-active { background: #dcefe2; color: #1d5e36; }
.b-lost, .b-ended { background: #f5dedb; color: var(--red); }
.b-draft { background: #e0e9f3; color: #234b70; }
.settings td { padding: 6px 4px; }
.settings td input[type=checkbox] { width: auto; }
.settings td textarea { min-width: 180px; }
.b-late { background: var(--red); color: #fff; }
.tag { background: var(--cream); border: 1px solid var(--line); }

/* forms */
form.inline { display: inline; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input, select, textarea { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid #cfcabc; border-radius: 6px; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fields .wide { grid-column: 1 / -1; }
.errorlist { color: var(--red); list-style: none; padding: 0; margin: 4px 0 0; font-size: 13px; }
.btn { display: inline-block; font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer; }
.btn:hover { background: var(--ink-2); text-decoration: none; }
.btn.light { background: #fff; color: var(--ink); }
.btn.light:hover { background: var(--cream); }
.btn.danger { background: #fff; color: var(--red); border-color: var(--red); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.filters input, .filters select { width: auto; min-width: 150px; }
.filters input[type=search] { min-width: 260px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* messages */
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; background: #dcefe2; color: #1d5e36; }
.flash.error { background: #f5dedb; color: var(--red); }
.flash.info { background: #e0e9f3; color: #234b70; }

/* contact page */
.who { display: flex; gap: 14px; align-items: center; }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--ink); color: var(--gold); display: grid; place-items: center; font-weight: 700; font-size: 18px; flex: none; }
.points li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { border-left: 3px solid var(--line); padding: 4px 0 14px 14px; position: relative; }
.timeline li.in { border-color: #9cc9ab; }
.timeline li.out { border-color: #9db5cd; }
.timeline li.remark { border-color: var(--gold); }
.timeline .meta { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.timeline .body { white-space: pre-wrap; word-break: break-word; }
.timeline .bubble { background: #fbfaf6; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.timeline img { max-width: 260px; max-height: 260px; border-radius: 6px; display: block; margin-top: 6px; }
details summary { cursor: pointer; font-weight: 600; color: var(--ink); }

/* pipeline */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: #eeebe2; border-radius: var(--radius); padding: 10px; min-height: 300px; }
.col h2 { font-size: 14px; display: flex; justify-content: space-between; }
.col.over { outline: 2px dashed var(--gold); }
.deal-card { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; margin-bottom: 8px; cursor: grab; }
.deal-card .t { font-weight: 600; }
.deal-card.dragging { opacity: .5; }

/* login */
.login { max-width: 380px; margin: 10vh auto; padding: 0 16px; }
.login .brand { color: var(--ink); font-size: 22px; padding: 0 0 16px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 10; left: 0; width: 240px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; }
  .btn.menu-btn { display: inline-block; }
  .main { padding: 16px 16px 60px; }
  .g2, .g3, .fields { grid-template-columns: 1fr; }
  .g3.side-first > :last-child { order: -1; }
  .stats { grid-template-columns: 1fr 1fr; }
  .filters input[type=search], .filters input, .filters select { min-width: 0; width: 100%; }
  .hide-sm { display: none; }
  table { font-size: 14px; }
}
