/* CliniContact Bridge — design tokens + shared components
   Palette sourced from Vision so product suite stays visually consistent. */
:root {
    --cc-navy: #0c1b46;
    --cc-royal: #2550e6;
    --cc-sky: #5ebeff;
    --cc-mint: #e9fbf4;
    --cc-ink: #14213d;
    --cc-muted: #62708b;
    --cc-line: rgba(19, 38, 86, 0.12);
}

.text-cc-royal { color: var(--cc-royal); }
.text-cc-navy  { color: var(--cc-navy); }
.text-cc-ink   { color: var(--cc-ink); }
.text-cc-muted { color: var(--cc-muted); }
.bg-cc-mint    { background-color: var(--cc-mint); }
.bg-cc-navy    { background-color: var(--cc-navy); }
.bg-cc-royal   { background-color: var(--cc-royal); }
.bg-cc-ink     { background-color: var(--cc-ink); }

.surface-card {
    background: #fff;
    border: 1px solid var(--cc-line);
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(19, 38, 86, 0.04), 0 8px 24px rgba(19, 38, 86, 0.04);
}

.glass-card {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: saturate(160%) blur(14px);
    border: 1px solid var(--cc-line);
    border-radius: 28px;
}

.cc-input {
    width: 100%;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #0f172a;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.cc-input:focus {
    outline: none;
    border-color: var(--cc-royal);
    box-shadow: 0 0 0 4px rgba(37, 80, 230, 0.15);
    background-color: #fff;
}

.cc-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 14px;
    padding: 0.625rem 1.125rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background-color 0.15s, transform 0.05s;
}
.cc-btn-primary {
    background-color: var(--cc-royal);
    color: #fff;
}
.cc-btn-primary:hover { background-color: #1e42bf; }
.cc-btn-primary:active { transform: translateY(1px); }
.cc-btn-ghost {
    background-color: #f1f5f9;
    color: #0f172a;
}
.cc-btn-ghost:hover { background-color: #e2e8f0; }

.cc-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--cc-mint);
    color: var(--cc-navy);
}
.cc-chip.muted { background: #eef2f7; color: var(--cc-muted); }
.cc-chip.warn  { background: #fef3c7; color: #92400e; }
.cc-chip.ok    { background: #dcfce7; color: #065f46; }

.cc-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--cc-muted);
    margin-bottom: 0.5rem;
}

.portal-shell {
    background:
        radial-gradient(circle at top left, rgba(94, 190, 255, 0.18), transparent 24rem),
        linear-gradient(180deg, #eef7ff 0%, #f7fbff 45%, #f8fafc 100%);
    border: 1px solid rgba(94, 190, 255, 0.2);
    border-radius: 30px;
    box-shadow: 0 24px 60px rgba(37, 80, 230, 0.08);
}

.portal-hero {
    background:
        radial-gradient(circle at top right, rgba(94, 190, 255, 0.35), transparent 24rem),
        radial-gradient(circle at top left, rgba(94, 190, 255, 0.14), transparent 18rem),
        linear-gradient(135deg, #0c1b46 0%, #1d3794 55%, #4fa7ff 100%);
    color: #fff;
    border-radius: 28px;
    overflow: hidden;
}

.portal-panel {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.portal-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0.875rem 0.125rem;
    margin-right: 1.75rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--cc-muted);
}

.portal-tab.active {
    color: var(--cc-royal);
}

.portal-tab.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 3px;
    border-radius: 999px;
    background: var(--cc-royal);
}

.metric-card {
    border: 1px solid rgba(19, 38, 86, 0.08);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(19, 38, 86, 0.05);
}

.metric-card-soft {
    border: 1px solid rgba(19, 38, 86, 0.08);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 255, 0.95));
}

.series-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 2fr) auto;
    gap: 0.9rem;
    align-items: center;
}

.series-bar {
    height: 0.7rem;
    border-radius: 999px;
    background: #e9eef7;
    overflow: hidden;
}

.series-bar-fill {
    height: 100%;
    border-radius: inherit;
}

