/**
 * MedNova EMR — central theme (Bootstrap 5.3 CDN + custom tokens).
 * All brand colors flow from CSS variables; layouts may override --brand-primary via settings.
 */
:root {
    /* Bootstrap 5.3 native tokens */
    --bs-primary: #7B1F2B;
    --bs-primary-rgb: 123, 31, 43;
    --bs-secondary: #EC4899;
    --bs-secondary-rgb: 236, 72, 153;
    --bs-success: #16A34A;
    --bs-success-rgb: 22, 163, 74;
    --bs-info: #2563EB;
    --bs-info-rgb: 37, 99, 235;
    --bs-body-color: #0F172A;
    --bs-body-color-rgb: 15, 23, 42;
    --bs-body-bg: #F8F7FC;
    --bs-body-bg-rgb: 248, 247, 252;
    --bs-light: #F8F7FC;
    --bs-light-rgb: 248, 247, 252;
    --bs-border-color: #E5E7EB;
    --bs-border-radius: 0.75rem;
    --bs-border-radius-lg: 0.75rem;
    --bs-border-radius-xl: 1rem;
    --bs-border-radius-pill: 50rem;
    --bs-box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --bs-box-shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --bs-font-sans-serif: 'Inter', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --bs-link-color: var(--brand-primary);
    --bs-link-hover-color: var(--brand-primary-dark);

    /* MedNova brand tokens */
    --brand-primary: #7B1F2B;
    --brand-primary-dark: #5A1620;
    --brand-secondary: #EC4899;
    --brand-gradient: linear-gradient(135deg, var(--brand-primary), #EC4899);
    --brand-text: #0F172A;
    --brand-text-muted: #64748B;
    --brand-surface: #F8F7FC;
    --brand-border: #E5E7EB;
    --brand-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);

    /* Legacy dx-* aliases (panels + existing views) */
    --dx-sidebar-w: 260px;
    --dx-maroon: var(--brand-primary);
    --dx-maroon-700: var(--brand-primary-dark);
    --dx-maroon-50: color-mix(in srgb, var(--brand-primary) 8%, transparent);
    --dx-maroon-100: color-mix(in srgb, var(--brand-primary) 14%, transparent);
    --dx-ink: var(--brand-text);
    --dx-ink-soft: #1E293B;
    --dx-text: var(--brand-text);
    --dx-text-muted: var(--brand-text-muted);
    --dx-bg: var(--brand-surface);
    --dx-card-shadow: var(--brand-shadow);
    --dx-border: var(--brand-border);
    --dx-radius: 0.75rem;
    --dx-sidebar-bg: var(--brand-primary);
    --dx-sidebar-text: rgba(255, 255, 255, 0.88);
    --dx-sidebar-border: rgba(255, 255, 255, 0.12);
    --dx-sidebar-active-bg: rgba(255, 255, 255, 0.16);
    --dx-sidebar-hover-bg: rgba(255, 255, 255, 0.08);
}

/* ----- Typography ----- */
body {
    font-family: var(--bs-font-sans-serif);
    letter-spacing: -0.01em;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--brand-text);
}

.text-muted {
    color: var(--brand-text-muted) !important;
}

/* ----- Buttons ----- */
.btn-primary {
    --bs-btn-bg: var(--brand-primary);
    --bs-btn-border-color: var(--brand-primary);
    --bs-btn-hover-bg: var(--brand-primary-dark);
    --bs-btn-hover-border-color: var(--brand-primary-dark);
    --bs-btn-active-bg: var(--brand-primary-dark);
    --bs-btn-active-border-color: var(--brand-primary-dark);
    border-radius: var(--bs-border-radius-pill);
    font-weight: 600;
}

.btn-secondary {
    --bs-btn-bg: var(--brand-secondary);
    --bs-btn-border-color: var(--brand-secondary);
    --bs-btn-hover-bg: #DB2777;
    --bs-btn-hover-border-color: #DB2777;
    border-radius: var(--bs-border-radius-pill);
    font-weight: 600;
}

