/* Self-contained utility stylesheet -- no CDN, no build step, no internet
   dependency at runtime. Deliberately a small hand-written subset of
   Tailwind-style utility classes covering exactly what this app's templates
   use, so the platform renders identically whether the server has internet
   access or not. */

:root {
    /* RadCare Services brand palette, sampled from radcareservices.com and the
       company logo: deep indigo/purple for identity, lavender accent, sage
       green for calls to action, near-white lavender page background. */
    --brand-purple: #3d2e69;
    --brand-purple-dark: #2f2350;
    --brand-lavender: #ac87fc;
    --brand-lavender-light: #e6deee;
    --brand-lavender-band: #d1bef0;
    --brand-green: #415f4d;
    --brand-green-dark: #344d3e;

    --slate-50: #fbf9fe;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    --red-50: #fef2f2;
    --red-100: #fee2e2;
    --red-200: #fecaca;
    --red-600: #dc2626;
    --red-700: #b91c1c;

    --amber-100: #fef3c7;
    --amber-700: #b45309;

    --emerald-50: #ecfdf5;
    --emerald-200: #a7f3d0;
    --emerald-700: #047857;
    --emerald-800: #065f46;
}

* { box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
}
table { border-collapse: collapse; }
.block { display: block; }
/* Label/value pairs on detail pages (e.g. account_detail.html). */
dl, dd { margin: 0; }
.field dd { overflow-wrap: anywhere; white-space: pre-line; }
/* Multi-select filter dropdowns (accounts.html). */
.multi-select { position: relative; }
.multi-select summary { cursor: pointer; list-style: none; user-select: none; }
.multi-select summary::-webkit-details-marker { display: none; }
.multi-select summary::after { content: " \25BE"; color: #94a3b8; }
.multi-select-panel {
    position: absolute; z-index: 20; top: calc(100% + 4px); left: 0;
    min-width: 240px; max-width: 360px; max-height: 320px; overflow-y: auto; padding: 0.5rem;
}
.multi-select-option { padding: 0.25rem 0.25rem; cursor: pointer; border-radius: 0.25rem; }
.multi-select-option:hover { background: #f8fafc; }
/* Scrollable related-record tables (account_detail.html). */
.scroll-box { max-height: 420px; overflow-y: auto; }
.scroll-box thead th { position: sticky; top: 0; background: white; }

/* CMS match confidence badges. */
.confidence-high { background: #d1fae5; color: #065f46; }
.confidence-medium { background: #fef3c7; color: #92400e; }
.confidence-low { background: #fee2e2; color: #991b1b; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; }
input, select { font: inherit; }
code { background: var(--slate-100); padding: 0.1rem 0.35rem; border-radius: 0.25rem; font-size: 0.85em; }

/* Layout */
.flex { display: flex; }
.grid { display: grid; }
.flex-1 { flex: 1 1 0%; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.ml-auto { margin-left: auto; }
.space-y-4 > * + * { margin-top: 1rem; }
.overflow-x-auto { overflow-x: auto; }
.min-h-screen { min-height: 100vh; }

@media (min-width: 768px) {
    .md\:flex { display: flex; }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Sizing */
.w-full { width: 100%; }
.max-w-sm { max-width: 24rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-7xl { max-width: 80rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Spacing */
.p-4 { padding: 1rem; } .p-5 { padding: 1.25rem; } .p-6 { padding: 1.5rem; } .p-8 { padding: 2rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-4 { padding-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; } .mb-2 { margin-bottom: 0.5rem; } .mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; } .mb-6 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.25rem; } .mt-2 { margin-top: 0.5rem; } .mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; } .mt-8 { margin-top: 2rem; } .mt-10 { margin-top: 2.5rem; } .mt-24 { margin-top: 6rem; }
.whitespace-nowrap { white-space: nowrap; }

/* Typography */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.025em; }
.tracking-tight { letter-spacing: -0.025em; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.underline { text-decoration: underline; }
.list-disc { list-style-type: disc; }
.list-inside { list-style-position: inside; }

/* Text colors */
.text-white { color: #ffffff; }
.text-slate-300 { color: var(--slate-300); }
.text-slate-400 { color: var(--slate-400); }
.text-slate-500 { color: var(--slate-500); }
.text-slate-600 { color: var(--slate-600); }
.text-slate-700 { color: var(--slate-700); }
.text-red-600 { color: var(--red-600); }
.text-red-700 { color: var(--red-700); }
.text-amber-700 { color: var(--amber-700); }
.text-emerald-700 { color: var(--emerald-700); }
.text-emerald-800 { color: var(--emerald-800); }
.text-brand-purple { color: var(--brand-purple); }

/* Backgrounds */
.bg-white { background-color: #ffffff; }
.bg-slate-50 { background-color: var(--slate-50); }
.bg-slate-900 { background-color: var(--slate-900); }
.bg-red-50 { background-color: var(--red-50); }
.bg-red-100 { background-color: var(--red-100); }
.bg-amber-100 { background-color: var(--amber-100); }
.bg-emerald-50 { background-color: var(--emerald-50); }
.bg-brand-green { background-color: var(--brand-green); }
.bg-brand-purple { background-color: var(--brand-purple); }
.bg-brand-lavender-light { background-color: var(--brand-lavender-light); }
.bg-brand-lavender-band { background-color: var(--brand-lavender-band); }

/* Borders / shape */
.border { border: 1px solid var(--slate-200); }
.border-t { border-top: 1px solid var(--slate-200); }
.border-b { border-bottom: 1px solid var(--slate-200); }
.border-slate-100 { border-color: var(--slate-100); }
.border-slate-200 { border-color: var(--slate-200); }
.border-slate-300 { border-color: var(--slate-300); }
.border-slate-50 { border-color: var(--slate-50); }
.border-red-200 { border-color: var(--red-200); }
.border-emerald-200 { border-color: var(--emerald-200); }
.border-brand-lavender { border-color: var(--brand-lavender); }
.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }
.shadow-sm { box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); }

/* Interactive states */
.hover\:bg-slate-800:hover { background-color: var(--slate-800); }
.hover\:bg-slate-50:hover { background-color: var(--slate-50); }
.hover\:bg-brand-green-dark:hover { background-color: var(--brand-green-dark); }
.hover\:text-white:hover { color: #ffffff; }
.hover\:text-brand-purple:hover { color: var(--brand-purple); }
.hover\:underline:hover { text-decoration: underline; }
.focus\:outline-none:focus { outline: none; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px var(--slate-800); }

.badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.25rem;
}

@media print {
    .no-print { display: none !important; }
    body { background: white !important; }
    main { max-width: 100% !important; padding: 0 !important; }
}

.criteria-text { resize: vertical; font-family: inherit; line-height: 1.5; }

/* Estimated RadOnsite tier badges. */
.tier-radcore { background: #d1fae5; color: #065f46; }
.tier-radflex { background: #fef3c7; color: #92400e; }
.tier-radextend { background: #fee2e2; color: #991b1b; }

/* Top tab links: underlined and spread out. */
.main-nav { column-gap: 0.875rem; row-gap: 0.5rem; margin-left: 0.5rem; }
.main-nav a { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.main-nav a:hover { text-decoration-thickness: 2px; }

.weight-input { width: 4.5rem; text-align: right; }
.items-start { align-items: flex-start; }
.align-top { vertical-align: top; }

/* Map tab */
.map-pin {
    width: 20px; height: 20px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font: 700 11px/1 system-ui, sans-serif;
    border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
    box-sizing: border-box;
}
.map-pin-active { background: #2f9e57; }
.map-pin-idn { background: #ea7a12; }
.map-pin-general { background: #6b46c1; }
.map-pin-inline { display: inline-flex; vertical-align: middle; margin-right: 4px; }
.map-home, .map-center {
    width: 22px; height: 22px; border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 13px; border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); box-sizing: border-box;
}
.map-home { background: #c2410c; }
.map-center { background: #1e293b; }
.map-legend {
    background: #fff; padding: 6px 10px; border-radius: 6px; font-size: 12px; line-height: 1.8;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.seg-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.seg-active { background: #2f9e57; }
.seg-idn { background: #ea7a12; }
.seg-general { background: #6b46c1; }
.sticky-head th { position: sticky; top: 0; background: #fff; z-index: 1; }

/* Map tab layout: map on the left, filters + territory key on the right. */
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (min-width: 1024px) { .map-layout { grid-template-columns: minmax(0, 1fr) 300px; } }
.map-side .multi-select { width: 100%; }
.map-side .multi-select summary { display: block; }
.map-side #account-filters > div { flex-direction: column; align-items: stretch; }
/* Filter dropdowns open above the map and its controls. */
#account-filters { position: relative; z-index: 1100; }
.territory-key li { display: flex; gap: 0.5rem; align-items: flex-start; padding: 0.25rem 0; }
.territory-swatch { flex: none; width: 14px; height: 14px; border-radius: 3px; margin-top: 3px; opacity: 0.75; }
.block { display: block; }
.map-filter-prompt {
    font-size: 0.875rem; font-weight: 600; color: var(--brand-purple);
    margin-bottom: 0.5rem; padding-left: 0.25rem;
}

/* Service Center tab: proposed sites are hollow stars. */
.map-center-proposed { background: #fff; color: #1e293b; border: 2px dashed #1e293b; }
.plan-star { flex: none; width: 18px; height: 18px; border-radius: 4px; background: #1e293b; color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: 11px; margin-top: 1px; }
.plan-star-proposed { background: #fff; color: #1e293b; border: 1.5px dashed #1e293b; }
.map-popup-grid { display: grid; grid-template-columns: auto 1fr; column-gap: 0.75rem; row-gap: 0.1rem; }

/* Concentrations tab */
.conc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 1.25rem; align-items: start; }
.conc-side { position: sticky; top: 1rem; margin-top: 3rem; }   /* lines up with the first card, below the owner heading */
@media (max-width: 1000px) { .conc-layout { grid-template-columns: 1fr; } .conc-side { position: static; order: -1; margin-top: 0; } }
.conc-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.conc-strength { text-align: right; min-width: 110px; }
.conc-strength-num { font-size: 1.5rem; font-weight: 700; color: var(--brand-purple); line-height: 1.1; }
.conc-bar { height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; margin: 4px 0 2px; }
.conc-bar-fill { height: 100%; background: var(--brand-purple); }
.conc-grades { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; border-top: 1px solid #f1f5f9; padding-top: 0.75rem; }
@media (max-width: 760px) { .conc-grades { grid-template-columns: 1fr; } }
.conc-acct { margin-bottom: 0.45rem; line-height: 1.25; }
.conc-acct-meta { display: block; font-size: 0.72rem; color: #64748b; }
.conc-formula li { margin-bottom: 0.35rem; }
.drive-close-by { background: #d1fae5; color: #065f46; }
.drive-longer-drive { background: #fef3c7; color: #92400e; }
.drive-far-away { background: #fee2e2; color: #991b1b; }
.map-conc-banner { background: var(--brand-lavender-light); border: 1px solid var(--brand-lavender); border-radius: 8px; padding: 0.6rem 0.9rem; margin-bottom: 1rem; font-size: 0.875rem; }
.conc-grades ul { list-style: none; padding-left: 0; margin: 0; }

/* Grading Criteria: field / formula description boxes */
.def-body p + p, .def-body ul + p, .def-body ol + p, .def-body p + ul, .def-body p + ol { margin-top: 0.5rem; }
.def-body ul { list-style: disc; padding-left: 1.25rem; }
.def-body ol { list-style: decimal; padding-left: 1.25rem; }
.def-body ol ul { list-style: circle; margin-top: 0.25rem; }
.def-body li { margin-bottom: 0.25rem; }

/* Top nav groups: lists | maps | setup */
.main-nav .nav-gap { width: 0.75rem; }
.main-nav .nav-gap-lg { width: 2.5rem; }

/* Home tab tiles */
.home-group-title { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #64748b; margin-bottom: 0.75rem; }
.home-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 760px) { .home-tiles { grid-template-columns: 1fr; } }
.home-tile { display: flex; flex-direction: column; gap: 0.35rem; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.home-tile:hover { border-color: var(--brand-lavender); box-shadow: 0 2px 8px rgba(61, 46, 105, 0.12); }
.home-tile-title { font-size: 1rem; font-weight: 600; color: var(--brand-purple); }
.home-tile-text { font-size: 0.875rem; color: #64748b; }
.home-intro { margin-bottom: 2rem; }
.home-tiles + .home-group-title { margin-top: 2.25rem; }
.home-tiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .home-tiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .home-tiles-4 { grid-template-columns: 1fr; } }

/* Target Accounts: owner heading row */
.target-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin: 1.75rem 0 0.5rem; }
.target-map-btn { margin-left: auto; white-space: nowrap; }