.trend-stack {
    display: flex;
    align-items: end;
    gap: 0.45rem;
    height: 210px;
    /* Safety: clip any segments that exceed the container despite the
       widthratio scaling on the template side. Prevents the chart from
       visually leaking into adjacent cards if the math is ever off. */
    overflow: hidden;
}

.trend-column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: end;
    gap: 0.2rem;
}

.trend-segment {
    width: 100%;
    border-radius: 10px 10px 0 0;
}

.usa-map {
    position: relative;
    min-height: 356px;
    border-radius: 24px;
    background:
        radial-gradient(circle at 18% 18%, rgba(94, 190, 255, 0.22), transparent 22%),
        linear-gradient(180deg, rgba(37, 80, 230, 0.03), rgba(94, 190, 255, 0.08));
    border: 1px solid rgba(19, 38, 86, 0.08);
    overflow: hidden;
}

.usa-map-mainland,
.usa-map-alaska,
.usa-map-hawaii {
    position: absolute;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(226, 237, 252, 0.96));
    border: 1px solid rgba(19, 38, 86, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.usa-map-mainland {
    left: 8%;
    top: 11%;
    width: 78%;
    height: 66%;
    clip-path: polygon(4% 12%, 10% 4%, 18% 5%, 23% 2%, 35% 4%, 42% 10%, 54% 8%, 63% 13%, 74% 10%, 83% 16%, 92% 18%, 98% 29%, 95% 41%, 98% 51%, 92% 62%, 86% 63%, 84% 72%, 77% 77%, 72% 91%, 61% 92%, 56% 87%, 48% 88%, 43% 83%, 36% 82%, 30% 73%, 22% 68%, 16% 62%, 10% 54%, 6% 44%, 3% 32%);
}

.usa-map-alaska {
    left: 8%;
    bottom: 10%;
    width: 18%;
    height: 12%;
    clip-path: polygon(4% 48%, 15% 28%, 34% 24%, 45% 30%, 64% 22%, 86% 32%, 95% 46%, 84% 58%, 70% 62%, 54% 74%, 28% 72%, 10% 62%);
}

.usa-map-hawaii {
    left: 29%;
    bottom: 12%;
    width: 10%;
    height: 6%;
    clip-path: polygon(5% 52%, 20% 34%, 42% 40%, 60% 22%, 84% 36%, 92% 58%, 74% 72%, 38% 70%, 18% 66%);
}

.usa-map-point {
    position: absolute;
    z-index: 2;
    transform: translate(-50%, -50%);
    width: calc(12px + (var(--point-alpha) * 14px));
    height: calc(12px + (var(--point-alpha) * 14px));
    border-radius: 999px;
    border: 1px solid rgba(37, 80, 230, 0.18);
    background: linear-gradient(
        180deg,
        rgba(94, 190, 255, calc(0.26 + (var(--point-alpha) * 0.34))),
        rgba(37, 80, 230, calc(0.48 + (var(--point-alpha) * 0.24)))
    );
    box-shadow: 0 10px 22px rgba(37, 80, 230, 0.18);
    opacity: 0.92;
}

.timeline-track {
    height: 0.75rem;
    border-radius: 999px;
    overflow: hidden;
    background: #e6edf8;
}

.timeline-track-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--cc-sky), var(--cc-royal));
}

.assistant-bubble {
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(94, 190, 255, 0.16), rgba(37, 80, 230, 0.06));
    border: 1px solid rgba(37, 80, 230, 0.08);
}

.pie-card {
    width: 168px;
    height: 168px;
    margin: 0 auto;
    border-radius: 999px;
    background: conic-gradient(var(--pie-stops));
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(19, 38, 86, 0.05);
}

.pie-card::after {
    content: "";
    position: absolute;
    inset: 24px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(19, 38, 86, 0.04);
}

.pie-card-center {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.pie-card-center span {
    font-size: 1.9rem;
    font-weight: 900;
    color: var(--cc-ink);
    line-height: 1;
}

.pie-card-center small {
    margin-top: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cc-muted);
}

.lead-table-card {
    overflow: hidden;
}

