:root{
  --brand:#1D5C3A;
  --brand-600:#1A5133;
  --brand-700:#17482D;
  --brand-50:#EDF2EF;
  --brand-100:#DDE7E1;

  --accent:#C07A2E;
  --accent-600:#A96B28;
  --accent-50:#FAF4EE;

  --ok:#2E7D4F;
  --warn:#B8792E;
  --danger:#B23A3A;
  --info:#2E5B8F;

  --ink:#1A1F1C;
  --muted:#5B655F;
  --line:#E1E6E2;
  --canvas:#F5F7F5;
  --surface:#FFFFFF;
  --shadow: 0 1px 2px rgba(20,30,24,.06), 0 8px 24px -8px rgba(20,30,24,.10);
}

*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  font-family:'Inter',system-ui,sans-serif;
  color:var(--ink);
  background:var(--canvas);
  font-size:17px;
  line-height:1.5;
}
h1,h2,h3,.display{font-family:'Manrope',sans-serif;}
a{color:inherit;}
button{font-family:inherit;}

/* ---------- Layout shell ---------- */
.app{
  display:flex;
  min-height:100vh;
}

/* Sidebar */
.sidebar{
  width:264px;
  flex-shrink:0;
  background:linear-gradient(160deg,var(--brand-700) 0%,var(--brand) 55%,var(--brand-600) 100%);
  color:#fff;
  display:flex;
  flex-direction:column;
  position:fixed;
  top:0;left:0;bottom:0;
  z-index:40;
}
.brand-block{
  display:flex;
  align-items:center;
  gap:12px;
  padding:26px 20px 22px;
  border-bottom:1px solid rgba(255,255,255,.15);
}
.brand-logo{
  height:40px;
  width:auto;
  filter:brightness(0) invert(1);
}
.brand-wordmark{
  font-family:'Manrope',sans-serif;
  font-weight:800;
  font-size:19px;
  letter-spacing:.2px;
  color:#fff;
}
.brand-text .org-name{font-weight:800;font-size:15px;line-height:1.2;}
.brand-text .org-sub{font-size:12px;opacity:.8;letter-spacing:.06em;}

