/*
 * Nexus org look and feel, matched to UVTAB OIDS (oids.uvtab.go.ug):
 * Lato type, a navy gradient top bar, a light sidebar with a tinted
 * active item. Plain CSS on purpose: it needs no Tailwind rebuild, and
 * every rule is scoped to an app-* class so page content keeps its own
 * Tailwind styling. Loaded after Tailwind by org/_theme_head.html.
 * Added in 1.0.6.
 */

:root {
    --app-font: Lato, "Helvetica Neue", Helvetica, Arial, sans-serif;
    --app-header-h: 58px;
    --app-fz: 13.5px;
    --app-fz-sm: 12px;
    --app-fz-h1: 20px;
    --app-line: 1.45;
    --app-ink: #1b1b1b;
    --app-ink-2: #565d76;
    --app-page-bg: #f4f6fb;
    --app-brand: #131a46;
    --app-brand-2: #1c2557;
    --app-brand-line: #3b4a8c;
    --app-on-brand: #edeff7;
    --app-on-brand-muted: #a9b0d4;
    --app-accent: #2f52c8;
    --app-accent-tint: #dce4f8;
    --app-accent-hover: rgba(47, 82, 200, .07);
    --app-sidebar-bg: #eaecf4;
    --app-submenu-bg: #f1f2f8;
    --app-footer-bg: #f1f3f9;
    --app-footer-ink: #5a6178;
    --app-border: #d3d7e4;
}

/* Type: Lato everywhere, including form controls (Tailwind's preflight
   makes them inherit). Lato ships 300/400/700/900 + italic; semibold
   (600) renders as Lato Bold, as on OIDS. */
