:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #d9e1ec;
  --brand: #174ea6;
  --brand-dark: #123d82;
  --ok: #12805c;
  --danger: #b42318;
  --shadow: 0 10px 30px rgba(22, 34, 51, .08);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; color: var(--text); background: var(--bg); }
a { color: inherit; text-decoration: none; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 260px; flex: 0 0 260px; background: #0f1f35; color: #fff; padding: 22px; }
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 28px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 8px; background: var(--brand); font-weight: 800; }
.brand small { display: block; color: #b8c3d4; margin-top: 2px; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar a { padding: 11px 12px; border-radius: 8px; color: #e8eef7; }
.sidebar a:hover { background: rgba(255,255,255,.09); }
.main { flex: 1; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 70px; padding: 14px 24px; background: #fff; border-bottom: 1px solid var(--line); }
.topbar span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.content { padding: 24px; }
h1 { margin: 0 0 18px; font-size: 28px; }
h2 { margin: 0 0 14px; font-size: 18px; }
.panel, .stat { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.panel { padding: 18px; margin-bottom: 18px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { padding: 18px; }
.stat span { color: var(--muted); display: block; margin-bottom: 8px; }
.stat strong { font-size: 30px; }
.grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.rowline { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 10px 0; margin: 0; }
.activity { border-bottom: 1px solid var(--line); padding: 10px 0; margin: 0; color: #344054; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: left; padding: 11px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 13px; }
.badge { display: inline-block; padding: 5px 9px; border-radius: 999px; background: #eaf1ff; color: var(--brand-dark); font-size: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 8px; padding: 10px 14px; cursor: pointer; font-weight: 700; }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.small { padding: 7px 10px; font-size: 12px; }
.btn.whatsapp { color: var(--ok); }
label { display: grid; gap: 6px; font-weight: 700; font-size: 14px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 11px; font: inherit; background: #fff; }
textarea { min-height: 100px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form select { min-width: 150px; }
.user-edit-form { display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr)); gap: 8px; align-items: center; }
.span-2 { grid-column: span 2; }
.checkbox { display: flex; align-items: center; gap: 8px; }
.checkbox input { width: auto; }
.alert { padding: 12px; border-radius: 8px; margin-bottom: 14px; }
.alert.error { background: #fee4e2; color: var(--danger); }
.alert.success { background: #dcfae6; color: var(--ok); }
.muted { color: var(--muted); }
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(135deg, #eef4ff, #f8fbff); }
.login-card { width: min(420px, 100%); background: #fff; padding: 28px; border-radius: 8px; border: 1px solid var(--line); box-shadow: var(--shadow); display: grid; gap: 14px; }
.login-card h1 { margin-bottom: 0; }
.login-brand { margin-bottom: 4px; color: var(--text); }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: 310px; gap: 14px; overflow-x: auto; padding-bottom: 12px; }
.kanban-column { background: #eef3f9; border: 1px solid var(--line); border-radius: 8px; padding: 12px; min-height: 520px; }
.kanban-column h2 { font-size: 15px; color: #344054; }
.kanban-list { display: grid; gap: 10px; min-height: 450px; align-content: start; }
.lead-card { display: grid; gap: 7px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px; box-shadow: 0 4px 12px rgba(22,34,51,.06); }
.lead-card span, .lead-card small { color: var(--muted); }
.menu-toggle { display: none; }
pre { white-space: pre-wrap; max-width: 520px; }
@media (max-width: 900px) {
  .sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; transform: translateX(-100%); transition: .2s; }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: inline-flex; }
  .stats-grid, .grid.two, .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .content { padding: 16px; }
}
