:root {
    --navy: #101826;
    --gold: #c9a24a;
    --gold-2: #e0c078;
    --cream: #f4efe6;
    --paper: #fffaf3;
    --ink: #161410;
    --muted: #6d675d;
    --line: #e4dccb;
    --new: #1d4ed8;
    --contacted: #c2410c;
    --converted: #047857;
    --danger: #b42318;
    --ok: #166534;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html, body, button, input, select, textarea {
    font-family: Poppins, sans-serif;
}
body {
    color: var(--ink);
    background: #0c1118;
    min-height: 100vh;
}

a { color: inherit; }
h1, h2 { font-family: Poppins, sans-serif; margin: 0; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; }

.phone {
    width: min(430px, 100%);
    min-height: 100vh;
    margin: 0 auto;
    background: var(--cream);
    display: flex;
    flex-direction: column;
}

.contact-body {
    background: #f3f3f3;
    font-family: Poppins, sans-serif;
    -webkit-font-smoothing: antialiased;
}
.contact-body,
.contact-body button,
.contact-body input,
.contact-body select,
.contact-body textarea {
    font-family: Poppins, sans-serif;
}
.contact-screen {
    position: relative;
    background: #fff;
    overflow: visible;
    min-height: 100vh;
}
.contact-banner {
    position: relative;
    z-index: 2;
    width: 100%;
    line-height: 0;
    background: #05070d;
}
.contact-banner img {
    display: block;
    width: 100%;
    height: auto;
}
.contact-blobs {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}
.blob {
    position: absolute;
    background: #7b61ff;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}
.blob-tr {
    width: 210px;
    height: 210px;
    top: -88px;
    right: -78px;
}
.blob-bl {
    width: 170px;
    height: 170px;
    bottom: -70px;
    left: -80px;
}
.contact-logout {
    position: relative;
    z-index: 2;
    display: inline-block;
    align-self: flex-end;
    margin: 12px 24px 0;
    font-size: .8rem;
    color: #8a8a8a;
    text-decoration: none;
}
.contact-main {
    position: relative;
    z-index: 1;
    padding: 28px 28px 40px;
}
.contact-screen h1 {
    font-family: Poppins, sans-serif;
    font-size: 2.15rem;
    font-weight: 800;
    letter-spacing: -.04em;
    color: #111;
    line-height: 1.15;
}
.contact-lead {
    margin: 12px 0 28px;
    color: #8d8d8d;
    font-size: .95rem;
    font-weight: 500;
    line-height: 1.6;
    max-width: 34ch;
}
.contact-form {
    display: grid;
    gap: 14px;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.contact-screen input,
.contact-screen select,
.contact-screen textarea {
    width: 100%;
    border: 0;
    background: #f2f2f2;
    border-radius: 7px;
    padding: 8px 18px;
    min-height: 45px;
    color: #1a1a1a;
    font-size: 1rem;
    font-weight: 500;
}
.contact-screen textarea {
    min-height: 130px;
    resize: none;
}
.contact-screen input::placeholder,
.contact-screen textarea::placeholder {
    color: #9a9a9a;
}
.contact-screen input:focus,
.contact-screen select:focus,
.contact-screen textarea:focus {
    outline: 2px solid #7b61ff66;
    background: #f7f5ff;
}
.phone-row {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 10px;
}
.dial-code-wrap {
    position: relative;
    z-index: 5;
}
.dial-code-wrap::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 22px;
    border: 4px solid transparent;
    border-top-color: #1a1a1a;
    border-bottom-width: 0;
    transform: translateY(-35%);
    pointer-events: none;
}
.dial-code-wrap.is-open::after {
    border-top-color: transparent;
    border-bottom-color: #1a1a1a;
    border-bottom-width: 4px;
    border-top-width: 0;
    top: 20px;
}
.contact-screen .dial-code {
    display: flex;
    align-items: center;
    width: 100%;
    border: 0;
    background: #f2f2f2;
    border-radius: 7px;
    min-height: 45px;
    padding: 8px 28px 8px 12px;
    color: #1a1a1a;
    font: inherit;
    font-size: .92rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}
.contact-screen .dial-code:focus {
    outline: 2px solid #7b61ff66;
    background: #f7f5ff;
}
.dial-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: min(340px, calc(100vw - 56px));
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(16, 16, 16, .16);
    z-index: 40;
    padding: 8px;
}
.dial-menu[hidden] {
    display: none;
}
.contact-screen .dial-search {
    min-height: 40px;
    margin-bottom: 6px;
    padding: 8px 12px;
    font-size: .9rem;
    background: #f2f2f2;
}
.dial-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 220px;
    overflow: auto;
}
.dial-option {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: .9rem;
    font-weight: 500;
    color: #1a1a1a;
}
.dial-option[hidden] {
    display: none;
}
.dial-option span:last-child {
    color: #8a8a8a;
    flex-shrink: 0;
}
.dial-option:hover,
.dial-option.is-active {
    background: #f2f2f2;
}
.dial-option.is-selected {
    background: #f7f5ff;
    font-weight: 700;
}
.dial-empty {
    margin: 0;
    padding: 14px 8px;
    text-align: center;
    color: #8a8a8a;
    font-size: .88rem;
}
.btn-ink {
    justify-self: start;
    width: auto;
    min-width: 124px;
    margin-top: 8px;
    border: 0;
    border-radius: 12px;
    padding: 13px 28px;
    background: #2d3436;
    color: #fff;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.mailbox { width: 168px; margin: 0 auto 18px; }
.success-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(16, 16, 16, .48);
    display: grid;
    place-items: center;
    padding: 20px;
}
.success-card {
    width: min(360px, 100%);
    background: #fff;
    border-radius: 20px;
    padding: 28px 24px 24px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(16, 16, 16, .22);
}
.success-card h2 {
    margin: 0 0 10px;
    font-family: Poppins, sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -.04em;
    color: #111;
}
.success-card p {
    margin: 0 0 16px;
    color: #8d8d8d;
    font-size: .95rem;
    font-weight: 500;
    line-height: 1.65;
}
.success-card .success-mail {
    color: #5b46c8;
    font-weight: 700;
}
.success-card .btn-ink {
    justify-self: center;
    margin: 8px auto 0;
}

