:root {
    /* Emerald + slate palette — fresh, not navy */
    --emerald:      #10B981;
    --emerald-dark: #059669;
    --emerald-deep: #047857;
    --emerald-tint: #ECFDF5;
    --slate-ink:    #0F172A;
    --slate-700:    #334155;
    --slate-500:    #64748B;
    --slate-300:    #CBD5E1;
    --slate-200:    #E2E8F0;
    --slate-100:    #F1F5F9;
    --slate-50:     #F8FAFC;
    --white:        #FFFFFF;
    --danger:       #E11D48;
    --warning:      #D97706;

    --radius:       10px;
    --radius-sm:    6px;
    --shadow:       0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04);
    --shadow-lg:    0 10px 30px rgba(15,23,42,.10);

    --font-display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
    --font-body:    'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    color: var(--slate-ink);
    background: var(--slate-50);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--emerald-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; color: var(--slate-ink); }
h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }

.muted { color: var(--slate-500); }
.text-success { color: var(--emerald-dark); }
.right { text-align: right; }
.num { font-variant-numeric: tabular-nums; }
.mt-2 { margin-top: 16px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 16px; border-radius: var(--radius-sm);
    border: 1px solid var(--slate-200); background: var(--white);
    color: var(--slate-700); font-size: 14px; font-weight: 500;
    cursor: pointer; text-decoration: none; transition: all .12s;
}
.btn:hover { border-color: var(--slate-300); text-decoration: none; }
.btn-primary {
    background: var(--emerald); border-color: var(--emerald);
    color: var(--white);
}
.btn-primary:hover { background: var(--emerald-dark); border-color: var(--emerald-dark); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ---------- Auth / marketing pages ---------- */
.auth-wrap {
    min-height: 100vh; display: flex; align-items: center;
    justify-content: center; padding: 24px;
    background:
        radial-gradient(1200px 500px at 80% -10%, var(--emerald-tint), transparent),
        var(--slate-50);
}
.auth-card {
    width: 100%; max-width: 420px; background: var(--white);
    border: 1px solid var(--slate-200); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: 36px;
}
.auth-card .brand {
    font-family: var(--font-display); font-weight: 700; font-size: 22px;
    letter-spacing: -0.03em; margin-bottom: 4px; color: var(--slate-ink);
}
.auth-card .brand span { color: var(--emerald); }
.auth-card h1 { font-size: 22px; margin: 18px 0 4px; }
.auth-card .sub { color: var(--slate-500); font-size: 14px; margin-bottom: 20px; }

.form-field { margin-bottom: 14px; }
.form-field label {
    display: block; font-size: 13px; font-weight: 500;
    color: var(--slate-700); margin-bottom: 5px;
}
.form-field input, .form-field select, .form-field textarea {
    width: 100%; padding: 10px 12px; font-size: 14px;
    border: 1px solid var(--slate-300); border-radius: var(--radius-sm);
    font-family: inherit; color: var(--slate-ink); background: var(--white);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
    outline: none; border-color: var(--emerald);
    box-shadow: 0 0 0 3px var(--emerald-tint);
}
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 18px; }

.flash { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 14px; }
.flash-error { background: #FEF2F2; color: var(--danger); border: 1px solid #FECACA; }
.flash-success { background: var(--emerald-tint); color: var(--emerald-deep); border: 1px solid #A7F3D0; }

.auth-foot { margin-top: 18px; font-size: 13px; color: var(--slate-500); text-align: center; }

/* ---------- App shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 230px; background: var(--slate-ink); color: var(--slate-300);
    display: flex; flex-direction: column; flex-shrink: 0;
}
.sidebar .brand {
    font-family: var(--font-display); font-weight: 700; font-size: 20px;
    color: var(--white); padding: 20px; letter-spacing: -0.03em;
}
.sidebar .brand span { color: var(--emerald); }
.sidebar nav { flex: 1; padding: 8px; }
.sidebar nav a {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    color: var(--slate-300); border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500; margin-bottom: 2px;
}
.sidebar nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: var(--white); }
.sidebar nav a.active { background: var(--emerald); color: var(--white); }
.sidebar-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; }
.sidebar-foot a { color: var(--slate-300); }

.main { flex: 1; min-width: 0; }
.topbar {
    background: var(--white); border-bottom: 1px solid var(--slate-200);
    padding: 0 24px; height: 56px; display: flex; align-items: center;
    justify-content: space-between;
}
.topbar .ws-name { font-weight: 600; font-size: 14px; }
.topbar .trial-pill {
    background: var(--emerald-tint); color: var(--emerald-deep);
    padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 500;
}
.content { padding: 24px; max-width: 1200px; }

.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }

/* ---------- Cards / stats ---------- */
.card {
    background: var(--white); border: 1px solid var(--slate-200);
    border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat {
    background: var(--white); border: 1px solid var(--slate-200);
    border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
.stat .label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--slate-500); }
.stat .value { font-family: var(--font-display); font-size: 26px; font-weight: 700; margin-top: 4px; }
.stat .value.emerald { color: var(--emerald-dark); }

/* ---------- Tables ---------- */
.tbl-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--slate-200); border-radius: var(--radius); }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 11px 14px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--slate-100); }
.tbl th { background: var(--slate-50); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--slate-500); font-weight: 600; }
.tbl tbody tr:hover { background: var(--slate-50); }

.stage-badge {
    display: inline-block; padding: 3px 9px; border-radius: 999px;
    font-size: 12px; font-weight: 500; background: var(--slate-100); color: var(--slate-700);
}
.stage-badge.won { background: var(--emerald-tint); color: var(--emerald-deep); }
.stage-badge.lost { background: #FEF2F2; color: var(--danger); }
.stage-badge.proposal { background: #EFF6FF; color: #1D4ED8; }
.stage-badge.qualified { background: #F5F3FF; color: #6D28D9; }

.empty-state { padding: 40px; text-align: center; color: var(--slate-500); }

/* ---------- Landing ---------- */
.lp-nav { display: flex; justify-content: space-between; align-items: center; padding: 20px 32px; max-width: 1100px; margin: 0 auto; }
.lp-nav .brand { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.03em; }
.lp-nav .brand span { color: var(--emerald); }
.lp-hero { max-width: 1100px; margin: 0 auto; padding: 80px 32px; text-align: center; }
.lp-hero h1 { font-size: 56px; line-height: 1.05; margin-bottom: 20px; }
.lp-hero h1 .accent { color: var(--emerald); }
.lp-hero p { font-size: 20px; color: var(--slate-500); max-width: 600px; margin: 0 auto 32px; }
.lp-hero .cta-row { display: flex; gap: 12px; justify-content: center; }
.lp-hero .btn { padding: 13px 24px; font-size: 16px; }
.lp-features { max-width: 1100px; margin: 0 auto; padding: 40px 32px 80px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.lp-feature h3 { margin-bottom: 8px; }
.lp-feature p { color: var(--slate-500); font-size: 15px; }
.lp-price-note { font-size: 14px; color: var(--slate-500); margin-top: 14px; }

@media (max-width: 860px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .lp-features { grid-template-columns: 1fr; }
    .lp-hero h1 { font-size: 38px; }
    .sidebar { position: fixed; left: -230px; top: 0; bottom: 0; z-index: 50; transition: left .2s; }
    .sidebar.open { left: 0; }
    .hamburger { display: inline-flex !important; }
}
.hamburger { display: none; background: var(--slate-ink); color: #fff; border: none; padding: 8px 12px; border-radius: var(--radius-sm); font-size: 18px; cursor: pointer; }
