/*
 * The estate shell for EDS (Railway addition, 2026-12). Chris: "look and feel and
 * navigation, login screen, all of it should match the other apps".
 *
 *   - top bar: estate/topbar's kit (estate-topbar.css, loaded after this file);
 *     this file only places it (fixed, pushed right by the sidebar);
 *   - left sidebar and breadcrumb strip: the CRM / Task Management pattern
 *     (teal --primary, #FFDB9F active edge, 3px left border, section labels);
 *   - login: the shared sign-in card (white card on --primary, colour logo).
 *
 * Every size is in px. The estate's root font is 12px; EDS's is 15.5px and its
 * screens are built on it, so a rem-sized shell would come out a quarter bigger
 * than everywhere else. Same reasoning as the top-bar kit.
 */

:root {
  --eds-sidebar-w: 324px;          /* CRM: 27rem at the estate's 12px root */
  --eds-sidebar-w-collapsed: 68px; /* CRM: 5.66rem */
  --eds-topbar-h: 54px;
  --eds-breadcrumb-h: 34px;        /* CRM: 2.8rem */
}
body.sidebar-collapsed { --eds-sidebar-w: var(--eds-sidebar-w-collapsed); }

/* ---- top bar: placement only; the look is the kit's ---------------------- */
#topheader.estate-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  padding-left: calc(var(--eds-sidebar-w) + 16px);
  font-family: 'Lato', Arial, sans-serif;
  transition: padding-left .3s;
}
/* the name's size and weight are the kit's (17px, 15px on a phone) */
#topheader .estate-topbar-name { color: #fff; text-decoration: none; }
#topheader .rn-version:empty, #topheader .estate-topbar-user:empty { display: none; }
#topheader .estate-topbar-user { color: rgba(255,255,255,.9); font-size: 12px; white-space: nowrap; }
#empViewBtn.ev-on { background: rgba(255,255,255,.32); box-shadow: 0 0 0 2px #fff inset; }

/* the employee picker, EDS's own control in the bar. On a laptop-width window the
   picker gives up room before the app's name does (the kit takes over at 640px;
   above 1300px nothing needs to shrink, so the kit's rigid group stands). */
@media (min-width: 641px) and (max-width: 1300px) {
  /* With the 324px sidebar open, a laptop window (about 1100 to 1300px) is
     narrower than the bar's items. The group may shrink (the kit keeps it rigid),
     and the room comes from the picker first, then the user's name; the app's
     name and the icons never shrink. Below 1000px the sidebar folds to icons
     (next rule), which gives the bar back 256px. */
  #topheader #new-toprightnav.estate-topbar-actions { flex: 0 1 auto; min-width: 0; }
  #topheader .estate-topbar-name { flex-shrink: 0; }
  #topheader .estate-topbar-user { flex: 0 6 auto; min-width: 40px; overflow: hidden; text-overflow: ellipsis; }
  #topheader .emp-ta-wrap { flex: 0 5 190px; min-width: 100px; }
}
#topheader .emp-ta-wrap { position: relative; width: 190px; }
#topheader #globalEmpSel {
  box-sizing: border-box; width: 100%; height: 26px; padding: 0 22px 0 8px;
  border: 1px solid rgba(255,255,255,.5); border-radius: 4px;
  background: rgba(255,255,255,.15); color: #fff;
  font: 12px 'Lato', Arial, sans-serif; outline: none;
}
#topheader #globalEmpSel::placeholder { color: rgba(255,255,255,.85); }
#topheader #globalEmpSel:focus { background: rgba(255,255,255,.25); border-color: #fff; }
#topheader .emp-ta-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  color: rgba(255,255,255,.8); font-size: 12px; line-height: 1; cursor: pointer;
}
#topheader .emp-ta-clear:hover { color: #fff; }
#topheader .emp-ta-list { font-family: var(--f); z-index: 950; }

/* ---- sidebar ---------------------------------------------------------------- */
#sidebar.sidebar-new {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 910;
  width: var(--eds-sidebar-w); overflow-x: hidden; overflow-y: auto;
  background: var(--primary); color: #fff;
  font-family: 'Lato', Arial, sans-serif;
  transition: width .3s;
}
#sidebar .sidebar-toggle-row {
  display: flex; align-items: center; height: var(--eds-topbar-h); padding: 0 12px;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
#sidebar .sidebar-toggle-btn {
  width: 44px; height: 36px; border-radius: 4px; color: #fff; font-size: 18px;
}
#sidebar .sidebar-toggle-btn:hover { background: rgba(255,255,255,.12); }

/* Trevor's .tabs rules (a wrapping row in a dark header) undone for a column */
#sidebar .tabs { display: block; flex: none; padding: 6px 0 24px; min-width: 0; }
#sidebar .sidebar-section-label {
  padding: 14px 16px 4px 20px; color: rgba(255,255,255,.55);
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
#sidebar .tabs button {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 10px 16px 10px 17px; margin: 0;
  border: 0; border-left: 3px solid transparent; border-radius: 0;
  background: none; color: #fff; text-align: left;
  font: 400 13px 'Lato', Arial, sans-serif; white-space: nowrap;
  transition: background .15s, color .15s;
}
#sidebar .tabs button i { width: 20px; flex: 0 0 20px; text-align: center; font-size: 16px; }
#sidebar .tabs button:hover { background: rgba(255,255,255,.12); color: #FFDB9F; }
#sidebar .tabs button.on {
  border-left-color: #FFDB9F; background: rgba(255,255,255,.15); color: #FFDB9F; font-weight: 700;
}
#sidebar .sidebar-section.is-empty { display: none; }