.app-body {
    font-family: var(--app-font);
    color: var(--app-ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Top bar ---------------------------------------------------------- */
.app-header {
    flex-shrink: 0;
    height: var(--app-header-h);
    background: linear-gradient(180deg, var(--app-brand-2) 0, var(--app-brand) 100%);
    border-bottom: 2px solid var(--app-brand-line);
    box-shadow: 0 1px 6px rgba(19, 26, 70, .25);
    color: var(--app-on-brand);
    position: relative;
    z-index: 40;
}
.app-header__inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
}
@media (min-width: 768px) {
    .app-header__inner { padding: 0 1.5rem; }
}
.app-header__brand { display: flex; align-items: center; }
.app-header__logo { height: 38px; width: auto; }
.app-header__user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 8px 3px 3px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--app-on-brand);
    font-size: var(--app-fz);
    cursor: pointer;
}
.app-header__user:hover { background: rgba(255, 255, 255, .08); }
.app-header__user:focus-visible { outline: 2px solid var(--app-on-brand-muted); outline-offset: 2px; }
.app-header__avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, .35);
    flex-shrink: 0;
}
.app-header__avatar--blank { background: var(--app-brand-line); color: var(--app-on-brand-muted); padding: 4px; }
.app-header__username {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.app-header__caret { color: var(--app-on-brand-muted); font-size: 10px; }
@media (max-width: 639px) {
    .app-header__username { display: none; }
}

/* User menu (shown/hidden by the existing `hidden` toggle). */
.app-menu {
    min-width: 13rem;
    padding: 4px 0;
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(19, 26, 70, .18);
    font-size: var(--app-fz);
    color: var(--app-ink);
}
.app-menu__who { padding: .55rem .9rem; border-bottom: 1px solid var(--app-border); }
.app-menu__name { font-weight: 700; }
.app-menu__phone { color: var(--app-ink-2); font-size: var(--app-fz-sm); font-weight: 300; }
.app-menu__item {
    display: flex;
    align-items: center;
    gap: .55rem;
    width: 100%;
    padding: .45rem .9rem;
    border: 0;
    background: transparent;
    color: var(--app-ink);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.app-menu__item:hover,
.app-menu__item:focus { background: var(--app-accent-tint); color: var(--app-accent); outline: none; }
.app-menu__item i { width: 16px; text-align: center; }

/* ---- Side navigation -------------------------------------------------- */
.app-sidebar {
    background: var(--app-sidebar-bg);
    border-right: 1px solid var(--app-border);
    color: var(--app-ink);
    font-size: var(--app-fz);
    line-height: var(--app-line);
}
.app-sidebar__head {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 10px 14px;
    border-bottom: 1px solid var(--app-border);
}
.app-sidebar__toggle {
    border: 0;
    background: transparent;
    color: var(--app-ink-2);
    padding: 2px 4px;
    cursor: pointer;
}
.app-sidebar__toggle:hover { color: var(--app-accent); }
.app-sidebar__nav { padding: 4px 0 12px; }
.app-sidebar nav::-webkit-scrollbar-track { background: var(--app-sidebar-bg); }

.app-nav-section {
    padding: 16px 16px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--app-ink-2);
    white-space: nowrap;
    overflow: hidden;
}
.sidebar.collapsed .app-nav-section { padding: 10px 0 4px; border-top: 1px solid var(--app-border); }
.sidebar.collapsed .app-nav-section:first-child { border-top: 0; }

.app-nav-link {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 7px 16px 7px 13px;
    border: 0;
    border-left: 3px solid transparent;
    background: transparent;
    color: var(--app-ink);
    font-size: var(--app-fz);
    line-height: var(--app-line);
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .1s, color .1s;
}
.app-nav-link .sidebar-icon {
    width: 16px;
    font-size: 14px;
    text-align: center;
    color: var(--app-ink-2);
    flex-shrink: 0;
}
.app-nav-link:hover { background: var(--app-accent-hover); color: var(--app-accent); }
.app-nav-link:hover .sidebar-icon { color: var(--app-accent); }
.app-nav-link:focus-visible { outline: 2px solid var(--app-accent); outline-offset: -2px; }
.app-nav-link.is-active {
    background: var(--app-accent-tint);
    border-left-color: var(--app-accent);
    color: var(--app-accent);
    font-weight: 700;
}
.app-nav-link.is-active .sidebar-icon { color: var(--app-accent); }
.app-nav-link.is-disabled { opacity: .45; pointer-events: none; }

/* Accordion groups: the trigger is an app-nav-link; its panel is a
   slightly lighter submenu, as on OIDS. */
.nav-accordion-trigger.app-nav-link { justify-content: space-between; }
.nav-accordion-trigger > span:first-child { display: flex; align-items: center; }
.nav-accordion-trigger[aria-expanded="true"] { font-weight: 700; }
.nav-accordion-trigger .nav-accordion-chevron { font-size: 10px; color: var(--app-ink-2); }
.nav-accordion-panel > div { background: var(--app-submenu-bg); }
.nav-accordion-panel .app-nav-link { padding-top: 6px; padding-bottom: 6px; font-size: 13px; }
.nav-accordion-panel .app-nav-link .sidebar-icon { font-size: 12px; }

.sidebar.collapsed .app-nav-link { justify-content: center; padding-left: 0; padding-right: 0; }
.sidebar.collapsed .nav-accordion-panel > div { padding-left: 0; }

/* ---- Content blend (1.0.7) --------------------------------------------
   Tailwind v4 builds its type sizes and colours from CSS variables, so the
   page content takes on the OIDS scale and palette here, without template
   changes or a Tailwind rebuild, and stays in proportion with the sidebar. */
.app-body {
    /* OIDS type scale: 13.5px body; headings 14.5 / 15.5 / 17 / 20px. */
    --text-xs: 12px;
    --text-sm: 13.5px;
    --text-base: 14.5px;
    --text-lg: 15.5px;
    --text-xl: 17px;
    --text-2xl: 20px;
    --text-3xl: 24px;
    --text-4xl: 28px;
    /* Primary buttons, links and focus rings in the OIDS accent. */
    --color-blue-50: #eef2fc;
    --color-blue-100: #dce4f8;
    --color-blue-500: #4a6bd6;
    --color-blue-600: #2f52c8;
    --color-blue-700: #2643a8;
    --color-blue-800: #1f3688;
    --color-indigo-50: #eef2fc;
    --color-indigo-100: #dce4f8;
    --color-indigo-500: #4a6bd6;
    --color-indigo-600: #2f52c8;
    --color-indigo-700: #2643a8;
    --color-indigo-800: #1f3688;
    /* Light neutrals with the OIDS lavender tint: panels, table heads, rows. */
    --color-gray-50: #f6f7fb;
    --color-gray-100: #eef0f7;
    --color-gray-200: #dfe3ee;
    --color-gray-300: #d3d7e4;
}

/* Tailwind v4 draws borders in the text colour (near black) unless a colour
   is given. Default them to the OIDS line colour; in the base layer, so an
   explicit border colour (red, amber, green...) still wins. */
@layer base {
    *, ::before, ::after, ::backdrop, ::file-selector-button { border-color: var(--app-border); }
}

/* ---- Content ---------------------------------------------------------- */
.app-main {
    background: var(--app-page-bg);
    font-size: var(--app-fz);
    line-height: var(--app-line);
}
/* The page column (2.7.0; the user's request, 3 November 2026: content leaned
   on the side menu and left the right side empty, on every page). Every org
   page sits in one column that fills the space beside the menu, up to 96rem,
   centred, so the margins either side are equal. Before, the column was
   Tailwind's .container, whose widths follow the window rather than the
   space beside the menu, and most pages capped their own top-level block at
   max-w-2xl to max-w-7xl without centring it, so it hugged the menu. Those
   caps are lifted here, for top-level blocks only. Narrow forms (max-w-xl and
   below) keep their width, and content further down keeps its own limits. */
.app-content {
    width: 100%;
    max-width: 96rem;
    margin-inline: auto;
}
.app-content > :is(.max-w-2xl, .max-w-3xl, .max-w-4xl, .max-w-5xl, .max-w-6xl, .max-w-7xl) {
    max-width: none;
}
.app-page-title {
    margin: 0;
    font-size: var(--app-fz-h1);
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--app-ink);
}