.btn-brand-gradient {
    background: var(--brand-gradient);
    border: 0;
    color: #fff;
    font-weight: 600;
    border-radius: var(--bs-border-radius-pill);
    padding: 0.55rem 1.35rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

.btn-brand-gradient:hover,
.btn-brand-gradient:focus {
    color: #fff;
    opacity: 0.95;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

.btn-outline-brand {
    color: var(--brand-secondary);
    border: 2px solid var(--brand-secondary);
    background: transparent;
    border-radius: var(--bs-border-radius-pill);
    font-weight: 600;
}

.btn-outline-brand:hover,
.btn-outline-brand:focus {
    color: var(--brand-secondary);
    background: color-mix(in srgb, var(--brand-secondary) 8%, transparent);
    border-color: var(--brand-secondary);
}

.btn-dx {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
    font-weight: 600;
    border-radius: var(--bs-border-radius-pill);
}

.btn-dx:hover,
.btn-dx:focus {
    background: var(--brand-primary-dark);
    border-color: var(--brand-primary-dark);
    color: #fff;
}

.btn-outline-dx {
    color: var(--brand-primary);
    border-color: var(--brand-primary);
    background: transparent;
    border-radius: var(--bs-border-radius-pill);
    font-weight: 600;
}

.btn-outline-dx:hover {
    background: var(--dx-maroon-50);
    color: var(--brand-primary-dark);
    border-color: var(--brand-primary);
}

.text-dx { color: var(--brand-primary) !important; }
.text-brand-secondary { color: var(--brand-secondary) !important; }
.bg-dx { background: var(--brand-primary) !important; color: #fff; }
.bg-dx-soft { background: var(--dx-maroon-50) !important; color: var(--brand-primary); }
.badge-dx { background: var(--brand-primary); color: #fff; }

/* Marketing: gradient CTA on front site only */
body.dx-front-site .dx-front-actions .btn-dx,
body.dx-front-site .dx-hero-cta .btn-dx,
body.dx-front-site .offcanvas .btn-dx {
    background: var(--brand-gradient);
    border: 0;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

body.dx-front-site .dx-front-actions .btn-dx:hover,
body.dx-front-site .dx-hero-cta .btn-dx:hover {
    background: var(--brand-gradient);
    opacity: 0.95;
    border: 0;
}

body.dx-front-site .btn-outline-dx {
    color: var(--brand-secondary);
    border-color: var(--brand-secondary);
}

body.dx-front-site .btn-outline-dx:hover {
    background: color-mix(in srgb, var(--brand-secondary) 8%, transparent);
    color: var(--brand-secondary);
    border-color: var(--brand-secondary);
}

/* ----- Cards ----- */
.card {
    border-radius: var(--dx-radius);
    border: 1px solid var(--dx-border);
    box-shadow: var(--dx-card-shadow);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--dx-border);
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-radius: var(--dx-radius) var(--dx-radius) 0 0;
}

.card-footer {
    background: #fff;
    border-top: 1px solid var(--dx-border);
    padding: 0.65rem 1rem;
    border-radius: 0 0 var(--dx-radius) var(--dx-radius);
}

.stat-card {
    background: #fff;
    border: 1px solid var(--dx-border);
    border-radius: var(--dx-radius);
    padding: 1rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    box-shadow: var(--dx-card-shadow);
}

.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--dx-maroon-50);
    color: var(--brand-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-card .stat-label {
    font-size: 0.78rem;
    color: var(--dx-text-muted);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
}

.stat-card .stat-value {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--dx-ink);
    margin: 0.1rem 0 0;
}

/* Feature icon-in-tinted-circle */
.dx-feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--brand-primary) 10%, #fff);
    color: var(--brand-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* ----- Sidebar (admin + clinic + portal) ----- */
.dx-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--dx-sidebar-w);
    height: 100vh;
    background: linear-gradient(180deg, var(--brand-primary) 0%, color-mix(in srgb, var(--brand-primary) 55%, #1E1B4B) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 1040;
    overflow: hidden;
    box-shadow: 2px 0 14px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s ease;
}

.dx-sidebar .brand {
    padding: 1rem 1rem 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--dx-sidebar-border);
    background: rgba(0, 0, 0, 0.06);
}

.dx-sidebar .brand-link { display: block; line-height: 0; }
.dx-sidebar .brand-img { max-height: 40px; max-width: 180px; object-fit: contain; }
.dx-sidebar-close { color: #fff !important; background: transparent; border: 0; }
.dx-sidebar-scroll { flex: 1; overflow-y: auto; padding: 0.5rem 0 1rem; }

.dx-sidebar .nav-section {
    padding: 1rem 1.1rem 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: rgba(255, 255, 255, 0.55);
}

.dx-sidebar .nav-link {
    color: var(--dx-sidebar-text);
    padding: 0.58rem 0.9rem;
    margin: 0.15rem 0.55rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    transition: background 0.12s, color 0.12s;
}

.dx-sidebar .nav-link:hover {
    background: var(--dx-sidebar-hover-bg);
    color: #fff;
}

.dx-sidebar .nav-link.active {
    background: var(--dx-sidebar-active-bg);
    color: #fff;
    box-shadow: inset 3px 0 0 #fff;
}

.dx-sidebar .nav-link i {
    font-size: 1.05rem;
    width: 1.25em;
    text-align: center;
    opacity: 0.9;
}

.dx-sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--dx-sidebar-border);
    text-align: center;
}

.dx-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    border: 0;
    z-index: 1035;
    display: none;
}

