/*
 * Trail Life PA-0221 brand theme
 *
 * Loaded AFTER qd.min.css on every admin page, this skins the stock Quantum
 * Dash chrome with the troop's palette, taken from the design tokens on
 * https://patroop221.com/ (walk-worthy theme). Keep chrome (navbar, panels,
 * buttons) on brand colors; the Door screen keeps its own SEMANTIC colors
 * (green = checking IN, blue = checking OUT) in door.css because mode clarity
 * at the door outranks branding.
 */
:root {
    --tl-red: #ba262d;      /* Trail Life red - primary actions */
    --tl-red-dark: #8f1d23; /* hover/pressed variant */
    --tl-brown: #876237;    /* mid brown - accents */
    --tl-dark: #3e2e18;     /* dark brown - navbar / headings */
    --tl-tan: #d8ccb7;      /* light tan - borders, muted chrome */
    --tl-cream: #f5f1e8;    /* cream - panel backgrounds */
    --tl-gray: #f4f2ed;     /* warm gray - page background */
    --tl-charcoal: #29252d; /* neutral dark - cancel buttons, text */
}

/* typeface to match the troop site (falls back to system fonts offline) */
body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background-color: var(--tl-gray);
}

/* top navbar: dark brown instead of QD's stock #333 */
header .navbar,
.navbar-default,
.navbar-fixed-top {
    background-color: var(--tl-dark) !important;
    border-color: var(--tl-dark) !important;
}

/* slide-out menu: dark brown family */
/* ----------------------------------------------------------------------
   LEFT SLIDE-OUT MENU (.qd-slider)

   Stock Quantum Dash paints this Bootstrap-green (#5cb85c headers) with
   blue (#0866c6) sub-links on light gray - three off-brand colors and
   poor contrast on our dark menu. This block reskins the whole slider to
   the troop browns/red, deliberately AVOIDING green (green is reserved
   for the Door screen's check-in semantics). Selectors are scoped under
   .qd-slider so they out-specify QD's .panel-nav defaults.
   ---------------------------------------------------------------------- */
.qd-slider {
    background-color: var(--tl-dark);
}

/* group headers (Door, Roster, Events, ...): flat dark by default, brown
   on hover, with a hairline divider between groups */
.qd-slider .panel-nav .panel-heading {
    background-color: var(--tl-dark);
    color: var(--tl-cream);
    border-bottom: 1px solid rgba(216, 204, 183, 0.14);
    transition: background-color 0.12s ease;
}
.qd-slider .panel-nav .panel-heading:hover,
.qd-slider .panel-nav .panel-heading:focus {
    background-color: var(--tl-brown);
    color: #fff;
}
/* the OPEN group gets a brown fill + a red left accent so "which section
   am I in" reads at a glance - brand-consistent, never green */
.qd-slider .panel-nav .panel-heading:not(.collapsed) {
    background-color: var(--tl-brown);
    color: #fff;
    box-shadow: inset 4px 0 0 var(--tl-red);
}
.qd-slider .panel-nav .panel-heading .qd-menu-arrow {
    color: var(--tl-tan);
}

/* sub-page area: one shade darker than the slider so it reads as nested */
.qd-slider .panel-nav .panel-body {
    background-color: #322414;
}
/* sub-page links: cream text (was QD blue), roomy 44px touch rows */
.qd-slider .panel-nav .panel-body a {
    color: var(--tl-cream);
}
.qd-slider .qd-nav-page {
    border-top: 1px solid rgba(216, 204, 183, 0.10);
    color: var(--tl-cream);
}
/* hover + current page: brand red (QD used light gray, invisible here) */
.qd-slider .panel-nav .panel-body a:hover .qd-nav-page,
.qd-slider .panel-group .panel-nav .panel-body a:hover .qd-nav-page {
    background-color: var(--tl-red-dark);
    color: #fff;
}
.qd-slider .qd-nav-page.active,
.qd-slider .panel-group .panel-nav .panel-body a .qd-nav-page.active {
    background-color: var(--tl-red);
    color: #fff;
}

