/* Web admin layout. Patterns shared with link pages are in /s/assets/app.css. */

.jk-app { min-height: 100vh; display: flex; flex-wrap: wrap; }
jk-sidebar { display: contents; }
.jk-side { flex: 1 1 232px; box-sizing: border-box; padding: 20px 12px; display: flex; flex-direction: column; gap: 18px; background: var(--jh-bg-elev); border-right: 1px solid var(--jh-border); }
.jk-content { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }
.jk-side .jk-brand { padding: 0 10px; }
.jk-side-group { display: flex; flex-direction: column; gap: 4px; }
.jk-side-group > .jh-eyebrow { padding: 0 10px; }
.jk-side-items { display: flex; flex-wrap: wrap; gap: 2px; }
.jk-side-items a { flex: 1 1 180px; height: 34px; }
.jk-side-items .jh-grow { color: inherit; }
.jk-side-scope { padding: 0 10px; display: flex; flex-direction: column; gap: 2px; }
.jk-side-user { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--jh-border); }

.jk-main { flex: 1; min-width: 0; box-sizing: border-box; padding: 32px; display: flex; flex-direction: column; gap: 24px; }
.jk-main--narrow { max-width: 900px; }
.jk-content:has(.jk-main--alt) { background: var(--jh-bg-alt); }
.jk-paper--page { flex: 3 1 480px; min-width: 0; max-width: 760px; padding: 40px; gap: 20px; }
.jk-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.jk-head > .jk-row { align-items: flex-end; }
.jk-master { flex: 1; display: flex; flex-wrap: wrap; align-items: stretch; }
.jk-master > .list { flex: 1 1 320px; max-width: 420px; min-width: 0; border-right: 1px solid var(--jh-border); display: flex; flex-direction: column; }
.jk-master > .list > header { padding: 24px 20px 16px; display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid var(--jh-border); }
.jk-master > .detail { flex: 3 1 560px; min-width: 0; box-sizing: border-box; padding: 24px 32px 40px; display: flex; flex-direction: column; gap: 20px; }

.jk-need { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 16px 20px; border-bottom: 1px solid var(--jh-border); }
.jk-need:last-child { border-bottom: 0; }
.jk-need > .kind { flex: 0 0 120px; }
.jk-need > .text { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }

.jk-toast { position: fixed; right: 16px; bottom: 16px; z-index: 10; max-width: 340px; padding: 12px 14px; border-radius: var(--jh-radius-md); background: var(--jh-fg); color: var(--jh-bg); font-size: 13px; box-shadow: var(--jh-shadow-lg); }

/* The list and detail stack below this width, so the list takes the full row. */
@media (max-width: 1111px) {
  .jk-master > .list { max-width: none; border-right: 0; border-bottom: 1px solid var(--jh-border); }
}

/* The sidebar stacks above the content below this width. */
@media (max-width: 791px) {
  .jk-side { border-right: 0; border-bottom: 1px solid var(--jh-border); }
}

@media (max-width: 720px) {
  .jk-main, .jk-master > .detail { padding: 20px 16px 32px; }
  .jk-paper--page { padding: 24px 20px; }
}

/* Widescreen: keep the sidebar fixed, centre the content, and give detail pages room. */
@media (min-width: 1600px) {
  .jk-side { flex: 0 0 264px; }
  .jk-main { width: 100%; max-width: 1640px; margin: 0 auto; padding: 40px 56px; }
  .jk-main--narrow { max-width: 1040px; }
  .jk-master > .list { flex: 0 0 420px; }
  .jk-master > .detail { padding: 32px 56px 48px; }
  .jk-master > .detail > * { width: 100%; max-width: 1280px; margin-inline: auto; }
  .jk-tiles { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
}

@media (min-width: 2200px) {
  .jk-main { max-width: 1840px; }
  .jk-main--narrow { max-width: 1040px; }
  .jk-master > .detail > * { max-width: 1480px; }
}