.dx-sidebar-overlay.show { display: block; }

.dx-sidebar .brand-img { max-width: 100% !important; max-height: fit-content; }

/* Panel sidebar active state (clinic/dentist on /c/) */
body.dx-clinic-panel aside#dxSidebar.dx-sidebar .nav-link.active,
body.dx-dentist-panel aside#dxSidebar.dx-sidebar .nav-link.active {
    background: linear-gradient(90deg, color-mix(in srgb, var(--brand-primary) 75%, #fff) 0%, var(--brand-primary) 100%) !important;
    box-shadow: none !important;
    color: #fff !important;
}

/* ----- Main panel area ----- */
.dx-main {
    margin-left: var(--dx-sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--brand-surface);
}

.dx-navbar {
    background: #fff;
    border-bottom: 1px solid var(--dx-border);
    padding: 0.65rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--dx-card-shadow);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.dx-navbar .page-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--dx-ink);
}

.dx-content { padding: 0.75rem; flex: 1; }

/* ----- Forms, tables, badges ----- */
.form-control,
.form-select {
    border-radius: 0.5rem;
    border-color: var(--dx-border);
    padding: 0.5rem 0.7rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--brand-primary) 18%, transparent);
}

.form-label {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--dx-ink-soft);
}

.table { color: var(--dx-text); }
.table thead th {
    font-weight: 600;
    color: var(--dx-ink);
    background: #fafafa;
    border-bottom: 1px solid var(--dx-border);
    white-space: nowrap;
}

.table-striped tbody tr:nth-of-type(odd) td {
    background-color: rgba(0, 0, 0, 0.02);
}

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

.badge.bg-success { background: var(--bs-success) !important; }
.badge.bg-info { background: var(--bs-info) !important; }