.page { padding: 16px 16px 32px; flex: 1; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--navy);
    color: #f7f2e8;
    position: sticky;
    top: 0;
    z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand strong { font-family: Poppins, sans-serif; font-size: 1.05rem; font-weight: 600; }
.brand-mark {
    width: 34px; height: 34px; border-radius: 9px;
    display: grid; place-items: center;
    background: linear-gradient(145deg, var(--gold-2), var(--gold));
    color: var(--navy); font-weight: 800; font-size: .8rem;
}
.logout { color: #fff; font-size: .85rem; text-decoration: none; opacity: .85; }

.hero { margin: 4px 0 14px; }

.card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
}

.stack { display: grid; gap: 14px; }
.is-hidden { display: none !important; }

label { display: grid; gap: 6px; font-size: .86rem; font-weight: 600; }
input, select, textarea {
    font: inherit; font-weight: 500;
    border: 1px solid #d8d0c0; border-radius: 12px;
    padding: 12px 14px; background: #fff; color: var(--ink);
    width: 100%;
}
input:focus, select:focus, textarea:focus {
    outline: 2px solid #c9a24a66; border-color: var(--gold);
}
.req { color: var(--danger); }

.btn {
    border: 0; border-radius: 999px; padding: 14px 18px; width: 100%;
    font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
    display: inline-flex; align-items: center; justify-content: center;
}
.btn-gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--navy); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); padding: 10px 12px; font-size: .8rem; width: auto; }

.alert { border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-size: .9rem; }
.alert ul { margin: 0; padding-left: 18px; }
.alert-ok { background: #ecfdf3; color: var(--ok); border: 1px solid #bbf7d0; }
.alert-error { background: #fef3f2; color: var(--danger); border: 1px solid #fecaca; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.stat {
    background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
    text-decoration: none; display: flex; justify-content: space-between; align-items: baseline;
}
.stat span { color: var(--muted); font-size: .75rem; }
.stat strong { font-family: Poppins, sans-serif; font-size: 1.25rem; font-weight: 600; }
.stat.is-on { border-color: var(--navy); background: var(--navy); color: #fff; }
.stat.is-on span { color: var(--gold-2); }

.filters { display: grid; gap: 8px; margin-bottom: 12px; }

.lead-list { display: grid; gap: 10px; }
.lead-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
}
.lead-card.is-open { border-color: var(--gold); }
.lead-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.name-link { font-weight: 700; text-decoration: none; font-size: 1.05rem; }
.lead-card p { margin: 6px 0; display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; }
.lead-card p span { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; flex-shrink: 0; }
.empty { text-align: center; color: var(--muted); padding: 24px 0; }

.status-select {
    border: 0; border-radius: 999px; padding: 7px 10px; font-weight: 700; font-size: .75rem; width: auto; min-width: 110px;
}
.status-new { background: #dbeafe; color: var(--new); }
.status-contacted { background: #ffedd5; color: var(--contacted); }
.status-converted { background: #d1fae5; color: var(--converted); }

.drawer { margin-top: 12px; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.detail-list { display: grid; gap: 12px; margin: 0; }
.detail-list dt { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.detail-list dd { margin: 4px 0 0; font-weight: 600; }

.two-col { display: grid; gap: 12px; }
.table-wrap { overflow: auto; padding: 0; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); font-size: .85rem; }
.data-table th { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

.auth-body { background: var(--navy); }
.auth-body .auth-card {
    width: min(430px, 100%);
    min-height: 100vh;
    margin: 0 auto;
    background: var(--paper);
    padding: 48px 20px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand .brand-mark { margin: 0 auto 12px; }
.auth-brand h1 { font-size: 2rem; }
.auth-brand p { color: var(--muted); margin: 6px 0 0; }
.demo-box { margin-top: 18px; background: #f7f1e4; border-radius: 14px; padding: 12px 14px; font-size: .8rem; color: var(--muted); }
.demo-box ul { margin: 8px 0 0; padding-left: 18px; }
.demo-box code { color: var(--navy); }
