/* SoilRx — light customer shell (sidebar + header) for secondary pages. Needs colors_and_type.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body { margin: 0; min-height: 100vh; display: flex; background: var(--bg-page); color: var(--fg-1); font-family: var(--font-sans);
  background-image: radial-gradient(1200px 600px at 92% -6%, rgba(106,189,69,0.13), transparent 58%), radial-gradient(900px 520px at 2% 8%, rgba(167,139,250,0.08), transparent 55%); background-attachment: fixed; }
.ic { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
a { color: var(--leaf-700); }
a:hover { color: var(--leaf-600); }
/* sidebar: defined ONCE, in the "canonical sidebar" block further down. An
   older copy of those rules used to sit here; it lost to the canonical block
   in the cascade anyway, but being first it was what design-parity compared. */
/* main */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
/* header: the rich header AppShell renders is app-shell.css (SoilRx User Home
   Dashboard.html verbatim), loaded after this file. The older light-header rules
   that sat here only ever lost to it in the cascade, apart from .profile .avatar,
   whose extra specificity shrank the header avatar below the design's 42px. */
.content { padding: 26px 34px 60px; max-width: 1200px; }
.section { margin-top: 38px; }
.section:first-child { margin-top: 0; }
.section-head { display: flex; align-items: center; gap: 13px; margin-bottom: 16px; }
.section-head .sec-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: linear-gradient(140deg, var(--leaf-400), var(--leaf-500)); box-shadow: 0 5px 13px -4px rgba(106,189,69,0.5); }
.section-head .sec-ic .ic { width: 20px; height: 20px; }
.section-head h3 { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: var(--tracking-snug); margin: 0; }
.section-head .kicker { margin-left: auto; font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); }
.card { background: var(--bg-surface); border: 1px solid var(--border-1); border-radius: var(--radius-lg); padding: 22px 24px; box-shadow: var(--shadow-1); }
/* shared bits */
.pill { font-size: 11.5px; font-weight: 700; padding: 4px 11px; border-radius: 999px; background: var(--leaf-100); color: var(--leaf-700); white-space: nowrap; }
.pill.warm { background: #f8ecd6; color: var(--soil-700); }
.pill.mute { background: var(--bone-200); color: var(--ink-600); }
.pill.blue { background: #e2f2fb; color: #1d7fb0; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.stub { border: 1.5px dashed var(--border-1); border-radius: var(--radius-lg); background: var(--bg-surface); padding: 30px 34px; }
.stub h4 { font-family: var(--font-display); font-weight: 800; font-size: 19px; margin: 0 0 6px; }
.stub p { margin: 0; font-size: 14px; color: var(--fg-2); line-height: 1.6; max-width: 62ch; }
@media (max-width: 900px) { .content { padding: 22px 20px 50px; } }

/* ===== canonical sidebar (unified with dashboards) ===== */

  .sidebar {
    position: sticky; top: 0; align-self: flex-start; height: 100vh; flex: none; width: 268px;
    background: linear-gradient(185deg, #182d10 0%, #112109 100%);
    border-right: 1px solid rgba(255,255,255,0.06);
    display: flex; flex-direction: column; padding: 22px 16px; z-index: 30;
    transition: width var(--dur-base) var(--ease-out);
  }
  .sidebar::before { content: ""; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(240px 220px at 50% 0%, rgba(106,189,69,0.16), transparent 70%); }
  .sidebar > * { position: relative; z-index: 1; }
  body.nav-collapsed .sidebar { width: 80px; padding: 22px 14px; }

  .side-logo { display: flex; align-items: center; min-height: 40px; padding: 0 8px 4px; }
  .side-logo .full { height: 27px; width: auto; }
  .side-logo .mark { display: none; width: 40px; height: 40px; border-radius: 11px; place-items: center; color: #fff;
    background: linear-gradient(140deg, var(--leaf-400), var(--leaf-500)); box-shadow: 0 4px 12px -3px rgba(0,0,0,0.4); }
  .side-logo .mark .ic { width: 23px; height: 23px; stroke-width: 1.9; }
  body.nav-collapsed .side-logo { justify-content: center; padding: 0 0 4px; }
  body.nav-collapsed .side-logo .full { display: none; }
  body.nav-collapsed .side-logo .mark { display: grid; }

  .nav-toggle {
    position: absolute; top: 76px; right: -14px; width: 28px; height: 28px; z-index: 4;
    border-radius: 50%; background: #1d3414; border: 1px solid rgba(255,255,255,0.14);
    box-shadow: var(--shadow-2); display: grid; place-items: center; cursor: pointer; color: rgba(244,248,234,0.82);
    transition: transform var(--dur-fast) var(--ease-out), color var(--dur-fast), background var(--dur-fast);
  }
  .nav-toggle:hover { color: var(--leaf-300); background: #244019; transform: scale(1.08); }
  .nav-toggle .ic { width: 16px; height: 16px; stroke-width: 2.2; transition: transform var(--dur-base) var(--ease-out); }
  body.nav-collapsed .nav-toggle .ic { transform: rotate(180deg); }

  .side-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; margin: 0 -6px; padding: 0 6px; }
  .side-scroll::-webkit-scrollbar { width: 0; }
  .side-section { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: rgba(244,248,234,0.42); padding: 0 12px; margin: 22px 0 8px; white-space: nowrap; }
  .side-section .add { margin-left: auto; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; color: rgba(244,248,234,0.6); background: rgba(255,255,255,0.06); cursor: pointer; transition: background var(--dur-fast), color var(--dur-fast); }
  .side-section .add:hover { background: rgba(106,189,69,0.22); color: var(--leaf-300); }
  .side-section .add .ic { width: 14px; height: 14px; stroke-width: 2.4; }
  body.nav-collapsed .side-section { justify-content: center; padding: 0; font-size: 0; height: 1px; background: rgba(255,255,255,0.1); margin: 20px 8px 12px; }
  body.nav-collapsed .side-section .add { display: none; }

  /* site tree */
  .site-group { margin-bottom: 2px; }
  .site-parent { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px; border: none; background: none; cursor: pointer;
    border-radius: 10px; color: rgba(244,248,234,0.9); font-family: var(--font-sans); font-weight: 700; font-size: 14px; text-align: left; transition: background var(--dur-fast); }
  .site-parent:hover { background: rgba(255,255,255,0.06); }
  .site-parent .home { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: none;
    background: linear-gradient(140deg, #2f5a23, #1d3a16); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08); }
  .site-parent .home .ic { width: 17px; height: 17px; }
  .site-parent .pname { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .site-parent .count { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; color: rgba(244,248,234,0.5); }
  .site-parent .caret { width: 15px; height: 15px; color: rgba(244,248,234,0.5); stroke-width: 2.4; transition: transform var(--dur-base) var(--ease-out); }
  .site-group[data-open] .site-parent .caret { transform: rotate(90deg); }

  .site-children { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-base) var(--ease-out); }
  .site-group[data-open] .site-children { grid-template-rows: 1fr; }
  .site-children-inner { overflow: hidden; }
  .site-item { display: flex; align-items: center; gap: 11px; padding: 8px 12px 8px 18px; margin-left: 14px; border-left: 1.5px solid rgba(255,255,255,0.08);
    color: rgba(244,248,234,0.64); text-decoration: none; position: relative; transition: color var(--dur-fast), background var(--dur-fast); border-radius: 0 9px 9px 0; }
  .site-item:hover { color: #fff; background: rgba(255,255,255,0.05); }
  .site-item .crop-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px rgba(255,255,255,0.06); }
  .site-item .si-text { flex: 1; min-width: 0; line-height: 1.2; }
  .site-item .si-text b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .site-item .si-text span { font-size: 11px; color: rgba(244,248,234,0.42); white-space: nowrap; }
  .site-item .si-score { font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: rgba(244,248,234,0.5); }
  .site-item.active { color: #eef9dc; background: rgba(106,189,69,0.16); border-left-color: var(--leaf-400); }
  .site-item.active::before { content: ""; position: absolute; left: -1.5px; top: 50%; transform: translateY(-50%); width: 3px; height: 60%; background: var(--leaf-400); box-shadow: 0 0 10px rgba(106,189,69,0.7); border-radius: 3px; }
  .site-item.active .si-score { color: var(--leaf-300); }

  body.nav-collapsed .site-children { display: none; }
  body.nav-collapsed .site-parent { justify-content: center; gap: 0; padding: 9px 0; }
  body.nav-collapsed .site-parent .pname, body.nav-collapsed .site-parent .count, body.nav-collapsed .site-parent .caret { display: none; }

  /* plain nav items */
  .side-nav { display: flex; flex-direction: column; gap: 3px; }
  .nav-item { display: flex; align-items: center; gap: 13px; padding: 10px 12px; border-radius: 11px; color: rgba(244,248,234,0.72); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; transition: background var(--dur-fast), color var(--dur-fast); position: relative; }
  .nav-item .ic { width: 20px; height: 20px; }
  .nav-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
  .nav-item.active { background: rgba(106,189,69,0.18); color: #e3f4c8; }
  .nav-item.active .ic { color: var(--leaf-300); }
  .nav-item .badge { margin-left: auto; font-family: var(--font-mono); font-size: 11px; font-weight: 600; background: var(--leaf-400); color: #14260c; border-radius: var(--radius-pill); padding: 1px 8px; }
  body.nav-collapsed .nav-item { justify-content: center; gap: 0; padding: 10px 0; }
  body.nav-collapsed .nav-label, body.nav-collapsed .nav-item .badge { display: none; }

  .side-foot { display: flex; flex-direction: column; gap: 3px; padding-top: 12px; margin-top: 8px; border-top: 1px solid rgba(255,255,255,0.08); }

  body.nav-collapsed [data-tip]:hover::after {
    content: attr(data-tip); position: absolute; left: 64px; top: 50%; transform: translateY(-50%);
    background: var(--ink-800); color: #fff; font-size: 12.5px; font-weight: 600; padding: 6px 11px; border-radius: 8px;
    white-space: nowrap; box-shadow: var(--shadow-2); z-index: 60; pointer-events: none;
  }

  

/* ===== universal mobile shell ===== */
@media (max-width: 760px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; height: 100dvh; z-index: 60; }
  body { padding-left: 80px; }
  body:not(.nav-collapsed) .sidebar { box-shadow: 22px 0 64px rgba(0,0,0,0.5); }
  .app-header { padding-left: 16px; padding-right: 16px; }
  .content { padding-left: 14px; padding-right: 14px; }
}