.badge.bg-primary-subtle,
.bg-primary-subtle {
    background: color-mix(in srgb, var(--brand-primary) 12%, #fff) !important;
    color: var(--brand-primary) !important;
}

.badge.bg-success-subtle,
.bg-success-subtle {
    background: color-mix(in srgb, var(--bs-success) 12%, #fff) !important;
    color: var(--bs-success) !important;
}

.alert { border-radius: var(--dx-radius); border: 0; }

.page-link { color: var(--brand-primary); border-color: var(--dx-border); }
.page-item.active .page-link {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}

.nav-tabs { border-bottom: 1px solid var(--dx-border); }
.nav-tabs .nav-link {
    color: var(--dx-text-muted);
    border: 0;
    padding: 0.65rem 0.9rem;
    font-weight: 500;
}

.nav-tabs .nav-link.active {
    color: var(--brand-primary);
    background: transparent;
    border-bottom: 2px solid var(--brand-primary);
}

/* Scope picker */
.dx-scope { padding: 0.75rem 0.8rem 0.25rem; position: relative; }

.dx-scope-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 0.625rem;
    padding: 0.55rem 0.65rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.dx-scope-btn:hover,
.dx-scope-btn:focus,
.dx-scope-btn[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.32);
}

.dx-scope-icon {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
}

.dx-scope-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }

.dx-scope-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 700;
    line-height: 1;
}

.dx-scope-value {
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.1rem;
}

.dx-scope-caret { color: rgba(255, 255, 255, 0.7); font-size: 0.9rem; flex-shrink: 0; }

.dx-scope-menu {
    width: 90%;
    transform: translateX(-1%);
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid var(--dx-border);
}

.dx-scope-menu-title { font-weight: 700; color: var(--dx-ink); font-size: 0.95rem; }
.dx-scope-menu-sub { color: var(--dx-text-muted); font-size: 0.78rem; }

.dx-scope-divider {
    padding: 0.55rem 0.9rem;
    background: #f9fafb;
    border-top: 1px solid var(--dx-border);
    border-bottom: 1px solid var(--dx-border);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--dx-ink-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dx-scope-search input { border-radius: 8px; }
.dx-scope-list { overflow-y: auto; max-height: 280px; }

.dx-scope-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.9rem;
    background: transparent;
    border: 0;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
}

.dx-scope-item:hover { background: var(--dx-maroon-50); }
.dx-scope-item.is-active { background: var(--dx-maroon-100); }