body.sidebar-collapsed #sidebar .sidebar-label { display: none; }
body.sidebar-collapsed #sidebar .sidebar-section-label { padding: 0; margin: 6px 14px; height: 1px; background: rgba(255,255,255,.2); }
body.sidebar-collapsed #sidebar .tabs button { justify-content: center; padding-left: 13px; padding-right: 16px; }

/* ---- breadcrumb strip under the bar ---------------------------------------- */
#breadcrumbBar.breadcrumb {
  position: fixed; top: var(--eds-topbar-h); left: var(--eds-sidebar-w); right: 0; z-index: 890;
  height: var(--eds-breadcrumb-h); display: flex; align-items: center; gap: 6px;
  padding: 0 16px; background: #eee; border-bottom: 1px solid #ccc;
  color: #7F7F7F; font: italic 12px 'Lato', Arial, sans-serif; white-space: nowrap; overflow: hidden;
  transition: left .3s;
}
#breadcrumbBar .breadcrumb-app { color: var(--primary); }
#breadcrumbBar .breadcrumb-sep { color: #aaa; }

/* ---- the page under the chrome ---------------------------------------------- */
#app > .main {
  max-width: none; margin: 0 0 0 var(--eds-sidebar-w);
  padding: calc(var(--eds-topbar-h) + var(--eds-breadcrumb-h) + 20px) 24px 64px;
  transition: margin-left .3s;
}
/* Trevor's sticky reference panel sat under his 62px header */
.a-ref { top: calc(var(--eds-topbar-h) + var(--eds-breadcrumb-h) + 8px); }

/* ---- narrow windows (the kit narrows the bar itself) ------------------------ */
/* below 1000px the sidebar shows icons only, whatever the saved choice */
@media (max-width: 1000px) {
  :root, body.sidebar-collapsed { --eds-sidebar-w: var(--eds-sidebar-w-collapsed); }
  #sidebar .sidebar-label { display: none; }
  #sidebar .sidebar-section-label { padding: 0; margin: 6px 14px; height: 1px; background: rgba(255,255,255,.2); }
  #sidebar .tabs button { justify-content: center; padding-left: 13px; padding-right: 16px; }
}
@media (max-width: 640px) {
  /* the picker shrinks with the bar so every icon stays on screen */
  #topheader .emp-ta-wrap { flex: 0 1 90px; min-width: 0; width: auto; }
  /* the kit clips an app control at this width; the list escapes as a fixed panel */
  #topheader .emp-ta-list { position: fixed; top: 58px; left: 8px; right: 8px; min-width: 0; }
  #app > .main { padding-left: 12px; padding-right: 12px; }
}

/* ---- print: Trevor's print rules hid .hdr and .tabs; the shell goes too ---- */
@media print {
  #topheader, #sidebar, #breadcrumbBar { display: none !important; }
  #app > .main { margin: 0 !important; padding: 0 !important; }
}

/* ---- login: the estate sign-in card ----------------------------------------- */
.login-screen {
  display: none; position: fixed; inset: 0; z-index: 9999;
  align-items: center; justify-content: center;
  background: var(--primary); font-family: 'Lato', Arial, sans-serif;
}
.login-card {
  box-sizing: content-box; width: 100%; max-width: 312px; padding: 36px 30px;
  background: #fff; border-radius: 6px; box-shadow: var(--shadow); text-align: center;
}
.login-logo { width: 144px; margin-bottom: 18px; }
.login-title { margin-bottom: 6px; color: var(--dark); font-size: 19px; font-weight: 700; }
.login-subtitle { margin-bottom: 24px; color: #6B6C70; font-size: 12px; }
.login-gsi { display: flex; justify-content: center; min-height: 44px; color: #6B6C70; font-size: 12px; }
.login-test { margin-top: 16px; text-align: left; font-size: 12px; }
.login-test-label { margin-bottom: 4px; color: #6B6C70; }
.login-test input {
  box-sizing: border-box; width: 100%; margin-bottom: 6px; padding: 7px;
  border: 1px solid #b7bcc2; border-radius: 4px; background: var(--primary-faded); font: 12px 'Lato', Arial, sans-serif;
}
.login-test button {
  padding: 7px 14px; border-radius: 4px; background: var(--primary); color: #fff;
  font: 700 12px 'Lato', Arial, sans-serif; box-shadow: var(--shadow);
}
.login-test button:hover { background: var(--primary-dark); }
.login-error { min-height: 16px; margin-top: 10px; color: #f44; font-size: 12px; }
.login-note { margin-top: 18px; color: #6B6C70; font-size: 11px; }