/* version stamp: readable-but-quiet at the foot of the menu */
.qd-slider .qd-version {
    color: rgba(216, 204, 183, 0.45);
}

/* panels: cream body, tan borders, brown headings */
.panel-default {
    border-color: var(--tl-tan);
}
.panel-default > .panel-heading {
    background-color: var(--tl-cream);
    border-color: var(--tl-tan);
    color: var(--tl-dark);
    font-weight: 600;
}

/* primary action buttons: Trail Life red (QD uses .btn-success for its
   primary actions, so the override lands there) */
.btn-success {
    background-color: var(--tl-red) !important;
    border-color: var(--tl-red-dark) !important;
    color: #fff !important;
}
.btn-success:hover,
.btn-success:focus,
.btn-success:active {
    background-color: var(--tl-red-dark) !important;
    border-color: var(--tl-red-dark) !important;
}

/* cancel/decline buttons: neutral charcoal so "cancel" never reads as the
   same red as the primary action beside it */
.btn-danger {
    background-color: var(--tl-charcoal) !important;
    border-color: var(--tl-charcoal) !important;
    color: #fff !important;
}
.btn-danger:hover,
.btn-danger:focus {
    background-color: #17141a !important;
    border-color: #17141a !important;
}

/* links pick up the brand red */
a {
    color: var(--tl-red);
}
a:hover, a:focus {
    color: var(--tl-red-dark);
}

/* login / reset pages: warm cream page, logo above the panel.
   background-image:none kills qd_login.min.css's reference to the source
   project's hr-background.jpg (a 404 we don't want fetched at the door) */
body.tl-login {
    background-color: var(--tl-gray);
    background-image: none;
}
.tl-login .qd-brand {
    text-align: center;
    padding: 24px 0 8px;
    /* qd_login.min.css paints .qd-brand with the source project's
       hr-background.jpg (a 404 here) - kill the fetch */
    background-image: none;
    box-shadow: none;
}
.tl-login .qd-brand img {
    max-width: 180px;
    height: auto;
}
.tl-login .panel-heading {
    background-color: var(--tl-dark);
    color: #fff;
}

/* live password-requirements checklist (js/tl-password.js) - rules check off
   as they are satisfied while the user types */
.tl-pw-checklist {
    list-style: none;
    margin: 8px 0 12px;
    padding: 0;
    font-size: 13px;
    color: #8a7f6e;
}
.tl-pw-checklist li {
    padding: 2px 0;
    transition: color 0.15s ease;
}
.tl-pw-checklist li.ok {
    color: #1e7a34;
}
.tl-pw-checklist .tl-pw-mark {
    display: inline-block;
    width: 16px;
    font-weight: 700;
}

/* footer disclaimer (login pages + admin footer): required wording from the
   troop site - Trail Life USA marks belong to Trail Life USA */
.tl-disclaimer {
    margin: 18px auto 24px;
    max-width: 420px;
    text-align: center;
    font-size: 11px;
    line-height: 1.5;
    color: #6f6353;
}

/* ======================================================================
   GLOBAL NAVBAR ADDITIONS (public/admin/index.php navigation rework)

   Two things were added to the stock QD top bar:
     1. .tl-nav-home  - a home icon next to the MENU toggle that always
        returns to the action-item dashboard (?g=main&p=main). 44px wide by
        the full 50px navbar height = a comfortable phone target.
     2. .tl-user-menu - a Bootstrap 3 dropdown on the username replacing the
        old "Welcome, name + Logout" pair (which was hidden on phones, so
        phones had NO logout at all). Contains Account Settings + Logout;
        on xs screens only the user glyph + caret show.
   Everything sits on the brand browns; hover/active states go brand red.
   ====================================================================== */

