/* ============================================================================
 * RaneWorks brand layer for Kauoha
 * https://www.raneworks.com/brand-guidelines.html
 *
 * WHAT THIS IS
 *   One place that decides what "our purple" means, plus the overrides that
 *   put it on buttons and common elements. Loaded AFTER UIkit and master.css
 *   so it wins without anyone editing the UIkit build.
 *
 * WHY IT EXISTS
 *   Before this, three near-identical purples were in circulation and none of
 *   them was the brand value:
 *     #694bcd  master.css header, email modal, service status
 *     #6b4dd3  quantity rules, order comparison, badges, cron emails
 *     #6B4DD1  the actual brand purple
 *   Every new screen picked whichever was nearest to hand. One token stops
 *   that recurring.
 *
 * LIGHT UI, DARK GUIDELINES
 *   The brand page is written for the marketing site, which sits on near-black
 *   surfaces. Kauoha is a light admin tool, so the Light Band values are the
 *   relevant ones and the dark surface colours are deliberately absent here.
 *
 *   The one place we knowingly depart: ORCHID (#b9a8e6) is listed as an accent
 *   for eyebrows, links and arrows. That is sound on #131019. On white it
 *   measures 2.14:1, far below the 4.5:1 needed for body text, so here it is
 *   allowed on borders and fills ONLY and never carries text.
 *
 * WHAT IS DELIBERATELY NOT TOUCHED
 *   Status colours. Invoiced blue, submitted green, draft orange and the
 *   comparison screen's difference colours encode meaning that people have
 *   learned to read. Rebranding them would trade comprehension for
 *   consistency. See media/css/order-status-badge.css.
 *
 *   Their existing pairings were also already correct: green and orange fail
 *   against white text (1.95:1 and 2.05:1) and the badge CSS pairs both with
 *   dark ink instead, which scores AAA.
 * ========================================================================= */

:root {
    /* Purple ramp. Default, hover, pressed. */
    --rw-purple:        #6B4DD1;   /* Brand Purple, matches the logo */
    --rw-purple-hover:  #8a6fe6;   /* Bright Purple */
    --rw-purple-active: #4a2f93;   /* Deep Purple */
    --rw-orchid:        #b9a8e6;   /* borders and fills only, never text */
    --rw-on-pressed:    #ece8f7;   /* off-white text on a pressed filled button, 8.2:1 on Deep Purple */

    /* Light band. */
    --rw-band:          #f4f3f7;   /* page background */
    --rw-surface:       #ffffff;   /* cards */
    --rw-ink:           #1b1623;   /* headings and body */
    --rw-muted:         #6f6880;   /* captions and meta */
    --rw-hairline:      #e4e2ea;   /* borders and dividers */

    /* Tints derived from the ramp, for hover fills and focus rings. */
    --rw-purple-tint:   #f7f5ff;
    --rw-purple-tint-2: #efeaff;
    --rw-focus-ring:    rgba(107, 77, 209, .30);

    /* A surface that sits just off white: inset panels, table headers, alert
       bodies. Warmer than a plain grey because it carries a trace of the
       purple, which is what stops the chrome reading as generic Bootstrap. */
    --rw-surface-alt:   #faf9fc;

    /* Corner radius is 4px per the guidelines. */
    --rw-radius:        4px;

    /* Motion easing from the guidelines. */
    --rw-ease:          cubic-bezier(0.22, 0.68, 0.18, 1);
}

/* ---------------------------------------------------------------- typography
 * Inter is the brand face. Weight 600 for labels and buttons, 300 for large
 * display headings with tight tracking, per the guidelines.
 *
 * The font itself is linked from page-open.php. If that link is ever removed
 * this degrades to the system sans-serif rather than breaking.
 * ------------------------------------------------------------------------- */

body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--rw-ink);
}

