:root {
    --vcm-red: #C1272D;
    --vcm-ink: #15181d;
    --vcm-muted: #6d737c;
    --vcm-line: #e7e9ed;
    --vcm-surface: #ffffff;
    --vcm-bg: #f5f6f8;
    --vcm-radius: 18px;
}

.vcm-shell, .vcm-login-wrap {
    box-sizing: border-box;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--vcm-ink);
}
.vcm-shell *, .vcm-login-wrap * { box-sizing: border-box; }
.vcm-shell {
    max-width: 1440px;
    margin: 0 auto;
    padding: 28px 22px 80px;
}
.vcm-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}
.vcm-topbar h1 { margin: 2px 0 4px; font-size: clamp(30px, 4vw, 44px); line-height: 1.04; letter-spacing: -0.035em; }
.vcm-topbar p { margin: 0; color: var(--vcm-muted); }
.vcm-eyebrow { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--vcm-red); }
.vcm-top-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.vcm-btn, .vcm-action-btn, .vcm-icon-btn {
    appearance: none;
    border: 0;
    font: inherit;
    cursor: pointer;
    text-decoration: none !important;
    -webkit-tap-highlight-color: transparent;
}
.vcm-btn {
    min-height: 44px;
    border-radius: 12px;
    padding: 10px 16px;
    font-weight: 750;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.vcm-btn-primary { background: var(--vcm-red); color: #fff !important; box-shadow: 0 8px 24px rgba(193,39,45,.18); }
.vcm-btn-primary:hover { filter: brightness(.95); }
.vcm-btn-ghost { background: #fff; color: var(--vcm-ink) !important; border: 1px solid var(--vcm-line); }
.vcm-btn-dark { background: #20242a; color: #fff !important; }
.vcm-btn-large { min-height: 50px; padding-inline: 20px; }

.vcm-alert { border-radius: 13px; padding: 12px 15px; margin: 0 0 18px; font-weight: 650; }
.vcm-alert-success { background: #e9f8ef; color: #17653a; border: 1px solid #c9ecd6; }
.vcm-alert-error { background: #ffebed; color: #8f1f27; border: 1px solid #f3c6ca; }

.vcm-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.vcm-stat { background: #fff; border: 1px solid var(--vcm-line); border-radius: 16px; padding: 15px 16px; box-shadow: 0 4px 18px rgba(17,24,39,.04); }
.vcm-stat span { display: block; color: var(--vcm-muted); font-size: 13px; margin-bottom: 5px; }
.vcm-stat strong { font-size: 26px; line-height: 1; }
.vcm-stat-alert { background: #fff3e5; border-color: #ffd39d; }
.vcm-stat-alert strong { color: #a55200; }

.vcm-editor {
    display: none;
    margin: 0 0 18px;
    background: #fff;
    border: 1px solid var(--vcm-line);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 14px 40px rgba(17,24,39,.08);
}
.vcm-editor.is-open { display: block; animation: vcm-open .18s ease-out; }
@keyframes vcm-open { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.vcm-editor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.vcm-editor-head h2 { margin: 2px 0 0; font-size: 26px; }
.vcm-icon-btn { width: 42px; height: 42px; border-radius: 50%; background: #f3f4f6; font-size: 26px; line-height: 1; }
.vcm-client-form { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.vcm-field { min-width: 0; }
.vcm-field-wide { grid-column: span 2; }
.vcm-field-full { grid-column: 1 / -1; }
.vcm-field label { display: block; font-size: 13px; font-weight: 750; margin-bottom: 6px; }
.vcm-field input, .vcm-field select, .vcm-field textarea,
.vcm-filters input, .vcm-filters select {
    width: 100%;
    min-height: 48px;
    border: 1px solid #d8dce2;
    background: #fff;
    color: var(--vcm-ink);
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
    font-size: 16px;
    outline: none;
}
.vcm-field textarea { min-height: 100px; resize: vertical; }
.vcm-field input:focus, .vcm-field select:focus, .vcm-field textarea:focus,
.vcm-filters input:focus, .vcm-filters select:focus { border-color: var(--vcm-red); box-shadow: 0 0 0 3px rgba(193,39,45,.1); }
.vcm-form-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.vcm-filters {
    display: grid;
    grid-template-columns: minmax(260px,1fr) 200px 200px auto auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.vcm-search-field { position: relative; }
.vcm-search-field > span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--vcm-muted); font-size: 22px; pointer-events: none; }
.vcm-search-field input { padding-left: 40px; }
.vcm-clear { color: var(--vcm-red); font-weight: 700; text-decoration: none; padding: 8px; }

.vcm-desktop-table-wrap { overflow: hidden; border: 1px solid var(--vcm-line); border-radius: 18px; background: #fff; box-shadow: 0 6px 24px rgba(17,24,39,.05); }
.vcm-table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 0; }
.vcm-table th { text-align: left; padding: 12px 14px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #747b85; background: #f7f8fa; border-bottom: 1px solid var(--vcm-line); }
.vcm-table td { padding: 14px; border-bottom: 1px solid var(--vcm-line); vertical-align: top; background: var(--status-bg,#fff); }
.vcm-table tr:last-child td { border-bottom: 0; }
.vcm-table tr td:first-child { border-left: 5px solid var(--status-accent,#cfd4da); }
.vcm-table strong { display: block; font-size: 15px; }
.vcm-email { display: block; color: #5d6570; font-size: 12px; margin-top: 3px; overflow-wrap: anywhere; }
.vcm-category { display: inline-flex; gap: 7px; align-items: center; }
.vcm-status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border-radius: 999px; background: rgba(255,255,255,.7); border: 1px solid rgba(0,0,0,.06); font-size: 12px; font-weight: 750; white-space: nowrap; }
.vcm-note-preview { max-width: 260px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; font-size: 13px; line-height: 1.45; }
.vcm-muted { color: #a0a5ad; }
.vcm-followup-date { font-weight: 700; }

.vcm-status-new { --status-bg: #f6f9ff; --status-accent: #6b8fd8; }
.vcm-status-waiting { --status-bg: #fff9e8; --status-accent: #d6a422; }
.vcm-status-interested { --status-bg: #eef9f1; --status-accent: #3e9b5c; }
.vcm-status-follow-up { --status-bg: #fff4e8; --status-accent: #df7c18; }
.vcm-status-not-interested { --status-bg: #fff0f1; --status-accent: #cc4b55; }
.vcm-status-won { --status-bg: #f0f7f2; --status-accent: #217a42; }
.vcm-followup-due { box-shadow: inset 0 0 0 2px rgba(220,117,0,.16); }
.vcm-followup-due .vcm-followup-date { color: #a54d00; }

.vcm-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.vcm-actions form { margin: 0; }
.vcm-action-btn { min-height: 36px; min-width: 36px; border-radius: 9px; padding: 8px 9px; background: rgba(255,255,255,.82); border: 1px solid rgba(0,0,0,.08); color: #2b3037 !important; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.vcm-action-delete { color: #aa2832 !important; }
.vcm-table .vcm-action-btn span { display: none; }

.vcm-mobile-cards { display: none; }
.vcm-card { background: var(--status-bg,#fff); border: 1px solid var(--vcm-line); border-left: 6px solid var(--status-accent,#cfd4da); border-radius: 18px; padding: 15px; box-shadow: 0 6px 20px rgba(17,24,39,.055); }
.vcm-card-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.vcm-card-title-wrap { display: flex; gap: 10px; min-width: 0; }
.vcm-category-icon { width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.72); display: grid; place-items: center; font-size: 22px; flex: 0 0 auto; }
.vcm-card h2 { margin: 0 0 2px; font-size: 19px; line-height: 1.15; overflow-wrap: anywhere; }
.vcm-card-category { font-size: 12px; color: var(--vcm-muted); }
.vcm-mobile-email { display: block; margin: 11px 0; color: #333b45; text-decoration: none; font-size: 14px; overflow-wrap: anywhere; }
.vcm-card-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 11px 0; }
.vcm-card-dates > div { padding: 10px 11px; border-radius: 12px; background: rgba(255,255,255,.67); border: 1px solid rgba(0,0,0,.05); }
.vcm-card-dates span { display: block; font-size: 11px; color: var(--vcm-muted); margin-bottom: 2px; }
.vcm-card-dates strong { font-size: 13px; }
.vcm-card-note { font-size: 14px; line-height: 1.45; padding: 11px 0 3px; border-top: 1px solid rgba(0,0,0,.06); }
.vcm-actions-mobile { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.vcm-actions-mobile form { display: contents; }
.vcm-actions-mobile .vcm-action-btn { width: 100%; min-height: 46px; font-size: 13px; }
.vcm-actions-mobile .vcm-action-contact { grid-column: span 2; background: #20242a; color: #fff !important; border-color: #20242a; }

.vcm-empty { text-align: center; padding: 48px 20px; background: #fff; border: 1px dashed #d7dbe1; border-radius: 18px; }
.vcm-empty > div { font-size: 38px; }
.vcm-empty h2 { margin: 8px 0 4px; }
.vcm-empty p { margin: 0; color: var(--vcm-muted); }

.vcm-login-wrap { min-height: min(760px, 90vh); display: grid; place-items: center; padding: 30px 16px; background: radial-gradient(circle at top, #ffffff 0%, #f4f5f7 68%); }
.vcm-login-card { width: min(430px, 100%); background: #fff; border: 1px solid var(--vcm-line); border-radius: 24px; padding: 28px; box-shadow: 0 22px 60px rgba(17,24,39,.1); }
.vcm-brand-mark { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 17px; background: var(--vcm-red); color: #fff; font-size: 18px; font-weight: 900; margin-bottom: 18px; }
.vcm-login-card h1 { margin: 0 0 5px; font-size: 28px; letter-spacing: -.025em; }
.vcm-login-card > p { margin: 0 0 22px; color: var(--vcm-muted); }
#vcm-login-form p { margin: 0 0 13px; }
#vcm-login-form label { display: block; font-size: 13px; font-weight: 750; margin-bottom: 6px; }
#vcm-login-form input[type="text"], #vcm-login-form input[type="password"] { width: 100%; min-height: 50px; border: 1px solid #d8dce2; border-radius: 12px; padding: 10px 12px; font-size: 16px; }
#vcm-login-form .login-remember label { display: flex; align-items: center; gap: 8px; font-weight: 600; }
#vcm-login-form input[type="submit"] { width: 100%; min-height: 50px; border: 0; border-radius: 12px; background: var(--vcm-red); color: #fff; font-weight: 800; font-size: 15px; cursor: pointer; }

@media (max-width: 980px) {
    .vcm-client-form { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .vcm-filters { grid-template-columns: 1fr 1fr; }
    .vcm-search-field { grid-column: 1 / -1; }
    .vcm-desktop-table-wrap { display: none; }
    .vcm-mobile-cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
}

@media (max-width: 700px) {
    .vcm-shell { padding: 18px 12px 80px; }
    .vcm-topbar { display: block; margin-bottom: 16px; }
    .vcm-topbar p { font-size: 14px; }
    .vcm-top-actions { margin-top: 14px; justify-content: stretch; }
    .vcm-top-actions .vcm-btn-primary { flex: 1; }
    .vcm-stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
    .vcm-stat { padding: 12px; border-radius: 14px; }
    .vcm-stat strong { font-size: 22px; }
    .vcm-editor { padding: 16px 12px; border-radius: 16px; }
    .vcm-client-form { grid-template-columns: 1fr; gap: 12px; }
    .vcm-field-wide, .vcm-field-full { grid-column: auto; }
    .vcm-form-actions { display: grid; grid-template-columns: 1fr; }
    .vcm-filters { grid-template-columns: 1fr; gap: 8px; }
    .vcm-search-field { grid-column: auto; }
    .vcm-filters .vcm-btn { width: 100%; min-height: 48px; }
    .vcm-clear { text-align: center; }
    .vcm-mobile-cards { grid-template-columns: 1fr; gap: 10px; }
    .vcm-card { padding: 14px 13px; border-radius: 16px; }
    .vcm-card-top { display: block; }
    .vcm-card-top > .vcm-status-pill { margin-top: 10px; }
    .vcm-actions-mobile { grid-template-columns: 1fr 1fr; }
    .vcm-login-wrap { padding: 18px 12px; }
    .vcm-login-card { border-radius: 20px; padding: 23px 18px; }
}

@media (max-width: 390px) {
    .vcm-card-dates { grid-template-columns: 1fr; }
    .vcm-actions-mobile { grid-template-columns: 1fr; }
    .vcm-actions-mobile .vcm-action-contact { grid-column: auto; }
}

/* v1.1 sales goal + pricing */
.vcm-overview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 12px;
    align-items: stretch;
    margin-bottom: 18px;
}
.vcm-overview .vcm-stats { margin-bottom: 0; }
.vcm-goal-card {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
    background: linear-gradient(145deg, #ffffff, #fafafb);
    border: 1px solid var(--vcm-line);
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 4px 18px rgba(17,24,39,.04);
}
.vcm-goal-ring {
    --vcm-progress: 0%;
    width: 112px;
    height: 112px;
    flex: 0 0 112px;
    border-radius: 50%;
    padding: 10px;
    background: conic-gradient(var(--vcm-red) var(--vcm-progress), #eceff2 0);
    display: grid;
    place-items: center;
}
.vcm-goal-ring-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 3px;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.035);
}
.vcm-goal-ring-inner strong { align-self: center; font-size: 31px; line-height: 1; letter-spacing: -.04em; }
.vcm-goal-ring-inner span { align-self: center; color: var(--vcm-muted); font-size: 14px; font-weight: 750; }
.vcm-goal-copy { min-width: 0; flex: 1; }
.vcm-goal-copy h2 { margin: 2px 0 3px; font-size: 21px; line-height: 1.15; letter-spacing: -.02em; }
.vcm-goal-copy > p { margin: 0; color: var(--vcm-muted); font-size: 13px; line-height: 1.35; }
.vcm-goal-copy > p strong { color: var(--vcm-ink); font-size: 17px; }
.vcm-goal-settings { margin-top: 9px; }
.vcm-goal-settings summary { color: var(--vcm-red); font-size: 12px; font-weight: 800; cursor: pointer; user-select: none; }
.vcm-goal-settings form { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--vcm-line); }
.vcm-goal-settings label { display: block; margin-bottom: 5px; font-size: 11px; font-weight: 750; color: var(--vcm-muted); }
.vcm-goal-input-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
.vcm-goal-input-row input {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    border: 1px solid #d8dce2;
    border-radius: 11px;
    padding: 8px 10px;
    font: inherit;
    font-size: 16px;
    color: var(--vcm-ink);
    background: #fff;
}
.vcm-price { white-space: nowrap; font-size: 14px !important; }
.vcm-mobile-price {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 9px 0 11px;
    padding: 10px 11px;
    border-radius: 12px;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(0,0,0,.05);
}
.vcm-mobile-price span { color: var(--vcm-muted); font-size: 12px; }
.vcm-mobile-price strong { font-size: 17px; }
.vcm-field-hint { display: block; margin-top: 6px; color: var(--vcm-muted); font-size: 11px; line-height: 1.35; }

@media (max-width: 1100px) {
    .vcm-overview { grid-template-columns: 1fr; }
    .vcm-goal-card { justify-content: flex-start; }
}

@media (max-width: 700px) {
    .vcm-overview { gap: 9px; margin-bottom: 16px; }
    .vcm-goal-card { padding: 14px 13px; border-radius: 16px; gap: 14px; }
    .vcm-goal-ring { width: 98px; height: 98px; flex-basis: 98px; padding: 9px; }
    .vcm-goal-ring-inner strong { font-size: 27px; }
    .vcm-goal-copy h2 { font-size: 19px; }
    .vcm-goal-copy > p strong { font-size: 16px; }
    .vcm-goal-input-row .vcm-btn { min-height: 44px; padding-inline: 13px; }
}

@media (max-width: 390px) {
    .vcm-goal-card { align-items: flex-start; }
    .vcm-goal-ring { width: 86px; height: 86px; flex-basis: 86px; }
    .vcm-goal-ring-inner strong { font-size: 23px; }
}