/* keep MENU toggle + home icon on ONE line inside their narrow column -
   the QD slider toggle renders block-level at xs and was pushing the home
   icon onto a second navbar row (found via phone-size screenshot review) */
.tl-nav-left {
    display: flex;
    align-items: center;
    white-space: nowrap;
}
.tl-nav-left .qd-slider-toggle,
.tl-nav-left .tl-nav-home {
    flex: 0 0 auto;
}

/* home icon: full-height touch target beside the MENU toggle */
.tl-nav-home {
    display: inline-block;
    width: 44px;              /* accessibility floor: 44px minimum target */
    height: 50px;             /* full navbar height (navbar line-height 50px) */
    line-height: 50px;
    text-align: center;
    vertical-align: top;
    margin-left: 2px;
    font-size: 18px;
    color: var(--tl-tan);
}
.tl-nav-home:hover,
.tl-nav-home:focus {
    color: #fff;
    background-color: var(--tl-red);
    text-decoration: none;
}

/* user dropdown toggle: borderless button that reads as part of the bar */
.tl-user-menu {
    height: 50px;
}
.tl-user-toggle {
    background: none;
    border: none;
    height: 50px;             /* full navbar height = easy target */
    min-width: 44px;
    padding: 0 12px;
    font-size: 15px;
    color: #eee;
    cursor: pointer;
}
.tl-user-toggle:hover,
.tl-user-toggle:focus,
.tl-user-menu.open .tl-user-toggle {
    color: #fff;
    background-color: var(--tl-brown);
    outline: none;
}
.tl-user-name {
    font-weight: 600;
    margin: 0 2px 0 4px;
}

/* the dropped menu itself: dark brown panel, red hover, roomy 44px rows */
.tl-user-menu .dropdown-menu {
    margin-top: 0;                       /* flush against the navbar */
    background-color: var(--tl-dark);
    border: 1px solid var(--tl-brown);
    border-radius: 0 0 4px 4px;
    min-width: 200px;
    padding: 0;
}
.tl-user-menu .dropdown-menu > li > a {
    padding: 13px 18px;                  /* ~44px row height for thumbs */
    font-size: 15px;
    color: var(--tl-cream);
}
.tl-user-menu .dropdown-menu > li > a:hover,
.tl-user-menu .dropdown-menu > li > a:focus {
    background-color: var(--tl-red);
    color: #fff;
}
.tl-user-menu .dropdown-menu > li > a .glyphicon {
    margin-right: 8px;
}
.tl-user-menu .dropdown-menu .divider {
    margin: 0;
    background-color: var(--tl-brown);
}

/* ======================================================================
   ACTION-ITEM DASHBOARD (content/main/main - the post-login home page)

   Phone-first: single centered column, giant full-width buttons, big
   count tiles. Brand colors carry the chrome; the two action buttons use
   MEANINGFUL colors instead:
     - "Go to the Door screen" = the Door screen's semantic check-in green
     - "Create tonight's meeting" = brand red (a primary fix-it action)
     - warnings (missing primary guardian, exceptions) = the amber the
       Door screen uses for exception flows
   ====================================================================== */

/* centered single column; comfortable side padding on phones */
.tl-dash {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 12px;
}
.tl-dash .tl-dash-card {
    margin-bottom: 18px;
}

/* [Tonight] card: event name + status chip + meta line */
.tl-dash-event-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--tl-dark);
    margin: 0 0 2px;
}
.tl-dash-status {
    display: inline-block;
    vertical-align: middle;
    margin-left: 8px;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}
.tl-dash-status-active {              /* meeting running right now */
    background-color: #1e7a34;
    color: #fff;
}
.tl-dash-status-upcoming {
    background-color: var(--tl-tan);
    color: var(--tl-dark);
}
.tl-dash-status-closed {
    background-color: #e2ded6;
    color: #6f6353;
}
.tl-dash-event-meta {
    font-size: 15px;
    color: #6f6353;
    margin: 0 0 10px;
}