/* Sentence case for headings, all-caps reserved for small eyebrow labels. */
h1, .uk-h1 { font-weight: 300; letter-spacing: -0.02em; }
h2, .uk-h2 { font-weight: 300; letter-spacing: -0.015em; }
h3, .uk-h3 { font-weight: 500; }

/* ------------------------------------------------------------------- buttons
 * UIkit ships fully rounded pills. The guidelines specify a 4px radius, so
 * these override the shape as well as the colour.
 * ------------------------------------------------------------------------- */

.uk-button {
    border-radius: var(--rw-radius);
    font-family: inherit;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: none;
    transition: background-color .15s var(--rw-ease),
                border-color .15s var(--rw-ease),
                color .15s var(--rw-ease);
}

.uk-button-primary {
    background-color: var(--rw-purple);
    border: 1px solid var(--rw-purple);
    color: #fff;
}
/* Deep Purple, not Bright: white on Bright Purple is only 3.82:1. #5609. */
.uk-button-primary:hover,
.uk-button-primary:focus {
    background-color: var(--rw-purple-active);
    border-color: var(--rw-purple-active);
    color: #fff;
}
.uk-button-primary:active,
.uk-button-primary.uk-active {
    background-color: var(--rw-purple-active);
    border-color: var(--rw-purple-active);
    color: var(--rw-on-pressed);
}

/* Secondary reads as the brand's ghost button, translated to a light surface. */
.uk-button-default {
    background-color: var(--rw-surface);
    border: 1px solid var(--rw-hairline);
    color: var(--rw-ink);
}
.uk-button-default:hover,
.uk-button-default:focus {
    border-color: var(--rw-purple);
    background-color: var(--rw-purple-tint);
    color: var(--rw-purple);
}

/* Keyboard focus must stay visible. UIkit removes the outline by default. */
.uk-button:focus-visible,
.uk-input:focus-visible,
.uk-select:focus-visible,
.uk-textarea:focus-visible,
a:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--rw-focus-ring);
}

/* --------------------------------------------------------------------- links */

a { color: var(--rw-purple); }
a:hover { color: var(--rw-purple-active); }

/* Inherit colour where a link wraps a component that colours itself.
   Not a.uk-button:hover: that outranked every button's own hover colour, so a
   button written as a link (Login, Save, ...) turned near-black text on purple
   when hovered or pressed. Each button style sets its own hover colour. */
a.uk-icon-link,
.uk-navbar-nav > li > a { color: inherit; }

/* ------------------------------------------------------------------- inputs */

.uk-input:focus,
.uk-select:focus,
.uk-textarea:focus {
    border-color: var(--rw-purple);
}

/* --------------------------------------------------------- surfaces and rules */

.uk-card-default {
    border-radius: var(--rw-radius);
    border: 1px solid var(--rw-hairline);
    box-shadow: none;
}

hr, .uk-hr { border-top-color: var(--rw-hairline); }

/* Table headers pick up the brand light band instead of plain grey. */
.uk-table th {
    color: var(--rw-muted);
    border-bottom: 2px solid var(--rw-hairline);
    background: #faf9fc;
}

/* ---------------------------------------------------------------------- tabs */

.uk-tab > .uk-active > a {
    border-color: var(--rw-purple);
    color: var(--rw-purple);
}
.uk-tab > li > a:hover { color: var(--rw-purple); }

/* ------------------------------------------------------------------- badges */

.uk-badge {
    background-color: var(--rw-purple);
    border-radius: 999px;   /* count badges stay circular; 4px would look broken */
}

/* ---------------------------------------------------- UIkit defaults, #5609
 * The platform sweep found these leaking through on every page. Fixing them here
 * means pages inherit the guide without being edited one by one.
 * ------------------------------------------------------------------------- */

/* UIkit gives headings their own font stack, so none of them were in Inter. */
h1, h2, h3, h4, h5, h6,
.uk-h1, .uk-h2, .uk-h3, .uk-h4, .uk-h5, .uk-h6,
.uk-heading-bullet, .uk-heading-line, .uk-modal-title {
    font-family: inherit;
    color: var(--rw-ink);
}

