/* Portal layout (extends ../assets/css/style.css) */
body.app { background: var(--bg-alt); }
.app-top { position: sticky; top: 0; z-index: 40; height: 64px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; padding: 0 20px; }
.app-top .brand { font-size: 1.05rem; }
.app-user { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: .9rem; color: var(--muted); }
.app-user form { margin: 0; }
.app-toggle { display: none; }
.app-wrap { display: grid; grid-template-columns: 232px 1fr; min-height: calc(100vh - 64px); }
.app-side { background: var(--navy); padding: 18px 12px; }
.app-side nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 82px; }
.app-side a { color: #c9d6e3; text-decoration: none; padding: 10px 14px; border-radius: 8px; font-weight: 600; font-size: .93rem; }
.app-side a:hover { background: rgba(255,255,255,.08); color: #fff; }
.app-side a[aria-current="page"] { background: var(--orange); color: #fff; }
.app-side .side-muted { margin-top: 18px; font-size: .82rem; opacity: .75; }
.app-main { padding: 28px; min-width: 0; max-width: 1280px; width: 100%; }
.app-main h1 { font-size: 1.7rem; margin-bottom: 4px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 0; color: var(--muted); }
.kpis.k4 { grid-template-columns: repeat(4, 1fr); }
.kpis.k5 { grid-template-columns: repeat(5, 1fr); }
.app .kpi { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 16px; }
.app .kpi .value { font-size: 1.35rem; }
.app .card { padding: 22px; }
.stack > * + * { margin-top: 22px; }
.pill.red { background: #fde8e8; color: #b42318; }
.notice.err { background: #fde8e8; border-color: #b42318; }
.actions-cell { white-space: nowrap; display: flex; gap: 6px; flex-wrap: wrap; }
.actions-cell form { margin: 0; }
.link-btn { background: none; border: 0; color: var(--navy-3); font: inherit; font-weight: 600; cursor: pointer; padding: 0; text-decoration: underline; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters .field { min-width: 160px; }
.banner { background: var(--orange-soft); border: 1px solid #f7c8a8; border-left: 5px solid var(--orange); border-radius: 10px; padding: 14px 18px; margin-bottom: 22px; }
.banner h3 { margin: 0 0 8px; font-size: 1rem; }
.banner ul { margin: 0; padding-left: 18px; }
.auth-main { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(120deg, var(--navy), var(--navy-3)); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 16px; padding: 32px; box-shadow: 0 30px 60px rgba(0,0,0,.3); }
.auth-card .brand { margin-bottom: 18px; }
.auth-card form .field + .field { margin-top: 14px; }
.auth-main > .notice { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 5; }
.empty { text-align: center; padding: 28px; color: var(--muted); }
.pdf-frame { width: 100%; height: 900px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
@media (max-width: 1020px) { .kpis.k4, .kpis.k5 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 880px) {
  .app-toggle { display: block; }
  .app-wrap { grid-template-columns: 1fr; }
  .app-side { display: none; }
  body.side-open .app-side { display: block; }
  .app-side nav { position: static; }
  .app-main { padding: 18px 16px; }
  .hide-sm { display: none; }
}
.kpis > * { min-width: 0; }
.kpi .value { overflow-wrap: anywhere; }
.entry-grid { grid-template-columns: 140px 1.2fr 1.6fr 160px 1fr auto; align-items: end; }
@media (max-width: 1100px) { .entry-grid { grid-template-columns: 1fr 1fr; } .entry-grid .btn { justify-self: start; } }
@media (max-width: 560px) { .entry-grid { grid-template-columns: 1fr; } .app .kpi .value { font-size: 1.1rem; } .kpis.k4, .kpis.k5 { gap: 10px; } .app .kpi { padding: 12px; } }
.side-head { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.45); padding: 16px 14px 4px; }
.app-side .lock { font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; background: rgba(234,88,12,.25); color: #ffb98a; border-radius: 999px; padding: 2px 7px; margin-left: 6px; vertical-align: middle; }
.co-switch select { padding: 7px 30px 7px 12px; border-radius: 999px; font-size: .85rem; font-weight: 600; max-width: 220px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.plan-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.plan-card.current { border: 2px solid var(--orange, #ea580c); }
.plan-card ul { list-style: none; padding: 0; margin: 14px 0 0; }
.plan-card li { padding: 5px 0; font-size: .92rem; }
.plan-card li.no { color: var(--muted); text-decoration: line-through; }
.guide h2 { font-size: 1.25rem; margin: 26px 0 10px; }
.guide h3 { font-size: 1.05rem; margin: 18px 0 6px; }
.guide ul { margin: 6px 0 0 18px; }
.guide li { margin: 4px 0; }
.inv-lines td input, .inv-lines td select { min-width: 0; }
@media (max-width: 900px) { .plans { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .co-switch select { max-width: 150px; } }
.app-side nav { max-height: calc(100vh - 100px); overflow-y: auto; }
.app-side a { padding: 8px 14px; }
@media (max-width: 880px) { .app-side nav { max-height: none; } }
[hidden] { display: none !important; }
.region-row { grid-template-columns: 1.4fr 90px 120px 1fr auto; align-items: end; border-top: 1px solid var(--line); padding: 12px 0; }
@media (max-width: 1200px) { .region-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .region-row { grid-template-columns: 1fr; } }
/* Pimento Books: accounting pages */
.kpis.k3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .kpis.k3 { grid-template-columns: 1fr; } }
.tabs a { padding: 8px 16px; border-radius: 999px; font-weight: 700; color: var(--muted); text-decoration: none; }
.tabs a.active { background: #fff; color: var(--navy); box-shadow: var(--shadow); }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 600; }
table tr.sub td { color: var(--muted); }
table tr.total td { font-weight: 700; border-top: 2px solid var(--navy); }
table tr.group td { background: var(--bg-alt); font-weight: 700; color: var(--navy); }
.report-head { text-align: center; margin-bottom: 14px; }
.report-head h2 { margin: 0; }
.report-head p { margin: 4px 0 0; color: var(--muted); }
.ok-text { color: #1f7a4d; font-weight: 700; } .bad-text { color: #b42318; font-weight: 700; }
