/* THE UNIFIED STYLE (Shan, 2026-10-06, from his "Your access" mockup).
 *
 * One look for the whole portal, started on the Classic layout: a soft lavender
 * menu with line icons, a white top bar with the page title in the serif face, and
 * white cards with tinted tiles. Built here first and spread page by page.
 *
 * CLASSIC ONLY FOR NOW. Every rule starts with html:not([data-home-layout="sections"]),
 * which is how Classic is told apart (home-layout.js sets data-home-layout="sections"
 * and removes it for Classic). Sections looks exactly as it did.
 *
 * Colours are tokens (--u-*) set once for light and once for dark, so a page drawn in
 * this style follows the Appearance choice without its own dark rules. A tile's tint
 * is one colour (--t) mixed into the card colour, which keeps it right in both.
 */

html:not([data-home-layout="sections"]) {
  --u-bg: #F7F7FB;
  --u-card: #FFFFFF;
  --u-side: #FBFAFE;
  --u-line: #ECEAF3;
  --u-ink: #1C1A3A;
  --u-muted: #6E6B85;
  --u-accent: #6D4FD8;
  --u-accent-soft: #EFEBFD;
  --u-hover: #F3F1FA;
  --u-shadow: 0 1px 2px rgba(28, 20, 70, .04), 0 6px 20px rgba(28, 20, 70, .05);
}
/* Bits of shared markup that only this style draws. */
html[data-home-layout="sections"] .nav-ico,
html[data-home-layout="sections"] .ui-only:not(.avatar-roles) { display: none; }
/* And the other way round: Sections' roles table is not drawn in Classic. */

/* ---- page and shell -------------------------------------------------------- */
html:not([data-home-layout="sections"]) body { background: var(--u-bg); color: var(--u-ink); }
@media (min-width: 901px) {
  html:not([data-home-layout="sections"]) .app { grid-template-columns: 256px 1fr; }
  html:not([data-home-layout="sections"]) .app.nav-collapsed { grid-template-columns: 1fr; }
  /* Signed out there is no sidebar: one column, or the sign-in card is squeezed into the sidebar's
     256px (Shan, 2026-10-12: "when my home layout is classic. my eladora sign in breaks"). */
  html:not([data-home-layout="sections"]) .app.app--plain { grid-template-columns: 1fr; }
}

html:not([data-home-layout="sections"]) .sidebar {
  background: var(--u-side); border-right: 1px solid var(--u-line); padding: 22px 16px;
}
/* The mark is the Eladora heart and the mailbox (Dr. Katz, 2026-07-31), left of the name as
   in the mockup. The yellow butterfly is NOT the mark (Shan, 2026-10-06: "icon here should
   be the actual original icon"); it belongs on the group page header. */
html:not([data-home-layout="sections"]) .brand { gap: 12px; padding: 0 8px 24px; }
html:not([data-home-layout="sections"]) .brand-mail { order: -1; }
html:not([data-home-layout="sections"]) .brand-mail > summary .mark {
  width: 44px; height: 44px; border-radius: 11px; box-shadow: 0 2px 8px rgba(109, 79, 216, .22);
}
html:not([data-home-layout="sections"]) .brand-name {
  font-family: var(--serif); font-weight: 700; font-size: 22px; color: var(--u-ink); letter-spacing: -.01em;
}
html:not([data-home-layout="sections"]) .brand-name small {
  font-family: var(--sans); font-size: 12px; font-weight: 400; color: var(--u-muted); letter-spacing: 0; margin-top: 3px;
}