/* Checked boxes were UIkit blue everywhere. */
.uk-checkbox:checked, .uk-checkbox:indeterminate, .uk-radio:checked,
.uk-checkbox:checked:focus, .uk-checkbox:indeterminate:focus, .uk-radio:checked:focus {
    background-color: var(--rw-purple);
    border-color: var(--rw-purple);
}
.uk-checkbox:focus, .uk-radio:focus { border-color: var(--rw-purple); }
.uk-checkbox:focus-visible, .uk-radio:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--rw-focus-ring); }

/* Text. UIkit's #999 muted is 2.85:1 on white. Its green and amber are under 2:1. */
.uk-text-muted, .uk-text-meta { color: var(--rw-muted) !important; }
.uk-text-primary { color: var(--rw-purple) !important; }
.uk-text-secondary, .uk-text-emphasis { color: var(--rw-ink) !important; }
.uk-text-danger { color: #c2324a !important; }
.uk-text-success { color: #1a7f4e !important; }
.uk-text-warning { color: #9a5400 !important; }
.uk-form-label { color: var(--rw-ink); }

/* Fields, rules and panels. */
.uk-input, .uk-select, .uk-textarea, .uk-input:focus, .uk-select:focus, .uk-textarea:focus {
    color: var(--rw-ink);
    border-radius: var(--rw-radius);
}
.uk-input, .uk-select, .uk-textarea { border-color: var(--rw-hairline); }
.uk-input::placeholder, .uk-textarea::placeholder { color: var(--rw-muted); opacity: 1; }
.uk-background-muted { background-color: var(--rw-surface-alt) !important; }
.uk-table-divider > tr:not(:first-child),
.uk-table-divider > :not(:first-child) > tr,
.uk-table-divider > :first-child > tr:not(:first-child) { border-top-color: var(--rw-hairline); }
.uk-table-striped > tr:nth-of-type(odd),
.uk-table-striped tbody tr:nth-of-type(odd) {
    background: var(--rw-surface-alt);
    border-top-color: var(--rw-hairline);
    border-bottom-color: var(--rw-hairline);
}
.uk-table-hover > tr:hover, .uk-table-hover tbody tr:hover { background: var(--rw-purple-tint); }
.uk-table th { font-size: .75rem; }
.uk-card-default .uk-card-header, .uk-card-default .uk-card-footer,
.uk-modal-header, .uk-modal-footer { border-color: var(--rw-hairline); }
.uk-heading-bullet::before { border-left-color: var(--rw-hairline); }
.uk-heading-line > ::before, .uk-heading-line > ::after { border-bottom-color: var(--rw-hairline); }
.uk-tab::before { border-bottom-color: var(--rw-hairline); }

/* Menus. */
.uk-dropdown-nav > li > a, .uk-nav-default > li > a, .uk-navbar-dropdown-nav > li > a { color: var(--rw-ink); }
.uk-dropdown-nav > li > a:hover, .uk-nav-default > li > a:hover,
.uk-navbar-dropdown-nav > li > a:hover { color: var(--rw-purple); }
.uk-nav-divider { border-top-color: var(--rw-hairline) !important; }

/* Buttons the guide has no separate style for. Danger and success keep their
   meaning at a color white text can pass on. */
.uk-button-secondary, .uk-button-secondary:focus {
    background-color: var(--rw-surface);
    border: 1px solid var(--rw-hairline);
    color: var(--rw-ink);
}
.uk-button-secondary:hover {
    background-color: var(--rw-purple-tint);
    border-color: var(--rw-purple);
    color: var(--rw-purple);
}
.uk-button-danger, .uk-button-danger:focus { background-color: #c2324a; border: 1px solid #c2324a; color: #fff; }
.uk-button-danger:hover { background-color: #a02539; border-color: #a02539; color: #fff; }

/* Pressed and selected states, which UIkit would otherwise draw in its own
   greys and near-black. Filled buttons press to off-white text, outline
   buttons press to their hover look. Loaded after master.css, so this also
   covers .uk-button-purple and .uk-button-success defined there. */
.uk-button-purple:active, .uk-button-purple.uk-active,
.uk-button-success:active, .uk-button-success.uk-active { color: var(--rw-on-pressed); }
.uk-button-danger:active, .uk-button-danger.uk-active {
    background-color: #a02539; border-color: #a02539; color: var(--rw-on-pressed);
}
.uk-button-default:active, .uk-button-default.uk-active,
.uk-button-secondary:active, .uk-button-secondary.uk-active {
    background-color: var(--rw-purple-tint);
    border-color: var(--rw-purple);
    color: var(--rw-purple-active);
}
.uk-button-link { color: var(--rw-purple); }
.uk-button-link:hover { color: var(--rw-purple-active); }
.uk-button-default:disabled, .uk-button-primary:disabled, .uk-button-secondary:disabled,
.uk-button-danger:disabled, .uk-button-success:disabled {
    background-color: var(--rw-surface-alt);
    border-color: var(--rw-hairline);
    color: var(--rw-muted);
}

/* Labels, using the same pairings as the order status badges. */
.uk-label { border-radius: var(--rw-radius); background-color: var(--rw-purple); color: #fff; }
.uk-label-success { background-color: #32d296; color: #0a4a2e; }
.uk-label-warning { background-color: #faa05a; color: #5a2d00; }
.uk-label-danger { background-color: #c2324a; color: #fff; }

/* Alerts and save messages. UIkit's colored text on pale tints fails contrast. */
.uk-alert-primary { background: var(--rw-purple-tint); color: var(--rw-purple-active); }
.uk-alert-success { background: #e9f7ef; color: #17683a; }
.uk-alert-warning { background: #fff6e6; color: #8a5300; }
.uk-alert-danger  { background: #fef3f6; color: #c72040; }
.uk-notification-message { border-radius: var(--rw-radius); background: var(--rw-surface); color: var(--rw-ink); box-shadow: 0 4px 16px rgba(27, 22, 35, .14); }
.uk-notification-message-primary { color: var(--rw-purple-active); }
.uk-notification-message-success { color: #17683a; }
.uk-notification-message-warning { color: #8a5300; }
.uk-notification-message-danger  { color: #c72040; }

/* Found on the recheck. */
.uk-alert { background: var(--rw-surface-alt); color: var(--rw-ink); }
.uk-alert-primary { background: var(--rw-purple-tint); color: var(--rw-purple-active); }
.uk-alert-success { background: #e9f7ef; color: #17683a; }
.uk-alert-warning { background: #fff6e6; color: #8a5300; }
.uk-alert-danger  { background: #fef3f6; color: #c72040; }
.uk-card-default { color: var(--rw-ink); }
.uk-card-default .uk-card-title { color: var(--rw-ink); }
.uk-select:not([multiple]):not([size]) { border-color: var(--rw-hairline); color: var(--rw-ink); }
.uk-select:not([multiple]):not([size]):focus { border-color: var(--rw-purple); }
:not(pre) > code, :not(pre) > kbd, :not(pre) > samp { color: var(--rw-purple-active); }
.uk-border-rounded { border-radius: var(--rw-radius); }
.uk-subnav-pill > * > :first-child { color: var(--rw-muted); border-radius: var(--rw-radius); }
.uk-subnav-pill > .uk-active > a { background-color: var(--rw-purple); color: #fff; }
.uk-pagination > * > * { color: var(--rw-muted); }
.uk-pagination > * > :hover { color: var(--rw-ink); }
.uk-pagination > .uk-active > * { color: var(--rw-purple); }

.uk-input:disabled, .uk-select:disabled, .uk-textarea:disabled { background-color: var(--rw-surface-alt); color: var(--rw-muted); }
.uk-list-divider > :nth-child(n+2) { border-top-color: var(--rw-hairline); }
em { color: inherit; }
pre { color: var(--rw-ink); background: var(--rw-surface-alt); border-color: var(--rw-hairline); border-radius: var(--rw-radius); }
:not(pre) > code { background: var(--rw-surface-alt); }

/* Pagination, from the jPages-style markup on the client lists. */
.ellipse.clickable { color: var(--rw-muted); }
a.page-link { color: var(--rw-purple); border-color: var(--rw-hairline) !important; }
.current.prev, .current.next, span.current {
    background: var(--rw-purple) !important;
    border-color: var(--rw-purple) !important;
    color: #fff !important;
}

/* ---------------------------------------------------- brand-purple utilities
 * For the places that currently hardcode a purple inline. Using these instead
 * means the next brand change is one line here, not another sweep.
 * ------------------------------------------------------------------------- */

.rw-purple      { color: var(--rw-purple) !important; }
.rw-purple-bg   { background-color: var(--rw-purple) !important; color: #fff !important; }
.rw-purple-bd   { border-color: var(--rw-purple) !important; }
.rw-tint-bg     { background-color: var(--rw-purple-tint) !important; }


/* Site notices, 2026-11-13 (media/js/notify.js). Replaces UIkit's large
   default: a compact card in the style guide's colours, 14px text, an icon
   and a coloured edge for the kind of notice, and a close button. */
.uk-notification { width: 440px; max-width: calc(100% - 32px); }
.uk-notification-bottom-center { margin-left: 0; transform: translateX(-50%); bottom: 16px; }
.uk-notification-message { padding: 0; margin-top: 8px; font-size: 14px; line-height: 1.45; background: none; box-shadow: none; border-radius: var(--rw-radius); color: var(--rw-ink); }
.uk-notification-close { display: none !important; }
.kn { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px 11px 14px; background: var(--rw-surface); color: var(--rw-ink);
      border: 1px solid var(--rw-hairline); border-left: 3px solid var(--rw-purple); border-radius: var(--rw-radius);
      box-shadow: 0 6px 20px rgba(27, 22, 35, .14); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; cursor: default; }
.kn-icon { flex: none; display: flex; align-items: center; height: 20px; color: var(--rw-purple); }
.kn-text { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; line-height: 20px; overflow-wrap: anywhere; }
.kn-text ul { margin: 4px 0 0; padding-left: 18px; font-weight: 400; }
.kn-text .uk-text-small, .kn-text .uk-text-bold { font-size: inherit; font-weight: inherit; }
.kn-text a { font-weight: 600; }
.kn-count { margin-left: 6px; font-size: 12px; font-weight: 600; color: var(--rw-muted); }
.kn-count[hidden] { display: none; }
.kn-close { flex: none; width: 24px; height: 24px; margin: -2px -4px 0 0; padding: 0; border: 0; border-radius: var(--rw-radius); background: none;
            color: var(--rw-muted); font-size: 20px; line-height: 22px; cursor: pointer; transition: background-color .15s var(--rw-ease), color .15s var(--rw-ease); }
.kn-close:hover { background: var(--rw-surface-alt); color: var(--rw-ink); }
.kn-close:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--rw-focus-ring); }
.kn-success { border-left-color: #1a7f4e; } .kn-success .kn-icon { color: #1a7f4e; }
.kn-warning { border-left-color: #b86e00; } .kn-warning .kn-icon { color: #b86e00; }
.kn-danger  { border-left-color: #c2324a; background: #fffafb; } .kn-danger .kn-icon { color: #c2324a; }
.kn-primary { border-left-color: var(--rw-purple); } .kn-primary .kn-icon { color: var(--rw-purple); }
@media (max-width: 639px) {
  .uk-notification { width: auto; left: 16px; right: 16px; max-width: none; }
  .uk-notification-bottom-center { transform: none; }
}