.sidebar-scroll{
  flex:1;
  overflow-y:auto;
  padding:18px 14px;
}
.nav-label{
  font-size:11px;
  text-transform:none;
  letter-spacing:.08em;
  color:rgba(255,255,255,.6);
  font-weight:700;
  margin:18px 12px 8px;
}
.nav-label:first-child{margin-top:2px;}
.nav-btn{
  width:100%;
  display:flex;
  align-items:center;
  gap:11px;
  padding:10px 12px;
  border:none;
  background:transparent;
  color:rgba(255,255,255,.88);
  border-radius:10px;
  font-size:14.5px;
  font-weight:600;
  cursor:pointer;
  text-align:left;
  margin-bottom:2px;
  transition:background .15s ease, color .15s ease;
}
.nav-btn i{font-size:19px;flex-shrink:0;}
@media (hover:hover){.nav-btn:hover{background:rgba(255,255,255,.10);color:#fff;}}
.nav-btn.active{background:#fff;color:var(--brand-700);}
.nav-btn.active i{color:var(--brand-700);}

.sidebar-footer{
  padding:16px 20px 20px;
  border-top:1px solid rgba(255,255,255,.15);
  font-size:12px;
  color:rgba(255,255,255,.65);
  line-height:1.5;
}
.sidebar-footer strong{color:#fff;}

/* Main column */
.main-col{
  flex:1;
  margin-left:264px;
  min-width:0;
  display:flex;
  flex-direction:column;
}

/* Top strip */
.app-strip{
  display:flex;
  align-items:center;
  gap:18px;
  flex-wrap:wrap;
  padding:12px 32px;
  background:var(--surface);
  border-bottom:1px solid var(--line);
  font-size:13.5px;
  color:var(--muted);
}
.status-dot{
  display:inline-flex;align-items:center;gap:7px;font-weight:600;color:var(--ink);
}
.status-dot .dot{
  width:8px;height:8px;border-radius:50%;background:var(--ok);
  box-shadow:0 0 0 3px rgba(46,125,79,.18);
}
.strip-chip{
  display:inline-flex;align-items:center;gap:6px;
  padding:4px 10px;border-radius:20px;background:var(--canvas);
  border:1px solid var(--line);font-weight:500;
}
.strip-sim{
  margin-left:auto;
  display:inline-flex;align-items:center;gap:6px;
  padding:5px 12px;border-radius:20px;
  background:var(--accent-50);color:var(--accent-600);
  border:1px solid rgba(192,122,46,.35);
  font-weight:700;font-size:12.5px;letter-spacing:.02em;
}

main{padding:32px;max-width:1240px;width:100%;margin:0 auto;}
.tab{display:none;animation:fade .25s ease;}
.tab.active{display:block;}
@keyframes fade{from{opacity:0;transform:translateY(4px);}to{opacity:1;transform:translateY(0);}}

/* ---------- Home ---------- */
.hero{
  background:linear-gradient(120deg,var(--brand-700),var(--brand) 70%);
  border-radius:20px;
  padding:40px 40px;
  color:#fff;
  margin-bottom:28px;
  position:relative;
  overflow:hidden;
}
.hero::after{
  content:"";
  position:absolute;right:-60px;top:-60px;width:260px;height:260px;
  background:radial-gradient(circle,rgba(255,255,255,.12),transparent 70%);
}
.hero-eyebrow{
  font-size:13px;font-weight:700;letter-spacing:.08em;
  color:rgba(255,255,255,.75);margin-bottom:10px;
}
.hero h1{font-size:32px;margin:0 0 10px;font-weight:800;}
.hero p{font-size:16px;max-width:640px;color:rgba(255,255,255,.88);margin:0;}

.stats-row{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:16px;
  margin-bottom:28px;
}
.stat-card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:16px;
  padding:20px;
  display:flex;
  gap:14px;
  align-items:flex-start;
  box-shadow:var(--shadow);
}
.stat-icon{
  width:44px;height:44px;border-radius:12px;
  display:flex;align-items:center;justify-content:center;
  font-size:22px;flex-shrink:0;
}
.stat-icon.b{background:var(--brand-50);color:var(--brand);}
.stat-icon.a{background:var(--accent-50);color:var(--accent-600);}
.stat-icon.g{background:#E8F3EC;color:var(--ok);}
.stat-icon.r{background:#F7EAEA;color:var(--danger);}
.stat-num{font-size:24px;font-weight:800;font-family:'Manrope',sans-serif;line-height:1.1;}
.stat-label{font-size:13px;color:var(--muted);margin-top:2px;}

.dashboard-grid{
  display:grid;
  grid-template-columns:1.1fr 1fr;
  gap:20px;
}
.panel{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:16px;
  padding:22px;
  box-shadow:var(--shadow);
}
.panel h3{margin:0 0 16px;font-size:16px;font-weight:800;display:flex;align-items:center;gap:8px;}
.panel h3 i{color:var(--brand);}

.quick-links{display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.quick-link{
  display:flex;align-items:center;gap:10px;
  padding:12px 14px;border-radius:12px;
  border:1px solid var(--line);background:var(--canvas);
  cursor:pointer;font-weight:600;font-size:13.5px;color:var(--ink);
  transition:all .15s ease;
}
@media (hover:hover){.quick-link:hover{background:var(--brand-50);border-color:var(--brand-100);}}
.quick-link i{font-size:18px;color:var(--brand);}

.notice{
  display:flex;gap:12px;padding:12px 0;border-bottom:1px solid var(--line);
}
.notice:last-child{border-bottom:none;}
.notice-tag{
  flex-shrink:0;font-size:11px;font-weight:700;letter-spacing:.03em;
  padding:3px 9px;border-radius:20px;height:fit-content;margin-top:2px;
}
.notice-tag.compliance{background:#F7EAEA;color:var(--danger);}
.notice-tag.team{background:var(--brand-50);color:var(--brand);}
.notice-tag.event{background:var(--accent-50);color:var(--accent-600);}
.notice-tag.info{background:#E4ECF4;color:var(--info);}
.notice-body .notice-title{font-weight:700;font-size:14px;}
.notice-body .notice-date{font-size:12.5px;color:var(--muted);margin-top:2px;}

/* ---------- Page head (shared) ---------- */
.crumb{font-size:13px;color:var(--muted);margin-bottom:6px;}
.page-head h1{font-size:26px;margin:0 0 8px;font-weight:800;}
.page-head p.desc{color:var(--muted);max-width:680px;margin:0 0 16px;}
.meta-chips{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:26px;}
.meta-chip{
  display:inline-flex;align-items:center;gap:7px;
  padding:7px 13px;border-radius:20px;background:var(--surface);
  border:1px solid var(--line);font-size:13px;font-weight:600;color:var(--muted);
}
.meta-chip i{color:var(--brand);}

/* ---------- Site plan / legend ---------- */
.legend-grid{
  display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:22px;
}
.legend-item{
  display:flex;align-items:center;gap:10px;
  background:var(--surface);border:1px solid var(--line);border-radius:12px;
  padding:12px 14px;font-size:13.5px;font-weight:600;
}
.legend-swatch{width:16px;height:16px;border-radius:5px;flex-shrink:0;}
.zoom-frame{
  background:var(--surface);border:1px solid var(--line);border-radius:16px;
  padding:16px;box-shadow:var(--shadow);cursor:zoom-in;text-align:center;
}
.zoom-frame img{max-width:100%;border-radius:10px;display:block;margin:0 auto;}
.zoom-hint{font-size:12.5px;color:var(--muted);margin-top:10px;display:flex;align-items:center;justify-content:center;gap:6px;}

/* ---------- Our team ---------- */
.filter-pills{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:22px;}
.pill{
  padding:8px 16px;border-radius:20px;border:1px solid var(--line);
  background:var(--surface);font-size:13.5px;font-weight:600;cursor:pointer;color:var(--muted);
}
.pill.active{background:var(--brand);border-color:var(--brand);color:#fff;}

.dept-group{margin-bottom:30px;}
.dept-title{
  font-size:13px;font-weight:800;letter-spacing:.04em;color:var(--brand-700);
  margin-bottom:14px;display:flex;align-items:center;gap:8px;
}
.dept-title::after{content:"";flex:1;height:1px;background:var(--line);}

.profile-grid{
  display:grid;grid-template-columns:repeat(3,1fr);gap:16px;
}
.profile-card{
  background:var(--surface);border:1px solid var(--line);border-radius:16px;
  padding:18px;box-shadow:var(--shadow);
}
.profile-top{display:flex;gap:12px;align-items:center;margin-bottom:12px;}
.avatar{
  width:64px;height:64px;border-radius:50%;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
  font-weight:800;font-size:16px;color:#fff;
  font-family:'Manrope',sans-serif;
  overflow:hidden;
}
.avatar{position:relative;}
.avatar img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center 25%;display:block;}
.profile-name{font-weight:800;font-size:15px;}
.profile-title{font-size:12.5px;color:var(--muted);margin-top:2px;}
.profile-bio{font-size:13.5px;color:var(--ink);line-height:1.55;}

/* ---------- Resource pages ---------- */
.resource-toolbar{
  display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-bottom:20px;
}
.search-box{
  flex:1;min-width:220px;
  display:flex;align-items:center;gap:8px;
  background:var(--surface);border:1px solid var(--line);border-radius:12px;
  padding:10px 14px;
}
.search-box input{
  border:none;outline:none;flex:1;font-size:14px;font-family:inherit;background:transparent;
}
.toolbar-select{
  border:1px solid var(--line);border-radius:12px;padding:9px 12px;
  font-size:13.5px;font-family:inherit;background:var(--surface);color:var(--ink);
}
.view-toggle{display:flex;border:1px solid var(--line);border-radius:12px;overflow:hidden;}
.view-toggle button{
  border:none;background:var(--surface);padding:9px 13px;cursor:pointer;color:var(--muted);
}
.view-toggle button.active{background:var(--brand);color:#fff;}
.result-count{font-size:13px;color:var(--muted);margin-bottom:14px;}

.res-alpha-heading{
  font-size:13px;font-weight:800;color:var(--brand-700);margin:20px 0 10px;
}
.res-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;}
.res-list{display:flex;flex-direction:column;gap:8px;}

.res-card{
  background:var(--surface);border:1px solid var(--line);border-radius:14px;
  padding:16px;display:flex;gap:12px;align-items:flex-start;box-shadow:var(--shadow);
}
.res-icon{
  width:38px;height:38px;border-radius:10px;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;font-size:18px;
  background:var(--brand-50);color:var(--brand);
}
.res-icon.xlsx{background:#E4F3E9;color:#1E8449;}
.res-icon.docx{background:#E4ECF4;color:#2E5B8F;}
.res-icon.pdf{background:#F7EAEA;color:var(--danger);}
.res-icon.pptx{background:#FBEBE4;color:#C0562B;}
.res-icon.html{background:var(--accent-50);color:var(--accent-600);}
.res-icon.img{background:#EFEAF7;color:#6B4FA3;}
.res-name{font-weight:700;font-size:13.5px;line-height:1.4;}
.res-type{font-size:12px;color:var(--muted);margin-top:3px;text-transform:uppercase;letter-spacing:.03em;}

.res-list .res-card{flex-direction:row;align-items:center;padding:12px 16px;}
.res-list .res-name{flex:1;}

.state-msg{
  padding:40px 20px;text-align:center;color:var(--muted);font-size:14px;
}
.state-msg i{font-size:32px;display:block;margin-bottom:10px;color:var(--line);}

/* ---------- Footer disclaimer ---------- */
.footer-disclaimer{
  margin:40px 0 10px;padding:18px 20px;border-radius:14px;
  background:var(--brand-50);border:1px solid var(--brand-100);
  font-size:12.5px;color:var(--muted);line-height:1.6;
}
.footer-disclaimer strong{color:var(--brand-700);}

/* Callout note (rise360 shared component) */
.callout-note{
  display:flex;gap:12px;background:var(--accent-50);
  border:1px solid rgba(192,122,46,.3);border-radius:12px;
  padding:14px 16px;font-size:13.5px;margin-bottom:20px;
}
.callout-note i{color:var(--accent-600);font-size:20px;flex-shrink:0;}

/* ---------- Zoom modal ---------- */
.zoom-modal{
  display:none;position:fixed;inset:0;background:rgba(10,15,12,.82);
  z-index:100;align-items:center;justify-content:center;padding:30px;
}
.zoom-modal.open{display:flex;}
.zoom-modal img{max-width:92vw;max-height:88vh;border-radius:10px;background:#fff;}
.zoom-close{
  position:absolute;top:22px;right:28px;background:rgba(255,255,255,.12);
  border:none;color:#fff;font-size:22px;width:42px;height:42px;border-radius:50%;
  cursor:pointer;display:flex;align-items:center;justify-content:center;
}


/* Resource cards are real links to the files */
a.res-card{text-decoration:none;color:inherit;}
@media (hover:hover){a.res-card:hover{border-color:var(--brand-100);background:var(--brand-50);}}

/* =====================================================================
   Mobile & responsive layer — keep this block LAST in the stylesheet.
   Desktop  : 901px and up    fixed left sidebar
   Tablet   : 601–900px       top bar + dropdown menu card, 2-column grids
   Phone    : 600px and down  top bar + full-width dropdown, 1-column grids
   The 900px nav breakpoint is also in js/app.js (MOBILE_NAV) — change both together.
   ===================================================================== */
:root{ --bar-h:56px; }
html{ -webkit-text-size-adjust:100%; text-size-adjust:100%; }
img, svg, video{ max-width:100%; }
.mobile-bar{ display:none; }
.scrim{ display:none; position:fixed; inset:0; z-index:39; background:rgba(10,15,12,.45); }
.hint-tap{ display:none; }
.res-name, .profile-name, .profile-title, .meta-chip, .strip-chip{ overflow-wrap:anywhere; }
.res-card > div:last-child{ min-width:0; }

/* visible keyboard focus everywhere */
.nav-btn:focus-visible, .menu-toggle:focus-visible, .quick-link:focus-visible, .pill:focus-visible,
.view-toggle button:focus-visible, a.res-card:focus-visible, .zoom-close:focus-visible,
.mobile-brand:focus-visible, .zoom-frame:focus-visible{ outline:3px solid var(--accent); outline-offset:2px; }

@media (hover:none){ .hint-click{ display:none; } .hint-tap{ display:inline; } }

/* ---- tablet and below: 2-column grids ---- */
@media (max-width:980px){
  .stats-row{ grid-template-columns:repeat(2,1fr); }
  .dashboard-grid{ grid-template-columns:1fr; }
  .profile-grid, .res-grid{ grid-template-columns:repeat(2,1fr); }
  .legend-grid{ grid-template-columns:repeat(2,1fr); }
}

/* ---- tablet portrait and phones: sidebar becomes a top bar + dropdown menu ---- */
@media (max-width:900px){
  html{ scroll-padding-top:calc(var(--bar-h) + env(safe-area-inset-top,0px) + 12px); }
  body.nav-open{ overflow:hidden; }

  .mobile-bar{
    display:flex; align-items:center; justify-content:space-between; gap:12px;
    position:sticky; top:0; z-index:50;
    height:calc(var(--bar-h) + env(safe-area-inset-top,0px));
    padding:env(safe-area-inset-top,0px) max(16px,env(safe-area-inset-right)) 0 max(16px,env(safe-area-inset-left));
    background:var(--brand-700); color:#fff;
  }
  .mobile-brand{ display:flex; align-items:center; gap:10px; flex-shrink:0; min-height:44px;
    font-weight:800; color:#fff; text-decoration:none; }
  .mobile-bar img{ height:28px; width:auto; filter:brightness(0) invert(1); }
  .menu-toggle{
    display:inline-flex; align-items:center; gap:8px; min-width:0; max-width:64%; min-height:44px;
    padding:0 14px; border:1px solid rgba(255,255,255,.30); border-radius:22px;
    background:rgba(255,255,255,.12); color:#fff;
    font:600 15px/1 'Inter',system-ui,sans-serif; cursor:pointer; touch-action:manipulation;
  }
  .menu-label{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .menu-caret{ flex-shrink:0; font-size:16px; transition:transform .18s ease; }
  .menu-toggle[aria-expanded="true"]{ background:#fff; color:var(--brand-700); }
  .menu-toggle[aria-expanded="true"] .menu-caret{ transform:rotate(180deg); }

  .scrim.open{ display:block; }

  /* the same <aside> that is the desktop sidebar becomes the dropdown */
  .sidebar{
    top:calc(var(--bar-h) + env(safe-area-inset-top,0px) + 8px);
    left:12px; right:12px; bottom:auto; width:auto;
    max-height:calc(100vh - var(--bar-h) - env(safe-area-inset-top,0px) - 20px);
    max-height:calc(100dvh - var(--bar-h) - env(safe-area-inset-top,0px) - 20px);
    border-radius:18px; overflow:hidden;
    box-shadow:0 24px 48px -12px rgba(0,0,0,.45);
    z-index:45;
    opacity:0; visibility:hidden; pointer-events:none; transform:translateY(-10px);
    transition:opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
  }
  .sidebar.open{ opacity:1; visibility:visible; pointer-events:auto; transform:none; transition-delay:0s; }
  .brand-block{ display:none; }                         /* the top bar already shows the brand */
  .sidebar-scroll{ padding:10px 10px 6px; overscroll-behavior:contain; }
  .nav-label:first-child{ margin-top:6px; }
  .nav-btn{ min-height:48px; padding:12px 14px; font-size:16px; touch-action:manipulation; }
  .nav-btn i{ font-size:20px; }
  .sidebar-footer{ padding:12px 18px calc(14px + env(safe-area-inset-bottom,0px)); }

  .main-col{ margin-left:0; }
  main{ padding:20px max(16px,env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom,0px)) max(16px,env(safe-area-inset-left)); }
  .app-strip{ padding:10px max(16px,env(safe-area-inset-right)) 10px max(16px,env(safe-area-inset-left)); gap:8px 10px; font-size:13px; }
  .strip-chip{ padding:4px 10px; }

  /* zoom lightbox: scroll and pinch to read fine detail */
  .zoom-modal{ padding:0; overflow:auto; -webkit-overflow-scrolling:touch; }
  .zoom-modal.open{ display:block; }
  .zoom-modal img{ display:block; margin:0 auto; max-width:none; max-height:none; width:max(100%,900px); border-radius:0; }
  .zoom-close{ position:fixed; top:max(12px,env(safe-area-inset-top)); right:max(12px,env(safe-area-inset-right));
    width:44px; height:44px; z-index:101; }
}

/* ---- tablet portrait: dropdown is a card under the menu button, roomier padding ---- */
@media (min-width:601px) and (max-width:900px){
  .sidebar{ left:auto; right:max(16px,env(safe-area-inset-right)); width:360px; }
  main{ padding-left:max(24px,env(safe-area-inset-left)); padding-right:max(24px,env(safe-area-inset-right)); }
}

/* ---- phones ---- */
@media (max-width:600px){
  body{ font-size:16.5px; }
  /* top strip: status + Training Simulation pill share the first row; chips follow, compact */
  .status-dot{ order:1; }
  .strip-sim{ order:2; margin-left:auto; padding:4px 10px; font-size:12px; }
  .strip-chip{ order:3; font-size:12.5px; padding:3px 9px; }
  .hero{ padding:26px 20px; border-radius:16px; margin-bottom:20px; }
  .hero-eyebrow{ font-size:12px; }
  .hero h1{ font-size:clamp(24px,7.4vw,30px); }
  .hero p{ font-size:15.5px; }
  .page-head h1{ font-size:clamp(22px,6.4vw,26px); }
  .page-head p.desc{ margin-bottom:14px; }
  .meta-chips{ gap:8px; margin-bottom:20px; }

  .stats-row{ gap:12px; margin-bottom:20px; }
  .stat-card{ flex-direction:column; gap:10px; padding:16px; }
  .panel{ padding:18px; }
  .profile-grid, .res-grid{ grid-template-columns:1fr; }
  .profile-card{ padding:16px; }

  /* resource toolbar: search full width, selects side by side, view toggle full width */
  .resource-toolbar{ gap:8px; }
  .search-box{ flex:1 1 100%; min-width:0; padding-top:0; padding-bottom:0; }
  .search-box input{ font-size:16px; min-width:0; min-height:48px; }   /* 16px stops iOS zooming on focus */
  .toolbar-select{ flex:1 1 calc(50% - 4px); min-width:0; min-height:48px; font-size:16px; }
  .view-toggle{ flex:1 1 100%; }
  .view-toggle button{ flex:1; min-height:48px; }

  .filter-pills{ gap:8px; }
  .pill{ min-height:44px; padding:10px 16px; }
  .quick-link{ min-height:48px; }
  a.res-card{ padding:14px; }
  .res-list .res-card{ padding:12px 14px; }
  .zoom-frame{ padding:10px; }
}

@media (max-width:420px){
  .quick-links, .legend-grid{ grid-template-columns:1fr; }
}

@media (prefers-reduced-motion:reduce){
  *, *::before, *::after{ animation:none !important; transition:none !important; scroll-behavior:auto !important; }
}
