/* Helpr CRM design system — built off the brand logo palette
   Navy #1E2C5E / Orange #F7941D */

:root {
  --navy: #1E2C5E;
  --navy-700: #162148;
  --navy-600: #24356e;
  --navy-100: #E7EAF3;
  --navy-50: #F3F5FA;
  --orange: #F7941D;
  --orange-600: #E07F0A;
  --orange-100: #FEF0DC;
  --ink: #1B1F2A;
  --muted: #6B7280;
  --muted-light: #9AA1B1;
  --border: #E6E8F0;
  --bg: #F5F6FA;
  --surface: #FFFFFF;
  --success: #16A34A;
  --success-100: #DCFCE7;
  --danger: #DC2626;
  --danger-100: #FEE2E2;
  --warning: #D97706;
  --warning-100: #FEF3C7;
  --info: #2563EB;
  --info-100: #DBEAFE;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 60, 0.04);
  --shadow-md: 0 6px 20px rgba(16, 24, 60, 0.08);
  --shadow-lg: 0 20px 45px rgba(16, 24, 60, 0.14);
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14.5px;
}

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--orange-600); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--navy-100); border-radius: 6px; }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
  width: 252px;
  flex: none;
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
}

.app-sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 22px 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.app-sidebar .brand img { height: 34px; width: auto; display: block; filter: brightness(0) invert(1); }
.app-sidebar .brand .wordmark { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; color: #fff; }
.app-sidebar .brand .tagline { font-size: 0.68rem; color: rgba(255,255,255,0.55); margin-top: -2px; }

.app-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; flex: 1; }
.app-nav .nav-section-label {
  font-size: 0.65rem; text-transform: uppercase; letter-spacing: .09em;
  color: rgba(255,255,255,0.38); margin: 14px 10px 4px;
}
.app-navitem {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 10px;
  color: rgba(255,255,255,0.75); font-size: 0.9rem; font-weight: 500;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s;
}
.app-navitem i { font-size: 1.05rem; width: 20px; text-align: center; color: rgba(255,255,255,0.55); }
.app-navitem:hover { background: rgba(255,255,255,0.06); color: #fff; }
.app-navitem:hover i { color: rgba(255,255,255,0.85); }
.app-navitem.active {
  background: rgba(247,148,29,0.14);
  color: #fff;
  border-left-color: var(--orange);
}
.app-navitem.active i { color: var(--orange); }

.app-sidebar .sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 14px; margin-top: 10px;
}
.avatar-chip {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(247,148,29,0.18); color: var(--orange);
  font-weight: 700; font-size: 0.8rem; flex: none;
}
.sidebar-footer .user-name { color: #fff; font-weight: 600; font-size: 0.85rem; }
.sidebar-footer .user-role { color: rgba(255,255,255,0.5); font-size: 0.72rem; text-transform: capitalize; }
.btn-logout {
  width: 100%; margin-top: 12px; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14); color: rgba(255,255,255,0.85);
  border-radius: 9px; padding: 7px 10px; font-size: 0.82rem;
}
.btn-logout:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* ---------- Topbar + main ---------- */
.app-main { flex: 1; min-width: 0; }
.app-topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 16px 28px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 5;
}
.app-topbar h1 { font-size: 1.28rem; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.app-topbar .subtitle { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.app-content { padding: 26px 28px 40px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-header { background: transparent; border-bottom: 1px solid var(--border); font-weight: 700; padding: 14px 18px; font-size: 0.92rem; }

/* ---------- Stat cards ---------- */
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow-sm);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
.stat-card .stat-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; flex: none;
}
.stat-icon.tone-navy { background: var(--navy-50); color: var(--navy); }
.stat-icon.tone-orange { background: var(--orange-100); color: var(--orange-600); }
.stat-icon.tone-success { background: var(--success-100); color: var(--success); }
.stat-icon.tone-info { background: var(--info-100); color: var(--info); }
.stat-val { font-size: 1.9rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.stat-label { font-size: 0.72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }

/* ---------- Tables ---------- */
.table-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); background: var(--surface); }
.table-modern { width: 100%; border-collapse: collapse; margin: 0; }
.table-modern thead th {
  background: var(--navy-50); color: var(--navy); text-transform: uppercase;
  font-size: 0.68rem; letter-spacing: .07em; font-weight: 700;
  padding: 12px 18px; border-bottom: 1px solid var(--border); text-align: left;
}
.table-modern tbody td { padding: 13px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table-modern tbody tr:last-child td { border-bottom: none; }
.table-modern tbody tr { transition: background .12s; }
.table-modern tbody tr:hover { background: var(--navy-50); }
.table-modern .cell-sub { font-size: 0.78rem; color: var(--muted); }

/* ---------- Status badges ---------- */
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 999px; font-size: 0.72rem; font-weight: 700;
  white-space: nowrap;
}
.status-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-prospect { background: #EEF0F5; color: #6B7280; }
.status-contacted { background: var(--info-100); color: var(--info); }
.status-meeting-scheduled { background: #EDE9FE; color: #7C3AED; }
.status-interested { background: var(--warning-100); color: var(--warning); }
.status-agreement-signed { background: #D1FAE5; color: #059669; }
.status-active { background: var(--success-100); color: var(--success); }
.status-inactive { background: var(--danger-100); color: var(--danger); }
.status-lead { background: #EEF0F5; color: #6B7280; }
.status-documents-pending { background: var(--warning-100); color: var(--warning); }
.status-ready-to-join { background: #EDE9FE; color: #7C3AED; }
.status-placed { background: var(--success-100); color: var(--success); }
.status-not-interested { background: var(--danger-100); color: var(--danger); }
.status-done { background: var(--success-100); color: var(--success); }
.status-open { background: var(--warning-100); color: var(--warning); }

/* ---------- Buttons ---------- */
.btn { border-radius: 9px; font-weight: 600; font-size: 0.85rem; padding: 8px 16px; border: 1px solid transparent; }
.btn-primary { background: var(--navy); border-color: var(--navy); }
.btn-primary:hover { background: var(--navy-700); border-color: var(--navy-700); }
.btn-accent { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-accent:hover { background: var(--orange-600); border-color: var(--orange-600); color: #fff; }
.btn-outline-secondary { border-color: var(--border); color: var(--ink); }
.btn-outline-secondary:hover { background: var(--navy-50); border-color: var(--navy-100); color: var(--navy); }
.btn-sm { padding: 6px 12px; font-size: 0.78rem; }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: 0.82rem; color: var(--ink); margin-bottom: 5px; }
.form-control, .form-select {
  border-radius: 9px; border: 1px solid var(--border); padding: 8px 12px; font-size: 0.88rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-100);
}
.form-section-title { font-weight: 700; font-size: 0.95rem; color: var(--navy); margin: 22px 0 4px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }

/* ---------- List groups ---------- */
.list-group-item { border-color: var(--border) !important; padding: 13px 18px; }
.list-group-item-action:hover { background: var(--navy-50); }

/* ---------- Alerts ---------- */
.alert-success { background: var(--success-100); color: #065F46; border: none; border-radius: var(--radius-sm); }
.alert-danger { background: var(--danger-100); color: #991B1B; border: none; border-radius: var(--radius-sm); }

/* ---------- Login page ---------- */
.login-shell { min-height: 100vh; display: flex; }
.login-aside {
  flex: 1.1; background: linear-gradient(160deg, var(--navy) 0%, #142049 100%);
  color: #fff; display: flex; flex-direction: column; justify-content: center;
  padding: 60px 64px; position: relative; overflow: hidden;
}
.login-aside::after {
  content: ''; position: absolute; right: -120px; bottom: -140px;
  width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(247,148,29,0.25) 0%, rgba(247,148,29,0) 70%);
}
.login-aside img {     width: 160px; filter: brightness(0) invert(1); margin-bottom: 28px; }
.login-aside h2 { font-size: 1.7rem; font-weight: 700; max-width: 380px; line-height: 1.3; }
.login-aside p { color: rgba(255,255,255,0.65); max-width: 360px; margin-top: 12px; }
.login-form-side { flex: 1; display: flex; align-items: center; justify-content: center; background: var(--surface); padding: 40px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; }
.login-card .sub { color: var(--muted); font-size: 0.88rem; margin-bottom: 26px; }
.login-demo-box {
  margin-top: 22px; background: var(--navy-50); border-radius: 10px;
  padding: 12px 14px; font-size: 0.76rem; color: var(--muted);
}
.login-demo-box code { color: var(--navy); font-weight: 600; }

@media (max-width: 900px) {
  .login-aside { display: none; }
}
