/* =========================================================================
   APNS design tokens -- the one place the shared values are set.

   Loaded first by the three signed-in frames: layouts/staff (clinician,
   admin and billing pages) and layouts/patient. Until 2026-11-13 the staff
   stylesheet, the admin console's and the patient portal's each set these
   names again and disagreed slightly (three body-text colors, three muted
   grays). An area stylesheet now sets only what is particular to it: its
   type size, its smallest tap target, its sidebar width.

   The colors are the website's (docs/SIMPLE-FOR-EVERYONE.md, section 2).
   The shapes are the approved design reference's (docs/DESIGN-REFERENCE.md,
   docs/design-reference/build.py): flat cards with a thin lavender line, a
   lavender band across a card's heading, an 8 px corner on controls, a
   12 px corner on cards and a 6 px corner on a status chip.

   Every text color here is checked against the patient floor of 7:1, which
   is stricter than the staff floor of 4.5:1, so one set serves both.
   ========================================================================= */

:root {
    /* Brand */
    --apns-primary: #6A3F8F;        /* buttons, links, the active menu item: 7.7:1 on white */
    --apns-primary-dark: #4C006D;   /* headings, pressed and hover states, the sidebar: 13.7:1 on white */
    --apns-accent: #6A3F8F;         /* section titles, emphasis */

    /* Text */
    --apns-text: #1F1B24;           /* 16.9:1 on white */
    --apns-muted: #4A4458;          /* 9.3:1 on white, 8.8:1 on the panel, 7.9:1 on the tint */

    /* Surfaces */
    --apns-surface: #FFFFFF;
    --apns-page-bg: #F7F4FB;        /* the page behind the cards: white with a little lavender */
    --apns-panel: #FAF7FD;          /* a quiet panel inside a card */
    --apns-panel-border: #E6DDF0;   /* the 1px line around cards and panels */
    --apns-tint: #F0E9FF;           /* the band across a card heading, a table's heading row, a light tile */
    --apns-divider: #EFE9F6;        /* rules between rows; decorative, not a control */
    --apns-line: #8E7BA3;           /* borders of inputs and outlined buttons: 3.8:1 on white */

    /* Shape */
    --apns-radius-card: 12px;
    --apns-radius-control: 8px;
    --apns-radius-chip: 999px;      /* a round count, a pill in the top bar */
    --apns-radius-status: 6px;      /* a status chip: "Not Started", "In Progress" */
    --apns-shadow: 0 1px 2px rgba(31, 27, 36, .05), 0 2px 8px rgba(76, 0, 109, .04);
    --apns-shadow-hover: 0 6px 20px rgba(76, 0, 109, .12);
    --apns-focus: #6A3F8F;          /* the 3px keyboard focus ring */

    /* The frame: a dark purple sidebar, 300 px wide, with the page's item
       as a lighter pill, and a white top bar 72 px tall. White on the pill
       is 7.7:1. The pill against the sidebar is only 1.8:1, too little to
       mark a state on its own, so the item you are on also carries a white
       bar at its left edge: 13.7:1 against the sidebar, 7.7:1 against the
       pill. */
    --apns-sidebar-width: 300px;
    --apns-topbar-height: 72px;
    --apns-sidebar-bg: #4C006D;
    --apns-sidebar-text: #FFFFFF;
    --apns-sidebar-quiet: #EADFF3;  /* sub-items and notes: 10.7:1 on the sidebar */
    --apns-sidebar-hover: rgba(255, 255, 255, .12);
    --apns-sidebar-active: #6A3F8F;
    --apns-sidebar-mark: inset 4px 0 0 #FFFFFF;
    --apns-sidebar-rule: rgba(255, 255, 255, .16);
    --apns-sidebar-line: rgba(255, 255, 255, .3);   /* the staff sidebar's two rules, as the reference draws them */

    /* Kept for the few places that still paint a gradient (sign-in pages). */
    --apns-gradient: linear-gradient(135deg, var(--apns-primary-dark) 0%, var(--apns-primary) 100%);

    /* Status pairs: red for danger and allergies, amber for warnings, green
       for success and "done". Each word on its own background is 7:1 or
       better, because a status chip is words somebody reads. */
    --apns-ok-bg: #E7F5EC;      --apns-ok-text: #0E5028;      /* 8.5:1 */
    --apns-warn-bg: #FFF3DC;    --apns-warn-text: #6B4100;    /* 8.0:1 */
    --apns-danger-bg: #FBE9EA;  --apns-danger-text: #8E1520;  /* 7.9:1 */
    --apns-info-bg: #F0E9FF;    --apns-info-text: #4C006D;    /* 11.7:1. "For your information" is the brand
                                                                  purple: the standard keeps other hues for
                                                                  status, and has no blue. */
    --apns-neutral-bg: #F0EDF4; --apns-neutral-text: #4A4458; /* 8.0:1 */
}

/* The staff sidebar is the reference's 300 px from 1200 px up, the widths
   the reference is drawn for. On a narrower screen that still shows the
   sidebar (992 to 1199 px: a small laptop, a tablet on its side) it keeps
   the 270 px it had before the reference, because the pages beside it were
   fitted to that: at 1024 px the schedule's list is 30 px too wide for
   anything less. Below 992 px the sidebar is a drawer and takes no room. */
@media (min-width: 992px) and (max-width: 1199.98px) {
    :root { --apns-sidebar-width: 270px; }
}