html:not([data-home-layout="sections"]) .sidebar nav { gap: 4px; }
html:not([data-home-layout="sections"]) .sidebar nav a {
  display: flex; align-items: center; gap: 13px;
  padding: 10px 13px; border-radius: 10px;
  font-size: 15px; font-weight: 500; color: #4A4766;
}
html:not([data-home-layout="sections"]) .nav-ico { display: inline-grid; place-items: center; width: 22px; height: 22px; color: var(--u-muted); flex: none; }
html:not([data-home-layout="sections"]) .nav-ico .ui-ico { width: 22px; height: 22px; }
html:not([data-home-layout="sections"]) .sidebar nav a:hover { background: var(--u-hover); }
html:not([data-home-layout="sections"]) .sidebar nav a.is-current {
  background: var(--u-accent-soft); color: var(--u-accent); box-shadow: none;
}
html:not([data-home-layout="sections"]) .sidebar nav a.is-current .nav-ico { color: var(--u-accent); }
/* The pages under Administration (2026-11-14): indented, smaller, a thin line on their left. */
.sidebar nav a.nav-sub { margin-left: 24px; padding: 7px 12px; font-size: 14px; border-left: 2px solid var(--u-line, #e7e3ee); border-radius: 0 10px 10px 0; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-home-layout="sections"]) .sidebar nav a { color: var(--u-ink); }
}
:root[data-theme="dark"]:not([data-home-layout="sections"]) .sidebar nav a { color: var(--u-ink); }

/* Top bar: white, the page title in the serif face, the person on the right. */
html:not([data-home-layout="sections"]) .topbar {
  background: var(--u-card); border-bottom: 1px solid var(--u-line); padding: 14px 32px; gap: 18px; min-height: 72px;
}
html:not([data-home-layout="sections"]) .topbar .nav-toggle {
  width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0;
  border: 0; border-radius: 10px; background: var(--u-accent-soft); color: var(--u-accent); font-size: 17px;
}
html:not([data-home-layout="sections"]) .topbar .back-btn { width: auto; padding: 0 .8rem; font-size: 14px; }
html:not([data-home-layout="sections"]) .topbar-title {
  font-family: var(--serif); font-weight: 700; font-size: 25px; color: var(--u-ink); letter-spacing: -.01em;
}
html:not([data-home-layout="sections"]) .avatar-menu summary { align-items: center; gap: 12px; border-radius: 12px; padding: 2px 4px 2px 2px; }
html:not([data-home-layout="sections"]) .avatar {
  width: 44px; height: 44px; background: var(--u-accent-soft); color: var(--u-accent);
  font-size: 15px; box-shadow: none;
}
html:not([data-home-layout="sections"]) .avatar { position: relative; overflow: hidden; }
html:not([data-home-layout="sections"]) .avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 999px; }
/* Your roles, in the account menu under the name. The address line at its top is already
   beside the photo in the top bar, so it is not said twice (phones show it: no name there). */
