/* Phase 10.10 - Patient Activity Legacy Functional Parity */
body.page-visits {
    --patient1010-body: 16px;
    --patient1010-body-ar: 17px;
    --patient1010-section: clamp(24px, 2vw, 28px);
    --patient1010-card-title: 20px;
    --patient1010-kpi: clamp(36px, 3.4vw, 50px);
    --patient1010-label: 14px;
    --patient1010-radius: 22px;
}

body.page-visits .operations-hero .hero-copy > p,
body.page-visits .hero-command-card > p,
body.page-visits .patient1010-control p,
body.page-visits .patient1010-state p,
body.page-visits .patient1010-insight p,
body.page-visits .section-head p {
    font-size: var(--patient1010-body);
    line-height: 1.62;
}

html[dir="rtl"] body.page-visits .operations-hero .hero-copy > p,
html[dir="rtl"] body.page-visits .hero-command-card > p,
html[dir="rtl"] body.page-visits .patient1010-control p,
html[dir="rtl"] body.page-visits .patient1010-state p,
html[dir="rtl"] body.page-visits .patient1010-insight p,
html[dir="rtl"] body.page-visits .section-head p {
    font-size: var(--patient1010-body-ar);
    line-height: 1.72;
}

body.page-visits .patient1010-control {
    padding: 24px 26px;
    border-radius: var(--patient1010-radius);
    margin-bottom: 18px;
}

body.page-visits .patient1010-control-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

body.page-visits .patient1010-control-head h2,
body.page-visits .patient1010-insight h2,
body.page-visits .patient1010-monthly-card .section-head h2,
body.page-visits .patient1010-table-card .section-head h2 {
    margin: 4px 0 6px;
    font-size: var(--patient1010-section);
    line-height: 1.18;
}

body.page-visits .patient1010-control-head p {
    margin: 0;
    color: #64748b;
    max-width: 760px;
}

body.page-visits .patient1010-parity-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 7px 12px;
    border-radius: 999px;
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    color: #047857;
    font-size: 13px;
    font-weight: 800;
}

body.page-visits .patient1010-filter {
    display: grid;
    grid-template-columns: minmax(150px, .9fr) repeat(3, minmax(150px, 1fr)) auto auto;
    gap: 12px;
    align-items: end;
}

body.page-visits .patient1010-filter label {
    display: grid;
    gap: 7px;
    min-width: 0;
}

body.page-visits .patient1010-filter label > span {
    color: #475569;
    font-size: var(--patient1010-label);
    font-weight: 800;
}

body.page-visits .patient1010-filter input,
body.page-visits .patient1010-filter select {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid #dbe4ef;
    border-radius: 14px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    font-size: 16px;
    font-weight: 650;
}

html[dir="rtl"] body.page-visits .patient1010-filter input,
html[dir="rtl"] body.page-visits .patient1010-filter select {
    font-size: 17px;
}

body.page-visits .patient1010-filter.is-year [data-range-field] { display: none; }
body.page-visits .patient1010-filter.is-range [data-year-field] { display: none; }

body.page-visits .patient1010-filter .btn {
    min-height: 48px;
    padding-inline: 20px;
    font-size: 16px;
    font-weight: 800;
    white-space: nowrap;
}

body.page-visits .patient1010-filter-message {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid #fecaca;
    border-radius: 14px;
    background: #fff7f7;
    color: #9f1239;
    font-size: 15px;
    font-weight: 700;
}

body.page-visits .patient1010-period-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

body.page-visits .patient1010-period-strip article {
    min-width: 0;
    padding: 16px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
}