.dx-scope-item-ic {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--dx-maroon-50);
    color: var(--brand-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dx-scope-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dx-scope-item-title { font-weight: 600; color: var(--dx-ink); font-size: 0.88rem; line-height: 1.1; }
.dx-scope-item-sub { color: var(--dx-text-muted); font-size: 0.72rem; margin-top: 0.1rem; }
.dx-scope-item-check { color: var(--brand-primary); font-size: 1.1rem; }
.dx-scope-clear:hover { background: #fef2f2; }

.dx-scope-strip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--dx-maroon-50);
    color: var(--brand-primary);
    border: 1px dashed var(--dx-maroon-100);
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.dx-scope-strip .dot {
    width: 0.5rem;
    height: 0.5rem;
    background: var(--brand-primary);
    border-radius: 50%;
}

.modal.staff-crud-modal .modal-body {
    max-height: min(70vh, 32rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ----- Public marketing site (layout.js / page-template.html) ----- */
body.dx-front-site {
    background: #fff !important;
    color: var(--brand-text);
}

.btn-gradient {
    background: var(--brand-gradient);
    color: #fff;
    border: none;
    border-radius: var(--bs-border-radius-pill);
    font-weight: 600;
    padding: 0.55rem 1.5rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-gradient:hover,
.btn-gradient:focus {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px color-mix(in srgb, var(--brand-primary) 35%, transparent);
}

.btn-gradient.btn-sm {
    padding: 0.45rem 1.15rem;
    font-size: 0.875rem;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.site-header.scrolled {
    border-bottom-color: var(--brand-border);
    box-shadow: var(--bs-box-shadow-sm);
}

.site-header .navbar {
    padding: 0.85rem 0;
}

.site-header .brand-img {
    max-height: 40px;
    width: auto;
    display: block;
}

.site-footer .brand-img {
    max-height: 36px;
    width: auto;
    display: block;
}

.site-header .brand-text,
.site-footer .brand-text,
.footer-brand .brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.site-header .brand-name,
.site-footer .brand-name,
.footer-brand .brand-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--brand-primary);
    letter-spacing: -0.02em;
}

.site-header .brand-tagline,
.site-footer .brand-tagline,
.footer-brand .brand-tagline {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--brand-text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.site-header .navbar-nav .nav-link {
    color: var(--brand-text);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.4rem 0.85rem;
    border-radius: 0.5rem;
}

.site-header .navbar-nav .nav-link:hover,
.site-header .navbar-nav .nav-link:focus {
    color: var(--brand-primary);
}

.site-header .navbar-nav .nav-link.active {
    color: var(--brand-primary);
    font-weight: 600;
}

.site-header .nav-link-login {
    color: var(--brand-text);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
}

.site-header .nav-link-login:hover {
    color: var(--brand-primary);
}

.site-header .nav-link-login.active {
    color: var(--brand-primary);
    font-weight: 600;
}

.site-header .navbar-toggler {
    padding: 0.35rem 0.5rem;
}

.site-header .navbar-toggler:focus {
    box-shadow: none;
}

.site-header .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%230F172A' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

@media (max-width: 991.98px) {
    .site-header .nav-actions {
        padding: 1rem 0 0.5rem;
        flex-direction: column;
        align-items: flex-start !important;
        width: 100%;
    }

    .site-header .navbar-collapse {
        padding-top: 0.5rem;
    }
}

/* Footer */
.site-footer {
    background: #fff;
    border-top: 1px solid var(--brand-border);
    padding: 3.5rem 0 0;
}

.site-footer .footer-tagline {
    font-size: 0.82rem;
    color: var(--brand-text-muted);
    line-height: 1.6;
    margin-bottom: 0;
}

.site-footer .footer-heading {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--brand-text);
    margin-bottom: 1rem;
}

.site-footer .footer-links li {
    margin-bottom: 0.5rem;
}

.site-footer .footer-links a {
    font-size: 0.82rem;
    color: var(--brand-text-muted);
    text-decoration: none;
}

.site-footer .footer-links a:hover {
    color: var(--brand-primary);
}

.site-footer .social-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.site-footer .social-links a {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--brand-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-text-muted);
    font-size: 0.9rem;
    transition: background 0.25s ease, color 0.25s ease;
}

.site-footer .social-links a:hover {
    background: color-mix(in srgb, var(--brand-primary) 12%, #fff);
    color: var(--brand-primary);
}

.site-footer .footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--brand-text-muted);
    margin-bottom: 0.65rem;
    line-height: 1.5;
}

.site-footer .footer-contact i {
    color: var(--brand-primary);
    margin-top: 2px;
    flex-shrink: 0;
}

.site-footer .footer-bottom {
    border-top: 1px solid var(--brand-border);
    margin-top: 2.5rem;
    padding: 1.25rem 0;
    text-align: center;
}

.site-footer .footer-bottom p {
    font-size: 0.78rem;
    color: var(--brand-text-muted);
    margin-bottom: 0;
}

.site-footer .footer-brand {
    color: inherit;
    text-decoration: none;
}

@media (max-width: 575.98px) {
    .site-footer {
        padding-top: 2.5rem;
    }
}

/* Homepage sections */
.page-home .dx-hero {
    background: var(--brand-surface);
    padding: 2.5rem 0 2rem;
    overflow: hidden;
}

@media (min-width: 992px) {
    .page-home .dx-hero { padding: 3.5rem 0 3rem; }
}

.page-home .dx-hero h1 {
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    line-height: 1.08;
    color: var(--brand-text);
    letter-spacing: -0.03em;
    font-weight: 800;
}

.page-home .dx-hero .dx-hero-lead {
    color: var(--brand-text-muted);
    font-size: 1.05rem;
    line-height: 1.65;
    max-width: 34rem;
}

.page-home .dx-hero-cta .btn {
    font-weight: 600;
    padding: 0.65rem 1.5rem;
    font-size: 0.92rem;
}

.page-home .dx-hero-trust {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--brand-border);
}

.page-home .dx-hero-trust-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem 1rem;
}

