/* Nova K9 Academy | Portal and trainer workspace: downloads, receipt, shop, plan editor, customers.
   Builds on nova-app.css (nk-card, nk-button, nk-badge, nk-table, nk-form, nk-stats, nk-banner) and only adds
   what those views need. Loaded on client.php and admin/trainer.php after nova-app.css. */

.nk-dialog-wide { max-width:880px }
.nk-loading { padding:60px 20px; text-align:center; color:var(--muted); font-size:14px }
.nk-form label small { display:block; margin-top:2px; font-size:11px; font-weight:400; color:var(--muted); line-height:1.5 }
.nk-form .checkbox small { display:block; margin-top:3px; font-size:11px; color:var(--muted) }
.nk-form input::placeholder,.nk-form textarea::placeholder { color:#9aa6ad; opacity:1 }
.nk-form input[type=file] { padding:9px 12px; background:#fff; cursor:pointer }
.nk-form input[type=file]:disabled { cursor:wait }
.nk-banner .nk-fine { margin:6px 0 0; color:inherit; opacity:.85 }

/* ---------- Client: My downloads ---------- */
.nk-store-dl-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px }
.nk-store-dl { margin:0; display:flex; flex-direction:column }
.nk-store-dl-photo { aspect-ratio:16/10; background:var(--cream); overflow:hidden }
.nk-store-dl-photo img { width:100%; height:100%; object-fit:cover; object-position:50% 35% }
.nk-store-dl .nk-card-body { display:flex; flex-direction:column; flex:1; gap:0 }
.nk-store-dl h2 { font-size:21px; letter-spacing:-.035em; margin:0 0 6px }
.nk-store-dl-meta { font-size:12px; color:var(--muted); margin:0 0 18px; line-height:1.6 }
.nk-store-dl .nk-actions { margin-top:auto }
.nk-store-dl .nk-fine { margin:12px 0 0 }
.nk-store-dl-state { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-top:auto }
.nk-store-paused { margin:auto 0 0; padding:12px 14px; border-radius:6px; background:#faf2df; color:var(--warn); font-size:13px; line-height:1.6 }
.nk-store-failed { margin:auto 0 0; padding:12px 14px; border-radius:6px; background:#f9e9e7; color:#934840; font-size:13px; line-height:1.6 }

/* ---------- Client, signed out: receipt and the downloads sign-in ---------- */
.nk-store-receipt { max-width:760px; margin:24px auto 0 }
.nk-store-receipt h1 { font-size:40px; letter-spacing:-.05em; line-height:1.05; margin:0 0 14px }
.nk-store-receipt h1 em { color:var(--navy) }
.nk-store-lead { font-size:16px; line-height:1.7; color:var(--muted); margin:0 0 26px; max-width:560px }
.nk-store-lead.is-live { color:var(--good) }
.nk-store-lead.is-paused { color:var(--warn) }
.nk-store-lead.is-failed { color:#934840 }
.nk-store-receipt .nk-list-row .nk-store-thumb { width:52px; height:60px; border-radius:5px; background:var(--cream); overflow:hidden; flex:none }
.nk-store-receipt .nk-list-row .nk-store-thumb img { width:100%; height:100%; object-fit:cover }
.nk-store-receipt .nk-row-main { align-items:center }
.nk-store-receipt .nk-fine { margin:18px 0 0 }
.nk-store-receipt .nk-actions { margin-top:26px }
.nk-store-signin { max-width:560px; margin:24px auto 0 }
.nk-store-signin .nk-card-body h1 { font-size:32px; letter-spacing:-.045em; margin:0 0 10px }
.nk-store-signin .nk-card-body>p { font-size:14px; line-height:1.7; color:var(--muted); margin:0 0 22px }
.nk-store-signin .nk-form { padding:0 }
.nk-store-signin .nk-form .nk-actions { margin-top:18px; justify-content:start }
.nk-store-confirm { max-width:560px; margin:48px auto 0; text-align:center }
.nk-store-confirm h1 { font-size:32px; letter-spacing:-.045em; margin:0 0 12px }
.nk-store-confirm p { font-size:14px; color:var(--muted); line-height:1.7; margin:0 0 24px }
.nk-store-confirm .nk-actions { justify-content:center }

/* ---------- Trainer: Shop ---------- */
.nk-store-products { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; padding:23px }
.nk-store-product { display:flex; flex-direction:column; border:1px solid var(--line); border-radius:10px; overflow:hidden; background:#fff }
.nk-store-product-photo { aspect-ratio:16/10; background:var(--cream); overflow:hidden }
.nk-store-product-photo img { width:100%; height:100%; object-fit:cover; object-position:50% 35% }
.nk-store-product-body { display:flex; flex-direction:column; gap:12px; flex:1; padding:18px 20px 20px }
.nk-store-product-top { display:flex; justify-content:space-between; align-items:baseline; gap:12px }
.nk-store-product-top h3 { font-size:18px; letter-spacing:-.03em; margin:0; line-height:1.25 }
.nk-store-product-top strong { font-size:17px; letter-spacing:-.02em; white-space:nowrap }
.nk-store-product .nk-meta { margin:0 }
.nk-store-product-file { margin:0; font-size:12px; color:var(--muted); line-height:1.6; overflow-wrap:anywhere }
.nk-store-product .nk-actions { margin-top:auto; gap:6px }
.nk-store-add { display:grid; place-items:center; min-height:220px; border:1px dashed rgba(20,51,68,.3); border-radius:10px; background:transparent; text-align:center; padding:24px }
.nk-store-add p { font-size:13px; color:var(--muted); line-height:1.6; margin:0 0 14px }

.nk-store-toolbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; padding:14px 23px; border-bottom:1px solid var(--line) }
.nk-chips { display:flex; flex-wrap:wrap; gap:6px }
.nk-chip { border:1px solid var(--line); border-radius:99px; background:#fff; padding:7px 13px; font-size:12px; font-weight:600; color:var(--muted); min-height:0 }
.nk-chip:hover { border-color:var(--navy); color:var(--navy) }
.nk-chip[aria-pressed=true] { background:var(--navy); border-color:var(--navy); color:#fff }
.nk-sort { border:0; background:none; padding:0; font:inherit; color:inherit; text-transform:inherit; letter-spacing:inherit; display:inline-flex; align-items:center; gap:6px; cursor:pointer }
.nk-sort::after { content:""; width:0; height:0; border-left:4px solid transparent; border-right:4px solid transparent; border-top:5px solid currentColor; opacity:0 }
th[aria-sort="ascending"] .nk-sort::after { opacity:1; transform:rotate(180deg) }
th[aria-sort="descending"] .nk-sort::after { opacity:1 }
.nk-row-link { cursor:pointer }
.nk-row-link:hover td { background:#fafbfd }
.nk-table .nk-text-link { font-weight:600; color:var(--navy); text-align:left; cursor:pointer }
.nk-table-count { padding:12px 23px 0; font-size:11px; color:var(--muted) }

/* ---------- Trainer: plan editor ---------- */
.nk-plan-photo { display:grid; grid-template-columns:150px minmax(0,1fr); gap:18px; align-items:start }
.nk-plan-photo-preview { aspect-ratio:1; border-radius:8px; background:var(--cream); overflow:hidden; display:grid; place-items:center; color:var(--muted); font-size:11px; text-align:center; padding:6px }
.nk-plan-photo-preview img { width:100%; height:100%; object-fit:cover }
.nk-plan-photo label+label { margin-top:14px }
.nk-plan-pdf { margin:0 28px 28px; padding:22px 24px; border:1px dashed rgba(20,51,68,.32); border-radius:10px; background:var(--cream) }
.nk-plan-pdf h3 { font-size:15px; letter-spacing:-.02em; margin:0 0 8px }
.nk-plan-pdf p { margin:0 0 10px; font-size:13px; line-height:1.65; color:var(--muted) }
.nk-plan-pdf p strong { color:var(--ink) }
.nk-plan-pdf .nk-actions { margin:14px 0 0 }
.nk-plan-pdf input[type=file] { display:block; width:100%; margin-top:8px; padding:10px 12px; border:1px solid rgba(20,51,68,.2); border-radius:6px; background:#fff; font-size:13px }
.nk-plan-pdf label { display:block; font-size:11px; font-weight:600; color:#516474 }
.nk-plan-pdf-status { display:block; margin-top:10px; font-size:12px; color:var(--navy); min-height:18px }
.nk-plan-pdf-status.is-error { color:#913f36 }
.nk-plan-pdf.is-busy { opacity:.75 }

/* ---------- Trainer: customers and profile ---------- */
.nk-profile { padding:0 0 10px }
.nk-profile-head { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; padding:24px 28px 0 }
.nk-profile-head p { margin:6px 0 0; font-size:13px; color:var(--muted); line-height:1.6 }
.nk-profile-head p a { color:var(--navy); text-decoration:underline; text-underline-offset:3px }
.nk-profile-stats { display:flex; flex-wrap:wrap; gap:8px; padding:20px 28px 0 }
.nk-profile-stat { display:inline-flex; flex-direction:column; gap:2px; min-width:92px; padding:10px 14px; border:1px solid var(--line); border-radius:8px; background:#fff }
.nk-profile-stat span { font-size:10px; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); font-weight:600 }
.nk-profile-stat strong { font-size:17px; letter-spacing:-.025em }
.nk-profile-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; padding:22px 28px 0 }
.nk-profile section h4 { font-size:11px; letter-spacing:.12em; text-transform:uppercase; color:var(--muted); margin:0 0 10px; font-weight:600 }
.nk-profile-list { list-style:none; margin:0; padding:0; font-size:13px; line-height:1.7 }
.nk-profile-list li+li { margin-top:4px }
.nk-profile-list small { display:block; font-size:11px; color:var(--muted) }
.nk-profile-empty { font-size:13px; color:var(--muted); margin:0 }
.nk-profile-section { padding:24px 28px 0 }
.nk-profile-section-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px }
.nk-profile .nk-profile-section-head h4 { margin:0 }
.nk-package-list li { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding:10px 14px; border:1px solid var(--line); border-radius:8px; background:#fff }
.nk-package-list li+li { margin-top:8px }
.nk-package-list .nk-button { flex:none }
.nk-profile-notes { list-style:none; margin:0 0 14px; padding:0; display:grid; gap:8px }
.nk-profile-notes li { padding:12px 14px; background:#fbf8ef; border:1px solid rgba(20,51,68,.1); border-radius:8px; font-size:13px; line-height:1.65; white-space:pre-wrap }
.nk-profile-notes small { display:block; margin-top:6px; font-size:11px; color:var(--muted); white-space:normal }
.nk-profile-note-form .nk-actions { margin-top:10px; justify-content:start }
.nk-timeline { list-style:none; margin:0; padding:0 }
.nk-timeline li { display:flex; gap:14px; padding:12px 0; border-top:1px solid #edf1f4 }
.nk-timeline-icon { flex:none; width:30px; height:30px; display:grid; place-items:center; border-radius:50%; background:var(--blue-soft); color:var(--navy); font-size:13px }
.nk-timeline strong { font-size:13px; font-weight:600 }
.nk-timeline p { margin:3px 0 0; font-size:12px; color:var(--muted); line-height:1.6; overflow-wrap:anywhere }
.nk-timeline small { display:block; margin-top:4px; font-size:11px; color:var(--muted) }

/* ---------- Trainer: "Latest activity" on the overview (inserted by afterRender) ---------- */
.nk-store-activity .nk-card { margin-bottom:26px }
.nk-activity-row { display:flex; align-items:center; gap:14px; width:100%; padding:13px 23px; border:0; border-bottom:1px solid #edf0f3; background:none; text-align:left; font:inherit; color:inherit }
.nk-activity-row:last-child { border-bottom:0 }
button.nk-activity-row:hover { background:#fafbfd }
.nk-activity-row .nk-timeline-icon { width:32px; height:32px }
.nk-activity-row.is-alert .nk-timeline-icon { background:#f9e9e7; color:#934840; font-weight:700 }
.nk-activity-main { flex:1; min-width:0 }
.nk-activity-main strong { display:block; font-size:13px; font-weight:600; line-height:1.4 }
.nk-activity-main p { margin:2px 0 0; font-size:12px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.nk-activity-when { flex:none; font-size:11px; color:var(--muted); white-space:nowrap }
.nk-store-clients .nk-table td .nk-actions { gap:5px; max-width:430px }
.nk-store-clients .nk-dog-grid { margin-top:4px }

@media (max-width:1100px) {
  .nk-store-dl-grid,.nk-store-products { grid-template-columns:repeat(2,minmax(0,1fr)) }
  .nk-profile-grid { grid-template-columns:1fr 1fr }
}
@media (max-width:760px) {
  .nk-store-dl-grid,.nk-store-products { grid-template-columns:1fr }
  .nk-store-products { padding:18px }
  .nk-store-toolbar { padding:14px 18px; align-items:stretch; flex-direction:column }
  .nk-store-toolbar .nk-search { width:100% }
  .nk-profile-head { flex-direction:column; padding:22px 23px 0 }
  .nk-profile-stats,.nk-profile-grid,.nk-profile-section { padding-left:23px; padding-right:23px }
  .nk-profile-grid { grid-template-columns:1fr }
  .nk-plan-photo { grid-template-columns:110px minmax(0,1fr); gap:14px }
  .nk-plan-pdf { margin:0 23px 23px; padding:18px }
  .nk-store-receipt h1 { font-size:34px }
  .nk-store-receipt .nk-list-row { flex-wrap:wrap }
  .nk-store-receipt .nk-list-row .nk-actions { width:100%; justify-content:start }
  .nk-table-count { padding:12px 18px 0 }
}

/* r2 sign-in form: the success message shares the error box (build.py marks it nk-form-ok) */
.nk-form-error.nk-form-ok {
  color:var(--nk-ink, #143344);
  background:rgba(145,172,240,.16);
  border-color:rgba(145,172,240,.5)
}
/* portal header: "Back to the website" never breaks; the tabs sit on one row where they fit (2026-10-02) */
.nk-client-header > .nk-text-link { white-space:nowrap; flex:none }
@media (min-width:1360px) { .nk-client-header nav { flex-wrap:nowrap } .nk-client-header nav button { padding:10px 8px; white-space:nowrap } }