body.page-visits .patient1010-period-strip span {
    display: block;
    margin-bottom: 6px;
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

body.page-visits .patient1010-period-strip strong {
    display: block;
    overflow-wrap: anywhere;
    color: #0f172a;
    font-size: 16px;
    line-height: 1.4;
}

html[dir="rtl"] body.page-visits .patient1010-period-strip strong { font-size: 17px; }

body.page-visits .patient1010-state {
    margin-bottom: 18px;
    padding: 22px 24px;
    border-radius: 20px;
}

body.page-visits .patient1010-state-error {
    border: 1px solid #fecaca;
    background: #fff8f8;
}

body.page-visits .patient1010-state-warning {
    border: 1px solid #fde68a;
    background: #fffdf4;
}

body.page-visits .patient1010-state h2 {
    margin: 4px 0 6px;
    font-size: 22px;
}

body.page-visits .patient1010-kpis {
    margin-bottom: 18px;
}

body.page-visits .patient1010-kpi {
    min-height: 188px;
    padding: 22px;
}

body.page-visits .patient1010-kpi > span {
    font-size: 15px;
    font-weight: 800;
}

body.page-visits .patient1010-kpi > strong {
    font-size: var(--patient1010-kpi);
    line-height: 1;
    letter-spacing: -.035em;
}

body.page-visits .patient1010-kpi > small {
    font-size: 14px;
    line-height: 1.5;
}

html[dir="rtl"] body.page-visits .patient1010-kpi > span,
html[dir="rtl"] body.page-visits .patient1010-kpi > small { font-size: 15px; }

body.page-visits .patient1010-insight {
    display: grid;
    grid-template-columns: minmax(220px, .7fr) minmax(0, 1.6fr);
    gap: 24px;
    align-items: center;
    margin-bottom: 18px;
    padding: 22px 26px;
    border: 1px solid #dbeafe;
    border-radius: 22px;
    background: linear-gradient(120deg, #eff6ff 0%, #ffffff 56%, #f8fafc 100%);
}

body.page-visits .patient1010-insight p {
    margin: 0;
    color: #334155;
    font-weight: 650;
}

body.page-visits .patient1010-primary-grid {
    align-items: start;
}

body.page-visits .patient1010-monthly-card,
body.page-visits .patient1010-mix-card,
body.page-visits .patient1010-table-card {
    border-radius: var(--patient1010-radius);
}

body.page-visits .patient1010-charts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

body.page-visits .patient1010-chart-card {
    min-width: 0;
    padding: 16px 16px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #fff;
}

body.page-visits .patient1010-chart-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0 4px 8px;
}

body.page-visits .patient1010-chart-head h3 {
    margin: 0;
    font-size: var(--patient1010-card-title);
    line-height: 1.25;
}

body.page-visits .patient1010-chart-head span {
    color: #64748b;
    font-size: 13px;
    font-weight: 750;
    text-align: end;
}

body.page-visits .patient1010-chart-card canvas {
    width: 100%;
    min-height: 280px;
}

body.page-visits .patient1010-chart-state {
    display: grid;
    place-items: center;
    min-height: 220px;
    padding: 24px;
    border-radius: 16px;
    background: #f8fafc;
    color: #64748b;
    font-size: 16px;
    font-weight: 750;
    text-align: center;
}

body.page-visits .patient1010-chart-state[hidden] { display: none !important; }

body.page-visits .patient1010-secondary-grid {
    align-items: start;
}

body.page-visits .patient1010-table-card th,
body.page-visits .patient1010-table-card td {
    font-size: 15px;
    line-height: 1.45;
}

html[dir="rtl"] body.page-visits .patient1010-table-card th,
html[dir="rtl"] body.page-visits .patient1010-table-card td { font-size: 16px; }

body.page-visits .patient1010-table-card tbody td:first-child {
    font-weight: 800;
    color: #0f172a;
}

@media (max-width: 1500px) {
    body.page-visits .patient1010-filter {
        grid-template-columns: repeat(4, minmax(145px, 1fr));
    }
    body.page-visits .patient1010-filter .btn { width: 100%; }
}

@media (max-width: 1080px) {
    body.page-visits .patient1010-period-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.page-visits .patient1010-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.page-visits .patient1010-insight { grid-template-columns: 1fr; gap: 8px; }
}

@media (max-width: 680px) {
    body.page-visits .patient1010-control { padding: 20px 16px; }
    body.page-visits .patient1010-control-head { display: grid; }
    body.page-visits .patient1010-parity-badge { justify-self: start; }
    body.page-visits .patient1010-filter,
    body.page-visits .patient1010-period-strip { grid-template-columns: 1fr; }
    body.page-visits .patient1010-chart-head { display: grid; }
    body.page-visits .patient1010-chart-head span { text-align: start; }
    body.page-visits .patient1010-chart-card canvas { min-height: 250px; }
}

@media print {
    body.page-visits .patient1010-control,
    body.page-visits .patient1010-branch,
    body.page-visits .elite-sidebar,
    body.page-visits .elite-topbar,
    body.page-visits .elite-mobile-bar { display: none !important; }
    body.page-visits .patient1010-period-strip { grid-template-columns: repeat(4, 1fr); }
    body.page-visits .patient1010-kpi { min-height: auto; }
}