/* Info toggles (1.0.12): a page's or section's explanation sits behind an
   info icon and opens on a light blue panel. Shown/hidden with the hidden
   attribute, which these display rules must not override. */
.org-info__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    color: #2563eb;
    font-size: 1.05rem;
    cursor: pointer;
}
.org-info__toggle:hover,
.org-info__toggle[aria-expanded="true"] { background: #dbeafe; }
.org-info__toggle:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.org-info__panel {
    max-width: 64rem;
    margin: -.25rem 0 1rem;
    padding: .75rem 1rem;
    border: 1px solid #bfdbfe;
    border-radius: .75rem;
    background: #eff6ff;
    color: #1e3a8a;
    line-height: 1.55;
}
.org-info__panel p + p { margin-top: .5rem; }
/* {% infotip %}: inline icon, panel pops up beneath it. */
.org-info { position: relative; display: inline-block; vertical-align: middle; }
.org-info__toggle--inline { width: 1.4rem; height: 1.4rem; font-size: .9rem; }
.org-info__panel--pop {
    position: absolute;
    z-index: 40;
    top: 100%;
    left: 0;
    width: max-content;
    max-width: min(24rem, 80vw);
    margin: .375rem 0 0;
    font-size: var(--app-fz);
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .12);
}
.org-info__toggle[hidden],
.org-info__panel[hidden] { display: none; }

.app-footer {
    flex-shrink: 0;
    padding: 10px 24px;
    background: var(--app-footer-bg);
    border-top: 1px solid var(--app-border);
    color: var(--app-footer-ink);
    font-size: var(--app-fz-sm);
    letter-spacing: .02em;
    text-align: center;
}
