/* Panel theme (flat, colourful): blue / turquoise / teal-green only, solid fills, no gradients.
   Applies to every panel (patient, doctor, assistant, admin incl. centres) and the doctor/centre pages a signed-in user opens.
   Delete this file + its <link> in _Layout.cshtml to go back to the previous look. */
body.in-panel, body.has-side, body.theme-panel {
    --blue: #2563eb; --blue-d: #1d4ed8; --blue-soft: #dbe7ff;
    --turq: #0e9f93; --turq-d: #0b8479; --turq-soft: #d3f2ee;
    --teal: #0b7f8a; --teal-d: #086670; --teal-soft: #d0ebee;
    --navy: #12306e;
    --bg: #e6f0f6; --surface: #fff; --tint: #eaf3f8;
    --ink: #10244f; --ink-2: #405276; --ink-3: #7487a8; --line: #d3e1ec;
    --accent: var(--blue); --accent-ink: var(--blue-d); --accent-soft: var(--blue-soft);
    --ok: #0b8479; --ok-soft: var(--turq-soft); --warn: #0a6aa8; --warn-soft: #d6e9fa; --bad: #d0304a; --bad-soft: #ffe3e8;
    --sky-line: #d3e1ec; --sky-bg: #e6f0f6;
    --shadow: 0 1px 2px rgba(16, 36, 79, .06), 0 10px 24px -16px rgba(16, 36, 79, .3);
    background: #e6f0f6;
}
body.in-panel::before, body.has-side::before, body.theme-panel::before { display: none; }
body:is(.in-panel, .has-side, .theme-panel) .theme-sky { --sky-line: #d3e1ec; --sky-bg: #e6f0f6; --accent: var(--blue); --accent-ink: var(--blue-d); --accent-soft: var(--blue-soft); }
body:is(.has-side, .theme-panel) a { text-decoration-color: currentColor; }

/* top bar: white pill with a blue brand mark */
body.has-side .topbar { background: transparent; border: 0; backdrop-filter: none; }
body.has-side .topbar__in { background: #fff; border-radius: 12px; box-shadow: 0 0 0 1px #cfdfeb, 0 6px 16px -10px rgba(16, 36, 79, .3); padding-inline: 16px; }
body:is(.has-side, .theme-panel) .brand__mark { background: var(--blue); }

/* sidebar: solid navy, white labels, solid blue active item */
body.has-side .side { background: var(--navy); box-shadow: 0 14px 30px -16px rgba(16, 36, 79, .6); }
body.has-side .side__a, body.has-side .side__g > summary { color: #d7e3ff; }
body.has-side .side__a .ico, body.has-side .side__g > summary .ico { color: #8fb0ff; opacity: 1; }
body.has-side .side__a:hover, body.has-side .side__g > summary:hover { background: rgba(255, 255, 255, .1); color: #fff; }
body.has-side .side__a.is-on { background: var(--blue); color: #fff; }
body.has-side .side__a.is-on .ico { color: #fff; }
body.has-side .side__a.is-on::before { background: #5eead4; }
body.has-side .side__g.has-on > summary { color: #fff; }
body.has-side .side__sub { border-inline-start-color: rgba(255, 255, 255, .22); }
body.has-side .side__chev { color: #8fb0ff; }
body.has-side .side__n { background: #14b8a6; color: #fff; }
body.has-side .side__out { background: #e5384f; }

/* cards: white, thin border, a solid coloured top edge that cycles blue / turquoise / teal */
body:is(.has-side, .theme-panel) :is(.card, .ap-card, .hl-card, .adm-card, .mt-card, .hx, .rx, .pf-card, .dp-card, .sv-block, .ax-card, .nf-item a, .tw-visit, .notice-board, .hl-table, .hi-item, .tk, .pp-panel, .empty, .tw) {
    background: #fff; box-shadow: 0 0 0 1px #d3e1ec, 0 8px 18px -14px rgba(16, 36, 79, .35); border-top: 3px solid var(--blue);
}
body:is(.has-side, .theme-panel) :is(.adm-card, .hl-card, .pf-card, .dp-card, .pp-panel, .mt-card):nth-of-type(3n+2) { border-top-color: var(--turq); }
body:is(.has-side, .theme-panel) :is(.adm-card, .hl-card, .pf-card, .dp-card, .pp-panel, .mt-card):nth-of-type(3n+3) { border-top-color: var(--teal); }
body:is(.has-side, .theme-panel) :is(.ap-card, .rx, .hi-item, .nf-item a, .tw-visit) { border-top-width: 0; }
body:is(.has-side, .theme-panel) .ap-card--pending { border-inline-start-color: var(--turq); }
body:is(.has-side, .theme-panel) .ap-card--confirmed { border-inline-start-color: var(--teal); }
body:is(.has-side, .theme-panel) .ap-card--completed { border-inline-start-color: var(--blue); }
body:is(.has-side, .theme-panel) .hx { border-top-width: 0; border-inline-start: 5px solid var(--tone, var(--blue)); }

/* tables */
body:is(.has-side, .theme-panel) .mt-tbl th { background: var(--navy); color: #fff; font-weight: 600; }
body:is(.has-side, .theme-panel) .mt-tbl tbody tr:nth-child(even) td { background: #f1f7fb; }
body:is(.has-side, .theme-panel) .mt-tbl tbody tr:hover td { background: var(--blue-soft); }
body:is(.has-side, .theme-panel) .mt-tbl a { color: var(--blue-d); }

/* hero panel: solid turquoise block with white text */
body.has-side .portal-head.pp-top { background: var(--turq); box-shadow: none; color: #fff; }
body.has-side .portal-head.pp-top :is(h1, .hello, .overline, p, a, small, span) { color: #fff; }
body.has-side .portal-head.pp-top .btn--line { background: #fff; color: var(--turq-d); border-color: #fff; }
body.has-side .portal-head.pp-top .btn--solid { background: var(--navy); border-color: var(--navy); box-shadow: none; }

/* KPI tiles: solid colour blocks with white numbers */
body:is(.has-side, .theme-panel) .kpi { border: 0; box-shadow: none; color: #fff; }
body:is(.has-side, .theme-panel) .kpi b, body:is(.has-side, .theme-panel) .kpi span, body:is(.has-side, .theme-panel) .kpi small { color: #fff; }
body:is(.has-side, .theme-panel) :is(.kpis, .adm-kpis) > .kpi:nth-child(3n+1) { background: var(--blue); }
body:is(.has-side, .theme-panel) :is(.kpis, .adm-kpis) > .kpi:nth-child(3n+2) { background: var(--turq); }
body:is(.has-side, .theme-panel) :is(.kpis, .adm-kpis) > .kpi:nth-child(3n+3) { background: var(--teal); }
body:is(.has-side, .theme-panel) .kpis--links .kpi:hover { filter: brightness(1.08); }
body:is(.has-side, .theme-panel) .kpi--money { background: var(--navy) !important; }

/* icon badges: solid coloured circles, white glyph */
body:is(.has-side, .theme-panel) .hd__ico { border-radius: 50%; background: var(--tone, var(--blue)); color: #fff; box-shadow: none; }
body:is(.has-side, .theme-panel) :is(.hd__ico--blue, .hd__ico--violet) { --tone: var(--blue); }
body:is(.has-side, .theme-panel) :is(.hd__ico--green, .hd__ico--amber) { --tone: var(--turq); }
body:is(.has-side, .theme-panel) :is(.hd__ico--teal, .hd__ico--rose) { --tone: var(--teal); }
body:is(.has-side, .theme-panel) .hd__ico .ico { color: #fff; stroke: #fff; }
body:is(.has-side, .theme-panel) :is(.hx--rose, .hx--violet, .pf-tile--rose, .pf-tile--violet) { --tone: var(--blue); }
body:is(.has-side, .theme-panel) :is(.hx--amber, .hx--green, .pf-tile--amber, .pf-tile--green) { --tone: var(--turq); }
body:is(.has-side, .theme-panel) :is(.hx--teal, .hx--blue, .pf-tile--teal, .pf-tile--blue) { --tone: var(--teal); }
body:is(.has-side, .theme-panel) .hx .hx__bg { opacity: .07; color: var(--tone); }

/* headings */
body:is(.has-side, .theme-panel) :is(h1, h2, h3) { color: var(--ink); }
body:is(.has-side, .theme-panel) .ti { background: var(--blue-soft); color: var(--blue-d); }
body:is(.has-side, .theme-panel) .ti:hover, body:is(.has-side, .theme-panel) .ti:focus-visible { background: var(--blue); color: #fff; }

/* buttons, tabs, chips, badges: flat solid */
body:is(.has-side, .theme-panel) .btn--solid { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: none; }
body:is(.has-side, .theme-panel) .btn--solid:hover { background: var(--blue-d); border-color: var(--blue-d); }
body:is(.has-side, .theme-panel) .btn--line { background: #fff; border: 1.5px solid var(--blue); color: var(--blue-d); }
body:is(.has-side, .theme-panel) .btn--line:hover { background: var(--blue-soft); }
body:is(.has-side, .theme-panel) .btn--quiet { color: var(--blue-d); }
body:is(.has-side, .theme-panel) .btn--danger { background: #e5384f; border-color: #e5384f; color: #fff; }
body:is(.has-side, .theme-panel) .badge { font-weight: 700; }
body:is(.has-side, .theme-panel) .badge--ok { background: var(--turq); color: #fff; }
body:is(.has-side, .theme-panel) .badge--warn { background: var(--teal-soft); color: var(--teal-d); }
body:is(.has-side, .theme-panel) .badge--bad { background: #e5384f; color: #fff; }
body:is(.has-side, .theme-panel) .badge--accent { background: var(--blue); color: #fff; }
body:is(.has-side, .theme-panel) .ap-tabs, body:is(.has-side, .theme-panel) .adm-chips a, body:is(.has-side, .theme-panel) .hi-tabs { background: #d3e4f0; color: var(--ink-2); }
body:is(.has-side, .theme-panel) .ap-tabs { background: #d3e4f0; padding: 4px; }
body:is(.has-side, .theme-panel) .ap-tabs a.is-active { background: var(--blue); color: #fff; box-shadow: none; }
body:is(.has-side, .theme-panel) .ap-tabs a.is-active b { background: rgba(255, 255, 255, .25); color: #fff; }
body:is(.has-side, .theme-panel) .adm-chips a.is-on { background: var(--blue); color: #fff; }
body:is(.has-side, .theme-panel) .adm-chips__x { background: var(--turq) !important; }
body:is(.has-side, .theme-panel) .hi-tab.is-on { background: var(--blue); color: #fff; box-shadow: none; }
body:is(.has-side, .theme-panel) .adm-alerts a, body:is(.has-side, .theme-panel) .dp-unread { background: var(--teal-soft); border-color: var(--teal); color: var(--teal-d); }
body:is(.has-side, .theme-panel) .notice { background: var(--turq-soft); color: var(--turq-d); }
body:is(.has-side, .theme-panel) .input:focus { outline: 2px solid var(--blue); border-color: var(--blue); }

/* treatment wizard */
body:is(.has-side, .theme-panel) .tw-step.is-done i { background: var(--turq); box-shadow: none; }
body:is(.has-side, .theme-panel) .tw-step.is-on i { background: var(--blue); box-shadow: 0 0 0 6px rgba(37, 99, 235, .2); }
body:is(.has-step, .has-side) .tw-step.is-done + .tw-step::before, body.has-side .tw-step.is-on::before { border-top-color: var(--turq); }
body:is(.has-side, .theme-panel) .tw-radios input:checked + span { background: var(--blue-soft); box-shadow: inset 0 0 0 2px var(--blue); }
body:is(.has-side, .theme-panel) .tw-opt--yes:hover { border-color: var(--turq); background: var(--turq-soft); }
body:is(.has-side, .theme-panel) .cx-system--treat { background: var(--turq-soft); color: var(--turq-d); box-shadow: inset 0 0 0 1px #9fdcd4; border-inline-start-color: var(--turq); }
body:is(.has-side, .theme-panel) :is(.aic__m--me) { background: var(--blue); }
body:is(.has-side, .theme-panel) .aic__log { background: #eaf3f8; }
body:is(.has-side, .theme-panel) .aic__m .ico { color: var(--turq); }

/* phones: bottom bar in the same palette */
body.in-panel .nav a.is-active { background: var(--blue); color: #fff; }
body.in-panel .nav a.is-active .ico { color: #fff; }
body.has-side .portal-head.pp-top .btn--line, body.has-side .portal-head.pp-top .btn--line :is(span, svg) { color: var(--turq-d); }
body.has-side .portal-head.pp-top .btn--solid, body.has-side .portal-head.pp-top .btn--solid :is(span, svg) { color: #fff; }
body.has-side .portal-head.pp-top .pp-top__edit, body.has-side .portal-head.pp-top .pp-top__txt a { color: #d9fffa; }
body:is(.has-side, .theme-panel) .kpi :is(b, span, small) { color: #fff !important; }
body:is(.has-side, .theme-panel) .kpi span { opacity: .92; }
/* profile service tiles: one flat colour each, only blue / turquoise / teal */
body:is(.has-side, .theme-panel) :is(.pf-tile--blue, .pf-tile--violet, .pf-tile--rose) { --tc: #1d4ed8; --tb: #dbe7ff; }
body:is(.has-side, .theme-panel) :is(.pf-tile--green, .pf-tile--amber) { --tc: #0b8479; --tb: #d3f2ee; }
body:is(.has-side, .theme-panel) .pf-tile--teal { --tc: #086670; --tb: #d0ebee; }
body:is(.has-side, .theme-panel) .pf-tile { box-shadow: none; }
body:is(.has-side, .theme-panel) .pf-tile:hover { box-shadow: inset 0 0 0 2px var(--tc); }
body:is(.has-side, .theme-panel) .pf-tile small { color: var(--ink-2); }
/* hints stay on the label line: «شماره‌ی تماس اضطراری (همسر یا نزدیکان)» */
.field label small, .pf-form .field label small { display: inline; margin-inline-start: 6px; font-weight: 500; }
.pf-form .field > label, .form .field > label { display: block; width: 100%; }

/* side margins: 5px on every panel page (desktop and phone) */
body:is(.has-side, .theme-panel) main#main .wrap { width: auto !important; max-width: none !important; margin-inline: 5px !important; }
body:is(.has-side, .theme-panel) main#main .wrap.panel { padding-inline: 0 !important; }
body.has-side .topbar .wrap { width: calc(100% - 10px) !important; max-width: none; margin-inline: 5px !important; }
@media (max-width: 900px) { body.in-panel .wrap.panel { margin-inline: 5px !important; padding-inline: 0 !important; } }