@media (min-width: 768px) {
    .page-home .dx-hero-trust-grid { grid-template-columns: repeat(4, 1fr); }
}

.page-home .dx-hero-trust-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--dx-ink-soft);
    line-height: 1.35;
}

.page-home .dx-hero-trust-item i {
    color: var(--brand-primary);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.page-home .dx-social-proof {
    background: var(--brand-surface);
    border-top: 1px solid var(--brand-border);
    border-bottom: 1px solid var(--brand-border);
    padding: 1.75rem 0;
}

.page-home .dx-social-proof-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--brand-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
    text-align: center;
}

.page-home .dx-social-logos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1.5rem 2.5rem;
    opacity: 0.55;
    filter: grayscale(1);
}

.page-home .dx-social-logos span {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--brand-text);
}

.page-home .dx-features {
    padding: 3.5rem 0;
    background: #fff;
}

.page-home .dx-features h2 {
    font-weight: 800;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    text-align: center;
    margin-bottom: 2rem;
}

.page-home .dx-feature-card {
    background: #fff;
    border: 1px solid var(--brand-border);
    border-radius: var(--dx-radius);
    padding: 1.35rem 1rem;
    height: 100%;
    text-align: center;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.page-home .dx-feature-card:hover {
    border-color: color-mix(in srgb, var(--brand-primary) 25%, transparent);
    box-shadow: var(--brand-shadow);
}

.page-home .dx-feature-card h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--brand-text);
    margin: 0.75rem 0 0.35rem;
}

.page-home .dx-feature-card p {
    font-size: 0.78rem;
    color: var(--brand-text-muted);
    line-height: 1.5;
    margin: 0;
}

.page-home .dx-testimonial {
    padding: 3.5rem 0;
    background: var(--brand-surface);
}

.page-home .dx-testimonial-card {
    background: #fff;
    border: 1px solid var(--brand-border);
    border-radius: var(--dx-radius);
    box-shadow: var(--brand-shadow);
    overflow: hidden;
}

.page-home .dx-testimonial-stars {
    color: #F59E0B;
    font-size: 0.9rem;
}

.page-home .dx-cta-band {
    background: var(--brand-gradient);
    color: #fff;
    padding: 3rem 0;
}

.page-home .dx-cta-band h2 {
    font-weight: 800;
    font-size: clamp(1.35rem, 2.5vw, 1.85rem);
    color: #fff;
}

.page-home .dx-cta-band .dx-cta-sub {
    opacity: 0.92;
    font-size: 0.95rem;
    line-height: 1.55;
}

.page-home .dx-cta-band .btn-light {
    color: var(--brand-primary) !important;
    border-radius: var(--bs-border-radius-pill);
    font-weight: 600;
}

.page-home .dx-cta-band .btn-outline-light {
    border-width: 2px;
    border-radius: var(--bs-border-radius-pill);
    font-weight: 600;
}

/* ----- Patient portal: warmer, mobile-first ----- */
body.dx-patient-portal {
    background: var(--brand-surface);
}

body.dx-patient-portal .dx-sidebar .nav-link {
    padding: 0.72rem 0.95rem;
    font-size: 0.92rem;
}

body.dx-patient-portal .card {
    box-shadow: 0 2px 16px rgba(15, 23, 42, 0.06);
    border-radius: var(--dx-radius);
}

body.dx-patient-portal .btn {
    min-height: 2.5rem;
    border-radius: var(--bs-border-radius-pill);
    font-weight: 600;
}

body.dx-patient-portal .list-group-item {
    padding: 0.85rem 1rem;
    border-color: var(--brand-border);
}

body.dx-patient-portal .dx-content {
    padding: 1rem 1.1rem 1.25rem;
}

/* ----- Clinic panel dashboard helpers ----- */
.dx-kpi-link {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--brand-primary);
}

.dx-kpi-link:hover { color: var(--brand-primary-dark); }

