/* ALLYBUILD PR system - shell CSS (sidebar, top bar, shared tokens). Pages add their own CSS.
   Baseline: Full HD 1920x1080. Target browsers: Chrome 109 (Windows 7) and newer. No modern-only CSS. */
:root {
  --g900: #0a4a23;
  --g800: #0c5a2b;
  --g700: #0F6933;      /* brand: Dark Forest Green */
  --g600: #167a40;
  --g500: #2a9456;
  --g100: #e3f2e9;
  --g50:  #f1f8f4;
  --ink: #1d2b24;
  --ink2: #52625a;
  --ink3: #8a9890;
  --line: #e1e8e4;
  --bg: #eef3f0;
  --card: #ffffff;
  --side-w: 264px;
  --side-w-collapsed: 76px;
  --head-h: 72px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 14px; color: var(--ink); background: var(--bg); }
a { color: var(--g700); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- shell ---------- */
.sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--side-w); background: #fff; border-right: 1px solid var(--line); z-index: 20; display: flex; flex-direction: column; transition: width .18s; }
.sb-logo { height: var(--head-h); display: flex; align-items: center; padding: 0 22px; }
.sb-logo a { display: flex; align-items: center; height: 100%; }
.sb-logo .full { height: 44px; }
.sb-logo .mark { height: 38px; display: none; }
.nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 14px 16px; }
.nav-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--ink3); text-transform: uppercase; padding: 16px 12px 6px; white-space: nowrap; }
.nav-item { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: 10px; color: var(--ink); font-weight: 600; cursor: pointer; white-space: nowrap; border: 0; background: none; width: 100%; font-size: 14px; text-align: left; }
.nav-item:hover { background: var(--g50); text-decoration: none; }
.nav-item .chev { margin-left: auto; width: 16px; height: 16px; transition: transform .15s; color: var(--ink3); }
.nav-item.open .chev { transform: rotate(180deg); }
.nav-item.parent-active { color: var(--g700); }
.nav-item .badge { margin-left: auto; background: #e0463a; color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; line-height: 20px; border-radius: 10px; text-align: center; padding: 0 6px; }
.sub { display: none; padding: 2px 0 6px 0; }
.sub.open { display: block; }
.sub a { display: flex; align-items: center; height: 38px; margin: 2px 0; padding: 0 12px 0 44px; border-radius: 10px; color: var(--ink2); font-weight: 500; white-space: nowrap; }
.sub a:hover { background: var(--g50); text-decoration: none; }
.sub a.active { background: var(--g100); color: var(--g800); font-weight: 700; }
.sub a .badge { margin-left: auto; background: #e0463a; color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; line-height: 20px; border-radius: 10px; text-align: center; padding: 0 6px; }
.sb-foot { padding: 12px 18px 40px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink3); white-space: nowrap; overflow: hidden; }

.topbar { position: fixed; left: var(--side-w); right: 0; top: 0; height: var(--head-h); z-index: 15; display: flex; align-items: center; padding: 0 28px 0 16px; color: #fff;
  background: #0F6933; background: linear-gradient(100deg, #0a4a23 0%, #0F6933 48%, #3aa066 100%); transition: left .18s; }
.burger { width: 44px; height: 44px; border-radius: 12px; border: 0; background: #fff; color: var(--g700); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.burger:hover { background: var(--g50); }
.topbar .spacer { flex: 1; }
.top-user { display: flex; align-items: center; gap: 12px; }
.top-user .who { text-align: right; line-height: 1.25; }
.top-user .who b { display: block; font-size: 14px; }
.top-user .who span { font-size: 12px; opacity: .85; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--g700); font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid rgba(255,255,255,.6); }
.top-btn { color: #fff; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.35); border-radius: 8px; padding: 7px 12px; font-size: 13px; cursor: pointer; }
.top-btn:hover { background: rgba(255,255,255,.24); }

.content { margin-left: var(--side-w); padding-top: var(--head-h); min-height: 100%; transition: margin-left .18s; }
.page { padding: 22px 28px 28px; }

/* collapsed sidebar */
body.collapsed .sidebar { width: var(--side-w-collapsed); }
body.collapsed .topbar { left: var(--side-w-collapsed); }
body.collapsed .content { margin-left: var(--side-w-collapsed); }
body.collapsed .sb-logo { justify-content: center; padding: 0; }
body.collapsed .sb-logo a { justify-content: center; width: 100%; }
body.collapsed .sb-logo .full { display: none; }
body.collapsed .sb-logo .mark { display: block; }
body.collapsed .nav { padding: 10px 10px; }
body.collapsed .nav-item { justify-content: center; padding: 0; }
body.collapsed .nav-item .t, body.collapsed .nav-item .chev, body.collapsed .nav-item .badge, body.collapsed .nav-label, body.collapsed .sb-foot, body.collapsed .sub { display: none !important; }
body.collapsed .nav-item { position: relative; }
body.collapsed .nav-item .dot { display: block; }
.nav-item .dot { display: none; position: absolute; top: 8px; right: 14px; width: 9px; height: 9px; border-radius: 50%; background: #e0463a; border: 2px solid #fff; box-sizing: content-box; }


/* page area: legacy pages keep their own <main>; ported pages use .page directly */
.page > main { margin: 0 auto; }
.spec-pill { position: absolute; left: 50%; transform: translateX(-50%); background: #c0392b; color: #fff; font-size: 12px; font-weight: 700; padding: 4px 14px; border-radius: 0 0 10px 10px; top: 0; white-space: nowrap; }
.sig-warn { background: #fff3cd; color: #664d03; border: 1px solid #f0dd9a; border-radius: 10px; padding: 9px 14px; font-weight: 600; margin-bottom: 14px; }
.flash .msg { border-radius: 10px; }
.top-btn-form { margin: 0; display: inline; }

/* =====================================================================
   RESPONSIVE (MODULE_redesign_mobile, 2026-10-31) - AFTER all desktop rules. Desktop (>= 1280 px) unchanged.
   Half-screen 768-1279, phone < 768. Plain media queries only (Chrome 109 safe).
   ===================================================================== */
.top-logo, .top-badge, .sb-user, .scrim { display: none; }

@media (min-width: 768px) and (max-width: 1279px) {
  .topbar { padding-right: 16px; }
  .top-user .who span { display: none; }
  .page { padding: 18px 20px 24px; }
}

@media (max-width: 767px) {
  :root { --head-h: 56px; }
  body { font-size: 15px; -webkit-text-size-adjust: 100%; }
  /* sidebar = drawer */
  .sidebar { width: 288px; max-width: 86vw; transform: translateX(-100%); transition: transform .2s; z-index: 40; }
  body.drawer .sidebar { transform: translateX(0); box-shadow: 0 0 30px rgba(0,0,0,.35); }
  .scrim { position: fixed; left: 0; right: 0; top: 0; bottom: 0; background: rgba(15,35,25,.5); z-index: 35; }
  body.drawer .scrim { display: block; }
  body.drawer { overflow: hidden; }
  .sb-logo { height: var(--head-h); }
  .nav-item { height: 48px; }
  .sub a { height: 44px; }
  .sb-user { display: block; padding: 14px 18px; border-top: 1px solid var(--line); }
  .sb-user b { display: block; }
  .sb-user span { color: var(--ink3); font-size: 12.5px; }
  .sb-user form { margin: 10px 0 0; }
  .sb-logout { width: 100%; height: 44px; border-radius: 10px; border: 1px solid #c4d6cb; background: #fff; color: var(--g800); font-size: 14px; font-weight: 600; cursor: pointer; }
  .sb-foot { padding: 10px 18px 14px; }
  /* top bar: burger, logo, waiting badge, avatar */
  .topbar { left: 0; padding: 0 10px 0 8px; gap: 10px; }
  .top-logo { display: block; height: 32px; background: #fff; border-radius: 8px; padding: 3px 5px; }
  .top-badge { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px 0 6px; border-radius: 17px; background: #fff; color: var(--g800); font-weight: 700; font-size: 13px; text-decoration: none; white-space: nowrap; }
  .top-badge:hover { text-decoration: none; }
  .top-badge .n { min-width: 22px; height: 22px; line-height: 22px; border-radius: 11px; background: #e0463a; color: #fff; font-size: 12px; text-align: center; padding: 0 6px; }
  .top-user .who, .top-user .top-btn-form { display: none; }
  .avatar { width: 36px; height: 36px; }
  .content, body.collapsed .content { margin-left: 0; }
  body.collapsed .topbar { left: 0; }
  .page { padding: 14px 12px 24px; }
  /* SPEC test banner: small, inside the top bar */
  .topbar .spec-pill { position: static; transform: none; flex: 1; min-width: 0; white-space: normal; font-size: 9px; line-height: 1.15; padding: 3px 5px; border-radius: 6px; text-align: center; }
  .topbar .spacer { flex: 0; }
  /* forms: 16 px stops iOS zoom */
  input, select, textarea { font-size: 16px; }
}
