:root {
  --blue-dark: #123a8c;
  --blue: #1f6fe0;
  --orange: #f46a1f;
  --ink: #1a2233;
  --slate: #5a6376;
  --bg: #f4f6fb;
  --border: #e2e6f0;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif; background: var(--bg); color: var(--ink); }
a { color: inherit; }
.muted { color: var(--slate); }

/* Login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, var(--blue-dark), var(--blue)); }
.login-card { background: #fff; padding: 40px; border-radius: 12px; width: 340px; box-shadow: 0 20px 50px rgba(0,0,0,.2); }
.login-card h1 { margin: 0 0 4px; font-size: 22px; color: var(--blue-dark); }
.login-card label { display: block; margin: 14px 0 4px; font-size: 13px; font-weight: 600; }
.login-card input { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }
.login-card button { margin-top: 20px; width: 100%; padding: 12px; background: var(--orange); color: #fff; border: 0; border-radius: 6px; font-weight: 600; cursor: pointer; }
.error { color: #c0392b; font-size: 13px; min-height: 18px; margin-top: 8px; }

/* App shell */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--blue-dark); color: #fff; display: flex; flex-direction: column; padding: 20px 0; flex-shrink: 0; }
.brand { font-weight: 700; font-size: 18px; padding: 0 20px 20px; border-bottom: 1px solid rgba(255,255,255,.15); }
.sidebar nav { display: flex; flex-direction: column; padding: 10px 0; flex: 1; }
.nav-link { padding: 12px 20px; text-decoration: none; color: rgba(255,255,255,.8); font-size: 14px; border-left: 3px solid transparent; }
.nav-link:hover { background: rgba(255,255,255,.08); }
.nav-link.active { background: rgba(255,255,255,.12); border-left-color: var(--orange); color: #fff; font-weight: 600; }
.logout-btn { margin: 0 20px; padding: 10px; background: transparent; border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 6px; cursor: pointer; }

.content { flex: 1; padding: 30px 40px; overflow-x: auto; }
.content h2 { margin-top: 0; color: var(--blue-dark); }

/* Generic components */
.card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin-bottom: 20px; }
.btn { background: var(--blue); color: #fff; border: 0; padding: 9px 16px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.btn.secondary { background: #fff; color: var(--blue); border: 1px solid var(--blue); }
.btn.danger { background: #fff; color: #c0392b; border: 1px solid #c0392b; }
.btn.orange { background: var(--orange); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: top; }
th { color: var(--slate); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
input, textarea, select { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; font-family: inherit; }
label { font-size: 13px; font-weight: 600; display: block; margin: 12px 0 4px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { background: #fff; border-radius: 10px; padding: 18px; border: 1px solid var(--border); }
.stat .num { font-size: 28px; font-weight: 700; color: var(--blue-dark); }
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.new { background: #fde9e0; color: var(--orange); }
.badge.contacted { background: #e5edfc; color: var(--blue); }
.badge.converted { background: #e2f6ea; color: #1a7a3a; }
.badge.closed { background: #eee; color: var(--slate); }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 10px; flex-wrap: wrap; }
.section-block { border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 14px; }
.section-block .sb-head { display: flex; justify-content: space-between; align-items: center; }
.thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.media-item img { width: 100%; height: 100px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
