:root {
  --orange: #f97316;
  --orange-dark: #c2410c;
  --orange-soft: #fff3e8;
  --cream: #fff8ee;
  --gold: #d4a017;
  --charcoal: #1f2933;
  --muted: #6b7280;
  --border: #f0dfca;
  --shadow: 0 18px 45px rgba(74, 45, 21, .10);
}
* { box-sizing: border-box; }
body { font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: linear-gradient(135deg, var(--cream), #fff); color: var(--charcoal); }
h1,h2,h3,h4,h5,.section-title { font-family: 'Playfair Display', Georgia, serif; font-weight: 800; }
a { text-decoration: none; }
.eyebrow { display: inline-block; text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 800; color: var(--orange-dark); }
.btn-orange { background: linear-gradient(135deg, #ff9f43, var(--orange), var(--orange-dark)); border: 0; color: white; box-shadow: 0 10px 20px rgba(249,115,22,.25); font-weight: 800; }
.btn-orange:hover { color: white; transform: translateY(-1px); }
.btn-soft-orange { background: var(--orange-soft); color: var(--orange-dark); border: 1px solid #ffd7b1; font-weight: 800; }
.shadow-soft { box-shadow: var(--shadow); }
.bg-purple { background: #7c3aed; }
.text-orange-emphasis { color: #9a3412; }
.bg-orange-subtle { background: #ffedd5; }
.border-orange-subtle { border-color: #fed7aa !important; }

.login-body { min-height: 100vh; background: radial-gradient(circle at 20% 20%, rgba(255,184,107,.35), transparent 30%), linear-gradient(135deg, #32170b, #8a340b 55%, #f97316); display: grid; place-items: center; padding: 2rem; }
.login-shell { width: min(1120px, 100%); min-height: 650px; display: grid; grid-template-columns: 1.25fr .8fr; border-radius: 2rem; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.28); background: #fff; }
.login-hero { align-items: end; padding: 4rem; color: white; background: linear-gradient(rgba(22,16,10,.18), rgba(22,16,10,.65)), url('https://images.unsplash.com/photo-1581793745862-99fde7fa73d2?auto=format&fit=crop&w=1400&q=80') center/cover; }
.login-hero h1 { font-size: clamp(2.5rem, 5vw, 5rem); line-height: .95; }
.login-hero p { font-size: 1.1rem; max-width: 600px; color: rgba(255,255,255,.86); }
.login-badges { display: flex; gap: .7rem; flex-wrap: wrap; }
.login-badges span { background: rgba(255,255,255,.14); backdrop-filter: blur(8px); padding: .55rem .85rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.18); }
.login-card { padding: 4rem 3rem; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.login-card h2 { font-size: 2.25rem; }
.demo-hint { font-size: .85rem; color: var(--muted); background: #fff7ed; border-radius: 1rem; padding: .75rem; }

.crm-shell { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 1.25rem; background: linear-gradient(180deg, #2a160d, #3a1c0e 50%, #5b240b); color: white; z-index: 1040; }
.sidebar-brand { display: flex; gap: .8rem; align-items: center; color: white; padding: .5rem; margin-bottom: 1.5rem; }
.sidebar-brand small { display: block; color: rgba(255,255,255,.65); font-size: .75rem; }
.brand-mark { width: 44px; height: 44px; border-radius: 16px; display: inline-grid; place-items: center; background: linear-gradient(135deg, var(--gold), var(--orange)); color: white; font-family: 'Playfair Display'; font-weight: 900; box-shadow: 0 10px 25px rgba(249,115,22,.35); }
.sidebar-nav { display: grid; gap: .35rem; }
.sidebar .nav-link { color: rgba(255,255,255,.72); border-radius: 1rem; padding: .82rem 1rem; font-weight: 700; display: flex; gap: .75rem; align-items: center; }
.sidebar .nav-link:hover,.sidebar .nav-link.active { color: white; background: rgba(255,255,255,.13); }
.sidebar-footer { position: absolute; bottom: 1.25rem; left: 1.25rem; right: 1.25rem; }
.mini-profile { display: flex; gap: .7rem; align-items: center; padding: .75rem; border-radius: 1.25rem; background: rgba(255,255,255,.10); }
.mini-profile small { display: block; color: rgba(255,255,255,.62); }
.avatar-sm,.avatar-lg,.avatar-xl { display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: linear-gradient(135deg, var(--orange), var(--gold)); color: white; font-weight: 900; }
.avatar-sm { width: 38px; height: 38px; font-size: .8rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.2rem; }
.avatar-xl { width: 86px; height: 86px; font-size: 1.5rem; }
.main-content { min-width: 0; }
.topbar { background: rgba(255,248,238,.86); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); padding: 1rem 1.5rem; }
.content-wrap { padding: 1.5rem; }
.toast-stack { position: fixed; top: 82px; right: 20px; z-index: 2000; width: min(420px, calc(100% - 40px)); }

.hero-card { border-radius: 2rem; padding: 2rem; background: radial-gradient(circle at 82% 22%, rgba(255,255,255,.28), transparent 25%), linear-gradient(135deg, #32170b, #b45309, #f97316); color: white; box-shadow: var(--shadow); display: flex; justify-content: space-between; gap: 1.5rem; align-items: center; }
.hero-card h1 { font-size: clamp(2rem, 4vw, 4rem); margin-bottom: .5rem; }
.hero-card p { margin: 0; max-width: 720px; color: rgba(255,255,255,.82); }
.hero-score { min-width: 150px; aspect-ratio: 1; border-radius: 2rem; display: grid; place-items: center; text-align: center; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.18); }
.hero-score span { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; }
.hero-score strong { font-size: 2.1rem; font-family: 'Playfair Display'; }
.crm-card,.metric-card,.gamify-card,.salesman-card { background: rgba(255,255,255,.88); border: 1px solid rgba(240,223,202,.85); border-radius: 1.5rem; box-shadow: var(--shadow); padding: 1.25rem; }
.metric-card { position: relative; overflow: hidden; min-height: 132px; }
.metric-card span { color: var(--muted); font-weight: 800; font-size: .85rem; }
.metric-card strong { display: block; margin-top: .4rem; font-size: clamp(1.6rem, 2.5vw, 2.35rem); font-family: 'Playfair Display'; }
.metric-card i { position: absolute; right: 1.1rem; bottom: .8rem; font-size: 2.4rem; color: rgba(249,115,22,.18); }
.metric-card.hot i { color: rgba(239,68,68,.22); }
.metric-card.success i { color: rgba(22,163,74,.22); }
.metric-card.gold i { color: rgba(212,160,23,.30); }
.metric-card.danger i { color: rgba(220,38,38,.22); }
.gamify-card { background: linear-gradient(135deg, #fff, #fff7ed); }
.gamify-card span { font-weight: 900; color: var(--orange-dark); }
.gamify-card strong { display: block; font-size: 1.25rem; margin: .45rem 0 .2rem; }
.gamify-card small { color: var(--muted); }
.leaderboard { display: grid; gap: .65rem; }
.leader-row { color: var(--charcoal); display: flex; gap: .8rem; align-items: center; padding: .75rem; border-radius: 1rem; background: #fff8ee; border: 1px solid #ffe6c8; }
.leader-row:hover { background: #ffedd5; }
.rank { color: var(--orange-dark); font-weight: 900; width: 38px; }
.leader-row small { display: block; color: var(--muted); }
.target-item { margin-bottom: 1rem; }
.progress { height: .75rem; background: #f4e8d8; }
.progress-orange { background: linear-gradient(90deg, var(--orange), var(--gold)); }

.crm-table thead th { background: #fff7ed; color: #9a3412; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid var(--border); }
.crm-table tbody td { padding: 1rem; border-bottom: 1px solid #f6eadc; }
.crm-table small { display: block; color: var(--muted); margin-top: .1rem; }
.lead-link { color: var(--charcoal); font-weight: 900; }
.lead-link:hover { color: var(--orange-dark); }
.badge-hot { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.badge-warm { background: #ffedd5; color: #9a3412; border: 1px solid #fed7aa; }
.badge-cold { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }
.premium-tabs .nav-link { color: var(--charcoal); border-radius: 999px; font-weight: 800; }
.premium-tabs .nav-link.active { background: linear-gradient(135deg, var(--orange), var(--orange-dark)); }
.balance-preview { border-radius: 1rem; background: #fff7ed; border: 1px solid #fed7aa; padding: .68rem .85rem; font-weight: 900; color: #9a3412; }
.lead-profile-header { border-radius: 2rem; background: linear-gradient(135deg, #fff, #fff5e8); border: 1px solid var(--border); box-shadow: var(--shadow); padding: 1.5rem; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.lead-profile-header h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.4rem); }
.lead-profile-header p { margin: .35rem 0 0; color: var(--muted); }
.info-grid { display: grid; grid-template-columns: 130px 1fr; gap: .7rem 1rem; margin: 0; }
.info-grid dt { color: var(--muted); font-size: .82rem; }
.info-grid dd { margin: 0; font-weight: 700; }
.money-tile { border-radius: 1.2rem; background: #fff8ee; border: 1px solid #ffe6c8; padding: 1rem; }
.money-tile span { color: var(--muted); font-weight: 800; }
.money-tile strong { display: block; font-size: 1.5rem; font-family: 'Playfair Display'; }
.money-tile.danger strong { color: #b91c1c; }
.timeline { position: relative; display: grid; gap: 1rem; }
.timeline-item { position: relative; padding-left: 1.5rem; }
.timeline-item .dot { position: absolute; left: 0; top: .3rem; width: 10px; height: 10px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 5px #ffedd5; }
.timeline-item strong { display: block; }
.timeline-item small { color: var(--muted); }
.timeline-item p { margin: .25rem 0 0; color: #4b5563; }
.salesman-card { color: var(--charcoal); display: flex; gap: 1rem; align-items: center; transition: .2s ease; }
.salesman-card:hover { transform: translateY(-3px); color: var(--charcoal); }

@media (max-width: 991.98px) {
  .crm-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -290px; transition: left .25s ease; width: 280px; }
  .sidebar.show { left: 0; }
  .content-wrap { padding: 1rem; }
  .hero-card,.lead-profile-header { flex-direction: column; align-items: flex-start; }
  .login-shell { grid-template-columns: 1fr; min-height: auto; }
  .login-card { padding: 2.5rem 1.5rem; }
}
@media (max-width: 575.98px) {
  .topbar .eyebrow, .topbar h5 { display: none; }
  .info-grid { grid-template-columns: 1fr; }
  .hero-score { width: 130px; }
}

.invoice-sheet {
    background: #fff;
}

.info-pill {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 18px;
    padding: 14px;
}

.info-pill span {
    display: block;
    font-size: 12px;
    color: #7c5a36;
    margin-bottom: 4px;
}

.info-pill strong {
    color: #1f1f1f;
}

.invoice-table thead th {
    background: #fff7ed;
    color: #3f2f22;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 0;
}

.invoice-table td {
    border-color: #f2e7da;
}

.total-box {
    background: linear-gradient(180deg, #fff7ed, #ffffff);
    border: 1px solid #fed7aa;
}

.form-control,
.form-select {
    border-radius: 14px;
    border-color: #ead8c3;
}

.form-control:focus,
.form-select:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 .2rem rgba(249, 115, 22, .15);
}