.dx-surface {
    border: 1px solid var(--brand-border);
    border-radius: var(--dx-radius);
    background: #fff;
}

.dx-calendar-grid .active {
    background: var(--brand-primary);
    color: #fff;
    font-weight: 600;
}

/* ----- Admin login ----- */
.dx-login-page {
    background: var(--brand-gradient);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.dx-login-card {
    max-width: 420px;
    width: 100%;
    background: #fff;
    border-radius: 1rem;
    box-shadow: var(--brand-shadow);
    overflow: hidden;
}

.dx-login-header {
    background: var(--brand-primary);
    color: #fff;
    padding: 2rem 1.5rem;
    text-align: center;
}

.dx-login-header img {
    max-height: 56px;
    max-width: 85%;
    object-fit: contain;
}

/* ----- Responsive ----- */
@media (max-width: 991.98px) {
    .dx-sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: 2px 0 18px rgba(0, 0, 0, 0.18);
    }

    .dx-sidebar.show { transform: translateX(0); }
    .dx-main { margin-left: 0; }
    .dx-scope-menu { width: calc(100vw - 1.5rem); }
}

@media (max-width: 575.98px) {
    .dx-content { padding: 0; }
    .stat-card .stat-value { font-size: 1.2rem; }
}

@media print {
    .dx-sidebar,
    .dx-navbar,
    .no-print { display: none !important; }

    .dx-main { margin-left: 0; }
    .dx-content { padding: 0; }
}

/* ----- Marketing inner pages (products, solutions, resources) ----- */
body.dx-front-site .section-title {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--brand-text);
    margin-bottom: 0.75rem;
}

body.dx-front-site .section-subtitle {
    font-size: 1rem;
    color: var(--brand-text-muted);
    max-width: 560px;
    line-height: 1.7;
}

body.dx-front-site .page-hero {
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand-primary) 8%, #fff) 0%, color-mix(in srgb, var(--brand-secondary) 6%, #fff) 100%);
    padding: 2.5rem 0 3rem;
    border-bottom: 1px solid var(--brand-border);
}

body.dx-front-site .page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--brand-text-muted);
    margin-bottom: 1.25rem;
}

body.dx-front-site .page-breadcrumb a {
    color: var(--brand-text-muted);
    text-decoration: none;
}

body.dx-front-site .page-breadcrumb a:hover {
    color: var(--brand-primary);
}

body.dx-front-site .page-breadcrumb i {
    font-size: 0.65rem;
}

body.dx-front-site .page-breadcrumb span {
    color: var(--brand-primary);
    font-weight: 500;
}

body.dx-front-site .page-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--brand-text);
    margin-bottom: 0.75rem;
    max-width: 720px;
}

body.dx-front-site .page-lead {
    font-size: 1.05rem;
    color: var(--brand-text-muted);
    max-width: 600px;
    margin-bottom: 0;
    line-height: 1.7;
}

body.dx-front-site .page-section {
    padding: 4rem 0;
}

body.dx-front-site .page-section-alt {
    background: var(--brand-surface);
}

body.dx-front-site .page-cta-strip {
    background: var(--brand-gradient);
    padding: 3.5rem 0;
    text-align: center;
}

body.dx-front-site .page-cta-strip h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
}

body.dx-front-site .page-cta-strip p {
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.5rem;
}

body.dx-front-site .page-cta-strip .btn-outline-light {
    border-width: 1.5px;
    font-weight: 600;
    border-radius: var(--bs-border-radius-pill);
}

body.dx-front-site .inner-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

body.dx-front-site .inner-list li {
    font-size: 0.82rem;
    color: var(--brand-text-muted);
    padding: 0.25rem 0 0.25rem 1.25rem;
    position: relative;
}

body.dx-front-site .inner-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand-secondary);
}

body.dx-front-site .inner-list-inline li {
    display: inline-block;
    margin-right: 1rem;
}

body.dx-front-site .product-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--brand-secondary);
    margin-bottom: 0.5rem;
}

