:root{
  --forest:#18392f;
  --green:#295345;
  --paper:#f4f1e9;
  --ink:#202721;
  --line:#ddd8ca;
  --muted:#74786f;
  --gold:#c69b55;
}

*{box-sizing:border-box}
html{min-width:0}
body{margin:0;background:var(--paper);color:var(--ink);font:14px/1.5 Arial,sans-serif;min-width:0}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
a{overflow-wrap:anywhere}
img{max-width:100%}

/* Dashboard shell. These selectors are deliberately scoped so profile-page
   <aside>, <main>, <header>, and <nav> elements are never turned into the
   dashboard sidebar. */
.shell{display:flex;min-height:100vh;min-width:0}
.shell > aside{
  position:fixed;
  inset:0 auto 0 0;
  width:260px;
  background:var(--forest);
  color:#fff;
  padding:28px 20px;
  display:flex;
  flex-direction:column;
  overflow-y:auto;
  z-index:60;
}
.shell > aside .brand{display:flex;align-items:center;gap:12px;padding:0 8px 28px;min-width:0}
.shell > aside .brand > span{font-size:38px;color:var(--gold);flex:0 0 auto}
.shell > aside .brand b,.shell > aside .brand small{display:block}
.shell > aside .brand b{font-family:Georgia,serif;font-size:18px;line-height:1.15;white-space:nowrap}
.shell > aside .brand small{color:#aebeb5;text-transform:uppercase;letter-spacing:1px;font-size:9px;margin-top:3px}
.shell > aside nav{display:grid;gap:4px}
.shell > aside nav a{display:flex;align-items:center;gap:11px;color:#c9d5ce;text-decoration:none;padding:10px 13px;border-radius:6px;min-width:0}
.shell > aside nav a span{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.shell > aside nav a.active,.shell > aside nav a:hover,.shell > aside nav a:focus-visible{background:var(--green);color:#fff}
.shell > aside .aside-foot{margin-top:auto;border-top:1px solid #456258;padding:17px 10px}
.shell > aside .aside-foot small,.shell > aside .aside-foot b{display:block}
.shell > aside .aside-foot a,.shell > aside .signout{color:#d8bd8e;font-size:11px}
.shell > aside .signout{border:0;background:transparent;padding:4px 0;text-decoration:underline}

.shell > main{margin-left:260px;width:calc(100% - 260px);min-width:0}
.shell > main > header{
  min-height:72px;
  background:#fbfaf7;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  padding:12px 36px;
  gap:18px;
  position:relative;
  z-index:20;
}
.shell > main > header .search{width:min(520px,65%)}
.shell > main > header .search input{width:100%;border:1px solid var(--line);border-radius:5px;padding:10px 13px;background:#fff;color:var(--ink)}
.shell > main > header .secure{margin-left:auto;color:#587a69;font-size:11px;white-space:nowrap}
.avatar{width:36px;height:36px;border-radius:50%;background:#ad7753;color:#fff;display:grid;place-items:center;font-size:11px;overflow:hidden;flex:0 0 auto}
.avatar img{width:100%;height:100%;object-fit:cover;display:block}
.avatar-link{text-decoration:none}

.content{padding:40px;max-width:1400px;margin:0 auto;min-width:0}
.eyebrow{color:#9b6947;font-size:10px;font-weight:700;letter-spacing:2px;text-transform:uppercase;margin:0}
h1,h2,h3{font-family:Georgia,serif}
h1{font-size:40px;line-height:1.08;margin:5px 0}
.lede{color:var(--muted);margin:14px 0 0;max-width:720px}

/* The heading and action buttons have independent grid cells. There is no
   negative margin, so the buttons can never cover the introductory text. */
.dashboard-hero{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:26px;align-items:end;margin:0 0 32px}
.dashboard-hero-copy{min-width:0}
.dashboard-actions{display:flex;justify-content:flex-end;align-items:center;flex-wrap:wrap;gap:9px;margin:0;max-width:760px}
.dashboard-actions a,.actions a,.actions button,.section-head button,.empty button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:40px;
  background:#fff;
  color:var(--ink);
  border:1px solid var(--line);
  padding:10px 14px;
  border-radius:5px;
  text-decoration:none;
  white-space:nowrap;
}
.dashboard-actions a:hover,.dashboard-actions a:focus-visible{border-color:var(--green);color:var(--forest);background:#f7faf8}
.actions{display:flex;justify-content:flex-end;gap:9px;flex-wrap:wrap;margin:20px 0 32px}

.flash,.success,.error{border-radius:4px;margin:0 0 18px;padding:11px 13px}
.flash.success,.success{background:#deeddf;color:#285f3b}
.flash.error,.error{background:#f7dfda;color:#8a352b}

.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));background:#fbfaf7;border:1px solid var(--line);min-width:0}
.stats > a{color:inherit;text-decoration:none;min-width:0}
.stats article{height:100%;padding:20px 25px;border-right:1px solid var(--line);min-width:0}
.stats > a:last-child article{border-right:0}
.stats > a:hover article,.stats > a:focus-visible article{background:#f0eadf}
.stats span,.stats small{display:block;color:var(--muted);font-size:10px}
.stats span{text-transform:uppercase;letter-spacing:1px}
.stats b{display:block;font:28px Georgia,serif;margin:4px 0}

.section-head{display:flex;justify-content:space-between;align-items:end;gap:18px;margin:40px 0 15px}
.section-head > div{min-width:0}
.section-head h2{margin:2px 0;font-size:26px}
.section-head button{background:var(--green);color:#fff}
.cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.empty,.branch{background:#fbfaf7;border:1px solid var(--line);border-radius:7px;overflow:hidden;min-width:0}
.empty{grid-column:1/-1;text-align:center;padding:42px}
.empty > span{font-size:45px;color:#9a744e}
.branch-top{height:100px;background:color-mix(in srgb,var(--branch) 30%,#eee);display:grid;place-items:center;color:var(--branch);font-size:48px}
.branch-body{padding:18px;min-width:0}
.branch-body h3{font-size:22px;margin:0}
.branch-body p{color:var(--muted)}
.branch-main{display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,.75fr);gap:20px;align-items:start}
.branch-copy{min-width:0}
.branch-details{display:grid;grid-template-columns:1fr 1fr;margin:0;border:1px solid var(--line);border-radius:5px;overflow:hidden}
.branch-details > div{padding:10px 12px;background:#f7f3ea;border-right:1px solid var(--line);border-bottom:1px solid var(--line)}
.branch-details > div:nth-child(2n){border-right:0}
.branch-details > div:nth-last-child(-n+2){border-bottom:0}
.branch-details dt{font-size:9px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);font-weight:700}
.branch-details dd{margin:2px 0 0;font:700 16px Georgia,serif}
.branch-footer{display:flex;justify-content:space-between;align-items:center;gap:16px;border-top:1px solid var(--line);margin-top:18px;padding-top:14px;color:var(--muted);font-size:11px}
.branch-action-row{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:11px}
.branch-action-row a{color:var(--green);font-weight:700;text-decoration:none}
.branch-action-row a:hover,.branch-action-row a:focus-visible{text-decoration:underline}
.branch-action-row .danger-link{color:#8a352b}

.lower{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-top:26px}
.panel{background:#fbfaf7;border:1px solid var(--line);padding:22px;min-width:0}
.panel h2{margin-top:0}
.panel li{margin:8px}
.notice{background:#eee3d4;padding:12px;color:#76543f}

.login-page{min-height:100vh;display:grid;place-items:center;background:var(--forest);padding:20px}
.login-card{width:min(430px,92vw);background:#faf8f1;padding:42px;border-radius:8px;text-align:center;box-shadow:0 20px 60px #0005}
.tree-logo{font-size:56px;color:#9b6947}
.login-card h1{font-size:34px}
.login-card label{text-align:left;display:block;margin:15px 0;font-size:12px}
.login-card input{display:block;width:100%;padding:11px;margin-top:5px;border:1px solid var(--line)}
.login-card button{width:100%;padding:12px;background:var(--forest);color:#fff;border:0;border-radius:4px}
.login-card small{display:block;color:var(--muted);margin-top:20px}

@media(max-width:1180px){
  .dashboard-hero{grid-template-columns:1fr;align-items:start}
  .dashboard-actions{justify-content:flex-start;max-width:none}
  .branch-main{grid-template-columns:1fr}
}

/* At narrower effective widths—including desktop browsers zoomed to 150% or
   200%—the navigation becomes a full-width top panel instead of a 70px strip. */
@media(max-width:900px){
  .shell{display:block}
  .shell > aside{position:static;width:100%;min-height:auto;padding:18px 20px;overflow:visible}
  .shell > aside .brand{padding:0 4px 16px}
  .shell > aside .brand b{white-space:normal}
  .shell > aside nav{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  .shell > aside nav a{justify-content:flex-start;padding:9px 10px}
  .shell > aside nav a span{display:inline;white-space:nowrap}
  .shell > aside .aside-foot{margin-top:16px;display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:12px 4px 0}
  .shell > aside .aside-foot small,.shell > aside .aside-foot b{display:inline}
  .shell > main{margin-left:0;width:100%}
  .shell > main > header{padding:12px 20px;flex-wrap:wrap}
  .shell > main > header .search{width:min(100%,560px);flex:1 1 320px}
  .content{padding:28px 20px}
  .stats{grid-template-columns:1fr 1fr}
  .stats > a:nth-child(2) article{border-right:0}
  .stats > a:nth-child(-n+2) article{border-bottom:1px solid var(--line)}
  .cards,.lower{grid-template-columns:1fr}
}

@media(max-width:600px){
  .shell > aside nav{grid-template-columns:repeat(2,minmax(0,1fr))}
  .shell > main > header .secure{order:3;margin-left:0;width:100%}
  .content{padding:24px 15px}
  .content h1{font-size:32px}
  .dashboard-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}
  .dashboard-actions a{white-space:normal;text-align:center}
  .stats{grid-template-columns:1fr}
  .stats article{border-right:0!important;border-bottom:1px solid var(--line)!important}
  .stats > a:last-child article{border-bottom:0!important}
  .section-head{align-items:flex-start;flex-direction:column}
  .branch-footer{align-items:flex-start;flex-direction:column}
  .branch-action-row{justify-content:flex-start}
}

@media(max-width:390px){
  .shell > aside nav{grid-template-columns:1fr}
  .dashboard-actions{grid-template-columns:1fr}
}
.document-tag-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:.45rem;max-height:24rem;overflow:auto;margin:1rem 0;padding:.75rem;border:1px solid var(--line,#ddd);background:#fff}
.document-tag-list label{display:flex;gap:.5rem;align-items:center;padding:.45rem}.document-tag-list small{margin-left:auto;color:#6f716b}
.document-fact-list{display:grid;gap:1rem;margin:1rem 0}.document-fact-row{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:.75rem;padding:1rem;border:1px solid var(--line,#ddd);background:#fff;border-radius:6px}.document-fact-row .wide-field{grid-column:1/-1}.document-fact-row textarea{min-height:5.5rem}
@media(max-width:850px){.document-fact-row{grid-template-columns:1fr 1fr}}@media(max-width:560px){.document-fact-row{grid-template-columns:1fr}}