.lead-table-shell {
    overflow-x: auto;
    max-width: 100%;
}

.lead-table {
    width: 100%;
    border-collapse: collapse;
}

.lead-table th,
.lead-table td {
    vertical-align: top;
}

.row-open-cell {
    cursor: pointer;
}

.lead-row {
    cursor: pointer;
}

.lead-row:hover td {
    background-color: rgba(37, 80, 230, 0.025);
}

/* Action dropdown — native <details> menu, click-toggle, click-outside-to-close via JS */
.lead-actions-menu {
    position: relative;
}

.lead-actions-menu summary {
    list-style: none;
    user-select: none;
}

.lead-actions-menu summary::-webkit-details-marker {
    display: none;
}

.lead-actions-popover {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 30;
    min-width: 12rem;
    background: #fff;
    border: 1px solid var(--cc-line);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(19, 38, 86, 0.12);
    padding: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.lead-actions-item {
    display: block;
    width: 100%;
    padding: 0.55rem 0.75rem;
    text-align: left;
    font-size: 0.8125rem;
    border-radius: 10px;
    color: var(--cc-ink);
    background: transparent;
    border: 0;
    cursor: pointer;
}

.lead-actions-item:hover {
    background: rgba(37, 80, 230, 0.08);
    color: var(--cc-royal);
}

/* Email type tags — Direct vs Generic discrimination on lead tables */
.email-tag {
    display: inline-block;
    padding: 1px 6px;
    margin-right: 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
}
.email-tag-direct {
    background: #dcfce7;
    color: #065f46;
}
.email-tag-generic {
    background: #fef3c7;
    color: #92400e;
}

@media (max-width: 768px) {
    .usa-map {
        min-height: 308px;
    }

    .usa-map-point {
        width: calc(10px + (var(--point-alpha) * 11px));
        height: calc(10px + (var(--point-alpha) * 11px));
    }
}

/* ── Partner network additions ────────────────────────────────────────
   Added with the /partners/ portal. All build on tokens defined above —
   no new colors, just compositions used by registration cards, value
   props, glyph badges, etc. See design_handoff_partner_network.       */

.cc-chip.royal {
    background: rgba(37, 80, 230, 0.12);
    color: var(--cc-royal);
}

.cc-btn-navy {
    background-color: var(--cc-navy);
    color: #fff;
}
.cc-btn-navy:hover { background-color: #0a1638; }
.cc-btn-navy:active { transform: translateY(1px); }

.type-card {
    display: block;
    width: 100%;
    text-align: left;
    border: 1px solid var(--cc-line);
    border-radius: 16px;
    background: #fff;
    padding: 1rem 1.125rem;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    cursor: pointer;
}
.type-card:hover { border-color: rgba(37, 80, 230, 0.4); }
.type-card.selected {
    border-color: var(--cc-royal);
    background: rgba(37, 80, 230, 0.04);
    box-shadow: 0 0 0 3px rgba(37, 80, 230, 0.12);
}

.glyph-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    background: rgba(37, 80, 230, 0.12);
    color: var(--cc-royal);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.divider-or {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--cc-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    margin: 1.5rem 0;
}
.divider-or::before,
.divider-or::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--cc-line);
}

.placeholder-tile {
    border: 1px dashed rgba(19, 38, 86, 0.24);
    background:
        repeating-linear-gradient(
            45deg,
            rgba(19, 38, 86, 0.04) 0 10px,
            transparent 10px 20px
        );
    border-radius: 18px;
    padding: 1.25rem;
    color: var(--cc-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.75rem;
}

/* Respect prefers-reduced-motion: collapse the small transitions on
   type-card / cc-btn so users with motion sensitivity don't get the
   hover/press bounce. */
@media (prefers-reduced-motion: reduce) {
    .type-card,
    .cc-btn,
    .cc-btn-primary,
    .cc-btn-ghost,
    .cc-btn-navy,
    .cc-input {
        transition: none !important;
    }
    .cc-btn-primary:active,
    .cc-btn-navy:active {
        transform: none !important;
    }
}