body.dx-front-site .product-visual {
    border-radius: 1.5rem;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    color: #fff;
}

body.dx-front-site .product-visual-emr { background: linear-gradient(135deg, var(--brand-primary), color-mix(in srgb, var(--brand-primary) 70%, #fff)); }
body.dx-front-site .product-visual-practice { background: linear-gradient(135deg, color-mix(in srgb, var(--brand-primary) 85%, #000), var(--brand-primary)); }
body.dx-front-site .product-visual-patient { background: linear-gradient(135deg, #c026a0, var(--brand-secondary)); }
body.dx-front-site .product-visual-analytics { background: linear-gradient(135deg, var(--brand-secondary), #f472b6); }

body.dx-front-site .solution-card {
    background: #fff;
    border: 1px solid var(--brand-border);
    border-radius: var(--bs-border-radius-lg);
    padding: 2rem;
    height: 100%;
    transition: box-shadow 0.25s ease;
}

body.dx-front-site .solution-card:hover {
    box-shadow: var(--brand-shadow);
}

body.dx-front-site .solution-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--bs-border-radius);
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand-primary) 8%, #fff) 0%, color-mix(in srgb, var(--brand-secondary) 6%, #fff) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--brand-primary);
    margin-bottom: 1rem;
}

body.dx-front-site .solution-card h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

body.dx-front-site .solution-card p {
    font-size: 0.88rem;
    color: var(--brand-text-muted);
    margin-bottom: 1rem;
}

body.dx-front-site .trusted-logos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1.5rem 2.5rem;
}

body.dx-front-site .trusted-logo {
    font-size: 0.85rem;
    font-weight: 700;
    color: #b0b5bf;
    letter-spacing: 0.02em;
    white-space: nowrap;
    transition: color 0.25s ease;
}

body.dx-front-site .trusted-logo:hover {
    color: var(--brand-text-muted);
}

body.dx-front-site .trusted-logo:nth-child(2) {
    font-size: 0.7rem;
    letter-spacing: 0.06em;
}

body.dx-front-site .resource-link-card {
    display: block;
    background: #fff;
    border: 1px solid var(--brand-border);
    border-radius: var(--bs-border-radius-lg);
    padding: 1.75rem;
    height: 100%;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

body.dx-front-site .resource-link-card:hover {
    box-shadow: var(--brand-shadow);
    transform: translateY(-2px);
    border-color: var(--brand-primary);
    color: inherit;
}

body.dx-front-site .resource-link-card i {
    font-size: 2rem;
    color: var(--brand-primary);
    margin-bottom: 1rem;
    display: block;
}

body.dx-front-site .resource-link-card h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--brand-text);
    margin-bottom: 0.5rem;
}

body.dx-front-site .resource-link-card p {
    font-size: 0.82rem;
    color: var(--brand-text-muted);
    margin-bottom: 0;
}

body.dx-front-site .topic-item {
    background: #fff;
    border: 1px solid var(--brand-border);
    border-radius: var(--bs-border-radius);
    padding: 1.25rem 1.5rem;
    height: 100%;
}

body.dx-front-site .topic-item h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

body.dx-front-site .topic-item p {
    font-size: 0.82rem;
    color: var(--brand-text-muted);
    margin-bottom: 0;
}

body.dx-front-site .legal-card {
    background: #fff;
    border: 1px solid var(--brand-border);
    border-radius: var(--bs-border-radius-lg);
    padding: 1.75rem;
    height: 100%;
}

body.dx-front-site .legal-card h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

body.dx-front-site .legal-card h2 i {
    color: var(--brand-primary);
}

body.dx-front-site .legal-card p {
    font-size: 0.85rem;
    color: var(--brand-text-muted);
    line-height: 1.7;
    margin-bottom: 0;
}

@media (max-width: 767.98px) {
    body.dx-front-site .page-section {
        padding: 2.75rem 0;
    }

    body.dx-front-site .product-visual {
        height: 200px;
        font-size: 3.5rem;
    }
}