html:not([data-home-layout="sections"]) .avatar-pop { min-width: 19rem; }
@media (min-width: 701px) { html:not([data-home-layout="sections"]) .avatar-pop .who { display: none; } }
html:not([data-home-layout="sections"]) .avatar-roles ul { list-style: none; margin: .3rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
html:not([data-home-layout="sections"]) .avatar-roles li { display: flex; flex-direction: column; padding: .45rem .6rem; border-radius: 9px; background: var(--u-accent-soft); }
html:not([data-home-layout="sections"]) .avatar-role-name { font-weight: 600; font-size: .88rem; color: var(--u-ink); }
html:not([data-home-layout="sections"]) .avatar-role-how { font-size: .76rem; color: var(--u-muted); }
html:not([data-home-layout="sections"]) .avatar-who { display: flex; flex-direction: column; line-height: 1.25; text-align: left; }
html:not([data-home-layout="sections"]) .avatar-name { font-size: 14.5px; font-weight: 600; color: var(--u-ink); }
html:not([data-home-layout="sections"]) .avatar-mail { font-size: 12.5px; color: var(--u-muted); }
html:not([data-home-layout="sections"]) .avatar-chev { color: var(--u-muted); display: inline-grid; }
html:not([data-home-layout="sections"]) .avatar-chev .ui-ico { width: 18px; height: 18px; }
@media (max-width: 700px) {
  html:not([data-home-layout="sections"]) .avatar-who,
  html:not([data-home-layout="sections"]) .avatar-chev { display: none; }
  html:not([data-home-layout="sections"]) .topbar { padding: 12px 16px; min-height: 60px; }
  html:not([data-home-layout="sections"]) .topbar-title { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  html:not([data-home-layout="sections"]) h1 { font-size: 1.9rem; }
}

html:not([data-home-layout="sections"]) main { padding: 32px 32px 24px; }
html:not([data-home-layout="sections"]) main.home-layout-page { max-width: 88rem; }
@media (max-width: 700px) { html:not([data-home-layout="sections"]) main { padding: 22px 16px; } }
html:not([data-home-layout="sections"]) h1 {
  font-family: var(--serif); font-weight: 700; font-size: 2.35rem; color: var(--u-ink); letter-spacing: -.015em; margin: 0 0 .35rem;
}
/* Your access: the top bar already names the page, so the big title is not said twice. */
html:not([data-home-layout="sections"]) .home-title { display: none; }
html:not([data-home-layout="sections"]) footer { padding: 1.2rem 32px 2.2rem; }

/* ---- cards ------------------------------------------------------------------ */
html:not([data-home-layout="sections"]) .ui-card {
  background: var(--u-card); border: 1px solid var(--u-line); border-radius: 16px;
  box-shadow: var(--u-shadow); padding: 22px 20px 20px; margin: 0 0 22px;
}
html:not([data-home-layout="sections"]) .ui-sec-head { display: flex; align-items: flex-start; gap: 14px; margin: 0 0 18px; }
html:not([data-home-layout="sections"]) .ui-sec-head h2 {
  font-family: var(--serif); font-weight: 700; font-size: 1.3rem; color: var(--u-ink); margin: 0; line-height: 1.3;
}
html:not([data-home-layout="sections"]) .ui-sec-head p { margin: .15rem 0 0; color: var(--u-muted); font-size: .9rem; }
html:not([data-home-layout="sections"]) .ui-sec-ico { color: var(--u-ink); display: inline-grid; margin-top: 2px; }
html:not([data-home-layout="sections"]) .ui-sec-ico .ui-ico { width: 26px; height: 26px; }

/* Section tiles, tinted by group. */
html:not([data-home-layout="sections"]) .ui-tiles {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 12px;
}
html:not([data-home-layout="sections"]) .ui-tile {
  --t: #6D4FD8;
  position: relative; display: flex; align-items: center; gap: 11px; min-height: 76px; padding: 12px 12px 12px 13px;
  border-radius: 12px; text-decoration: none; color: var(--u-ink);
  background: color-mix(in srgb, var(--t) 7%, var(--u-card));
  border: 1px solid color-mix(in srgb, var(--t) 26%, var(--u-card));
  transition: box-shadow .12s, transform .12s, border-color .12s;
}
html:not([data-home-layout="sections"]) .ui-tile:hover {
  transform: translateY(-1px); border-color: color-mix(in srgb, var(--t) 50%, var(--u-card));
  box-shadow: 0 6px 16px color-mix(in srgb, var(--t) 16%, transparent);
}
html:not([data-home-layout="sections"]) .ui-tile-ico {
  width: 40px; height: 40px; border-radius: 11px; flex: none; display: grid; place-items: center;
  background: var(--u-card); color: var(--t); border: 1.5px solid color-mix(in srgb, var(--t) 40%, var(--u-card));
  font-weight: 700; font-size: .8rem;
}
html:not([data-home-layout="sections"]) .ui-tile-ico svg { width: 21px; height: 21px; }
html:not([data-home-layout="sections"]) .ui-tile-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
html:not([data-home-layout="sections"]) .ui-tile-name { font-weight: 600; font-size: .85rem; }
html:not([data-home-layout="sections"]) .ui-tile-sub { color: var(--u-muted); font-size: .76rem; margin-top: 2px; }
html:not([data-home-layout="sections"]) .ui-tile.coming .ui-tile-sub { font-style: italic; }
html:not([data-home-layout="sections"]) .ui-go { color: var(--t, var(--u-accent)); font-size: 1.3rem; line-height: 1; flex: none; }
html:not([data-home-layout="sections"]) .ui-tile .ui-go { margin-left: -5px; }
/* The unread count messaging.js puts on the Messaging tile. */
html:not([data-home-layout="sections"]) .ui-tile .alert-dot { position: absolute; top: 8px; right: 10px; margin: 0; }

html:not([data-home-layout="sections"]) .ui-tile--messaging { --t: #E0A11B; }
html:not([data-home-layout="sections"]) .ui-tile--compliance { --t: #7C5CE6; }
html:not([data-home-layout="sections"]) .ui-tile--hospice { --t: #2F8FC9; }
html:not([data-home-layout="sections"]) .ui-tile--qapi { --t: #D9466F; }
html:not([data-home-layout="sections"]) .ui-tile--field { --t: #3E9B5F; }
html:not([data-home-layout="sections"]) .ui-tile--admin { --t: #D2455A; }
html:not([data-home-layout="sections"]) .ui-tile--ai { --t: #8B5CF6; }
html:not([data-home-layout="sections"]) .ui-tile--contracts { --t: #E07A33; }
html:not([data-home-layout="sections"]) .ui-tile--finances { --t: #2E9A57; }
html:not([data-home-layout="sections"]) .ui-tile--forms { --t: #C99A12; }
html:not([data-home-layout="sections"]) .ui-tile--general { --t: #43A066; }
html:not([data-home-layout="sections"]) .ui-tile--hr { --t: #8A4FD8; }
html:not([data-home-layout="sections"]) .ui-tile--policies { --t: #2C8C9A; }
html:not([data-home-layout="sections"]) .ui-tile--business { --t: #D9822B; }
html:not([data-home-layout="sections"]) .ui-tile--supplies { --t: #3B6FD8; }
html:not([data-home-layout="sections"]) .ui-tile--scheduling,
html:not([data-home-layout="sections"]) .ui-tile--drchrono { --t: #4E5FD0; }

/* ---- tables in a card --------------------------------------------------------- */
html:not([data-home-layout="sections"]) .ui-table-wrap { overflow-x: auto; }
html:not([data-home-layout="sections"]) .ui-card table { box-shadow: none; border: 1px solid var(--u-line); border-radius: 12px; background: var(--u-card); }
html:not([data-home-layout="sections"]) .ui-card th {
  background: color-mix(in srgb, var(--u-accent) 3%, var(--u-card)); color: var(--u-muted);
  font-size: .74rem; letter-spacing: .06em; padding: .8rem 1rem;
}
html:not([data-home-layout="sections"]) .ui-card td { padding: .95rem 1rem; vertical-align: middle; border-bottom-color: var(--u-line); }
html:not([data-home-layout="sections"]) .ui-cell-ico { display: inline-grid; vertical-align: -4px; margin-right: .6rem; color: var(--u-muted); }
html:not([data-home-layout="sections"]) .ui-cell-ico .ui-ico { width: 18px; height: 18px; }

/* ---- the profile in Sections too (Shan, 2026-10-09: "this other profile thing, make it show in
   the sections") ---------------------------------------------------------------------------------
   Classic's account button (photo, name and address beside the circle, the chevron) and "Your
   roles" in its menu, drawn the same way in Sections with Sections' own colours. Phones keep the
   circle alone, as Classic does. */
html[data-home-layout="sections"] .avatar-menu summary { align-items: center; gap: 12px; border-radius: 12px; padding: 2px 4px 2px 2px; }
html[data-home-layout="sections"] .avatar { position: relative; overflow: hidden; }
html[data-home-layout="sections"] .avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 999px; }
html[data-home-layout="sections"] .avatar-who { display: flex; flex-direction: column; line-height: 1.25; text-align: left; }
html[data-home-layout="sections"] .avatar-name { font-size: 14.5px; font-weight: 600; color: var(--ink); }
html[data-home-layout="sections"] .avatar-mail { font-size: 12.5px; color: var(--muted); }
html[data-home-layout="sections"] .avatar-chev { color: var(--muted); display: inline-grid; }
html[data-home-layout="sections"] .avatar-chev .ui-ico { width: 18px; height: 18px; }
html[data-home-layout="sections"] .avatar-pop { min-width: 19rem; }
@media (min-width: 701px) { html[data-home-layout="sections"] .avatar-pop .who { display: none; } }
html[data-home-layout="sections"] .avatar-roles ul { list-style: none; margin: .3rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
html[data-home-layout="sections"] .avatar-roles li { display: flex; flex-direction: column; padding: .45rem .6rem; border-radius: 9px; background: var(--accent-soft); }
html[data-home-layout="sections"] .avatar-role-name { font-weight: 600; font-size: .88rem; color: var(--ink); }
html[data-home-layout="sections"] .avatar-role-how { font-size: .76rem; color: var(--muted); }
@media (max-width: 700px) {
  html[data-home-layout="sections"] .avatar-who,
  html[data-home-layout="sections"] .avatar-chev { display: none; }
}