/* live "N kids in the building" line - number pops, label stays calm */
.tl-dash-headcount {
    font-size: 17px;
    color: #6f6353;
    margin: 0 0 4px;
}
.tl-dash-headcount #tl-dash-headcount {
    font-size: 24px;
    font-weight: 800;
    color: #6f6353;
}
.tl-dash-headcount.has-kids,
.tl-dash-headcount.has-kids #tl-dash-headcount {
    color: #1e7a34;                    /* kids are IN -> check-in green */
}

/* the giant full-width action buttons (56px+ touch targets) */
.tl-dash-btn {
    display: block;
    width: 100%;
    min-height: 56px;
    padding: 16px 14px;
    margin: 14px 0 4px;
    border: none;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    color: #fff;
}
.tl-dash-btn .glyphicon {
    margin-right: 8px;
    top: 2px;
}
.tl-dash-btn:hover,
.tl-dash-btn:focus {
    color: #fff;
    text-decoration: none;
}
.tl-dash-btn-door {                   /* semantic check-in green */
    background-color: #1e7a34;
}
.tl-dash-btn-door:hover,
.tl-dash-btn-door:focus {
    background-color: #17632a;
}
.tl-dash-btn-create {                 /* brand red primary action */
    background-color: var(--tl-red);
}
.tl-dash-btn-create:hover,
.tl-dash-btn-create:focus {
    background-color: var(--tl-red-dark);
}
.tl-dash-btn-create[disabled] {       /* while the create POST is in flight */
    opacity: 0.65;
    cursor: wait;
}

/* small print under the buttons ("Also today: ...", plan-ahead link) */
.tl-dash-also {
    font-size: 14px;
    color: #6f6353;
    margin: 8px 0 0;
}
.tl-dash-empty {
    font-size: 17px;
    color: var(--tl-dark);
    margin: 0;
}

/* [Roster] / [Exceptions] cards: big tap-through count tiles */
.tl-dash-tiles {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    margin: 0 -5px;
}
.tl-dash-tile {
    -webkit-flex: 1 1 0;
    flex: 1 1 0;
    min-width: 110px;
    margin: 0 5px 10px;
    padding: 14px 8px;
    background-color: var(--tl-cream);
    border: 1px solid var(--tl-tan);
    border-radius: 8px;
    text-align: center;
}
.tl-dash-tile:hover,
.tl-dash-tile:focus {
    border-color: var(--tl-red);
    text-decoration: none;
}
.tl-dash-tile-num {
    display: block;
    font-size: 32px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--tl-dark);
}
.tl-dash-tile-label {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    color: #6f6353;
}
.tl-dash-tile-warn {                  /* nonzero exception count = amber */
    background-color: #ffd66b;
    border-color: #e6b84a;
}

/* amber warning chip: "N kids have no primary guardian" (full-width tap) */
.tl-dash-chip-warn {
    display: block;
    margin-top: 4px;
    padding: 12px 14px;
    background-color: #ffd66b;        /* Door screen exception amber */
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #3e2e18;
}
.tl-dash-chip-warn:hover,
.tl-dash-chip-warn:focus {
    background-color: #f5c94d;
    color: #3e2e18;
    text-decoration: none;
}
.tl-dash-chip-warn .glyphicon {
    margin-right: 6px;
}

/* [Getting started] first-run checklist */
.tl-dash-checklist {
    font-size: 16px;
    margin: 0 0 12px;
    padding-left: 24px;
}
.tl-dash-checklist li {
    padding: 6px 0;                   /* roomy line targets for thumbs */
}
.tl-dash-hint {
    font-size: 14px;
    color: #6f6353;
    margin: 0;
}

/* plain text links used as secondary actions on cards */
.tl-dash-link {
    display: inline-block;
    padding: 10px 0;                  /* stretch the target vertically */
    font-size: 15px;
    font-weight: 600;
}
