/* Hem: «Översikt» and «Att göra» (overview/dashboard.html), round 47, panel redesign R1.
   The page pattern (page.css) for the header, the views, the figures, the notes and the cards; below, the section labels, the
   capsule tabs, the large figures as links, the groups' rows, the sectors and the demo partners. Colours only through the
   tokens (tokens.css, page.css), so light and dark both follow the theme. Bigger, calmer type (owner, note 86): body text
   15 px and up, labels and chips 13 px and up, the figures far larger than their labels. */
[hidden] { display: none !important; }

/* ---- the header: the lead and the two actions (one primary) ---- */
.pg-head .pg-sub { font-size: 16px; line-height: 1.5; }
.pg-head .pg-btn { min-height: 42px; padding: 9px 20px; font-size: 15px; }
/* «Öppna larmet»: page.css's red (#EF4444 to #DC2626) carried its white words at 4.3:1 (flow admin-hem-look); one step deeper reads 5.6:1 */
.pg-head .pg-btn.alarm { background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%); }
.hem-ico { width: 18px; height: 18px; flex: none; }
.hem-btn-ico { display: inline-flex; }

/* ---- the two views as capsule tabs ---- */
.hem-tabs { border-radius: var(--radius-full); padding: 5px; gap: 4px; margin-block-end: 20px; }
.hem-tabs .pg-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 9px 22px; border-radius: var(--radius-full); font-size: 15px; }
.hem-tabs .pg-tab .pg-count { margin-inline-start: 0; font-size: 14px; padding: 2px 9px; }
/* the count turns red while an alarm is open (the span carries .rose, whose tint it takes only then) */
.hem-tabs .pg-tab .pg-count.alarm { background: var(--a-bg); color: var(--a); box-shadow: inset 0 0 0 1px var(--a-line); }

/* ---- the notes and the empty and error states ---- */
.pg-note { font-size: 15px; }
.pg-empty { font-size: 16px; line-height: 1.5; }
.hem-done { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 36px 20px; text-align: center; color: var(--pg-muted); font-size: 16px; }
.hem-done-ico { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: var(--radius-full); color: var(--a); background: var(--a-bg); border: 1px solid var(--a-line); }
.hem-done-ico svg { width: 26px; height: 26px; }
.hem-done p { margin: 0; }

/* ---- «Översikt»: the section labels and the figures ---- */
.hem-sec { margin: 4px 0 12px; font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--pg-muted); }
html[dir="rtl"] .hem-sec { letter-spacing: 0; }
.hem-kpis { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-block-end: 24px; }
.hem-kpis .pg-kpi { gap: 6px; padding: 20px 22px 18px; }
.hem-kpis .pg-kpi-label { font-size: 14px; }
.hem-kpis .pg-kpi-value { font-size: 42px; line-height: 1.05; margin-block: 6px 2px; }
.hem-kpis .pg-kpi-sub { font-size: 14px; }
/* a figure that leads to its page: the tile of page.css as a link */
a.pg-kpi { text-decoration: none; cursor: pointer; transition: transform 0.24s var(--ease-spring), box-shadow 0.24s var(--ease-spring), border-color 0.24s ease; }
a.pg-kpi:hover { transform: translateY(-3px); box-shadow: var(--pg-lift-hi); border-color: var(--a-line); }
a.pg-kpi:focus-visible, .todo-row:focus-visible, .sec-item a:focus-visible, .hem-tabs .pg-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.hem-chip { display: inline-flex; align-items: center; padding: 3px 11px; border-radius: var(--radius-full); font-size: 14px; font-weight: 600; white-space: nowrap; color: var(--a); background: var(--a-bg); border: 1px solid var(--a-line); }
a.hem-chip { text-decoration: none; }

/* ---- «Att göra»: one card per job, its accent on the inline start; each row a link to the page that decides it ---- */
.todo-group { border-inline-start: 3px solid var(--a2); }
.todo-group .pg-card-sub { font-size: 15px; }
.todo-row {
  display: grid; grid-template-columns: 160px minmax(0, 1fr) auto auto; grid-template-areas: "chip main when go"; align-items: center; gap: 4px 16px;
  min-height: 64px; padding: 14px 22px; border-block-end: 1px solid var(--pg-line); color: var(--pg-text); text-decoration: none;
  transition: background-color 0.16s ease;
}
.todo-row:last-child { border-block-end: 0; }
.todo-row:hover { background: var(--hover); }
.todo-row .hem-chip { grid-area: chip; justify-self: start; }
.todo-main { grid-area: main; min-width: 0; }
.todo-name { display: block; font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.todo-reason { display: block; margin-block-start: 2px; font-size: 15px; color: var(--pg-muted); overflow-wrap: anywhere; }
.todo-when { grid-area: when; font-size: 15px; color: var(--pg-muted); white-space: nowrap; font-variant-numeric: tabular-nums; text-align: end; }
.todo-go { grid-area: go; font-size: 15px; font-weight: 600; color: var(--a); white-space: nowrap; }

/* ---- «Översikt»: every sector's honest state, the taxi first ---- */
.sec-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.sec-item { background: var(--pg-inner); border: 1px solid var(--pg-line); border-radius: var(--radius-lg); padding: 16px 18px; min-width: 0; transition: border-color 0.2s ease, transform 0.2s var(--ease-spring), box-shadow 0.2s ease; }
.sec-item:hover { border-color: var(--glass-border-hi); transform: translateY(-2px); box-shadow: var(--pg-lift); }
.sec-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.sec-name { font-size: 17px; font-weight: 700; color: var(--pg-text); text-decoration: none; overflow-wrap: anywhere; }
a.sec-name:hover { text-decoration: underline; }
.sec-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; margin: 12px 0 0; font-size: 15px; }
.sec-facts dt { color: var(--pg-muted); font-size: 14px; }
.sec-facts dd { margin: 0 0 6px; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--pg-text); }
.sec-none { margin: 10px 0 0; font-size: 15px; color: var(--pg-muted); }

/* ---- «Demopartner»: the super admin's card, one row per demo partner (GET|POST /api/admin/demo-partners) ---- */
.demo-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: start; gap: 4px 14px; padding: 14px 0; border-block-end: 1px solid var(--pg-line); }
.demo-row:last-child { border-block-end: 0; }
.demo-mark { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--radius-full); color: var(--pg-muted); background: var(--pg-inner); }
.demo-mark svg { width: 16px; height: 16px; }
.demo-mark.done { color: var(--accent); }
.demo-main { min-width: 0; }
.demo-sector { display: block; font-size: 16px; font-weight: 700; color: var(--pg-text); overflow-wrap: anywhere; }
.demo-name, .demo-state, .demo-has, .demo-run { display: block; margin-block-start: 2px; font-size: 15px; line-height: 1.45; color: var(--pg-muted); overflow-wrap: anywhere; }
.demo-run { font-weight: 600; color: var(--pg-text); }
.demo-state a { color: inherit; font-weight: 700; }
.demo-foot { margin: 14px 0 0; font-size: 15px; color: var(--pg-muted); }
.demo-form { margin-block-end: 16px; max-width: 540px; }
.demo-form .pg-field { width: 100%; }
.demo-form label { font-size: 15px; }
.demo-form .pg-form-hint { font-size: 15px; }
.demo-form .pg-btn { min-height: 42px; padding-inline: 20px; font-size: 15px; }

/* ---- the admin-a row and card actions of the ?w10= views (settings/js/w10-admin-a-panel.js): a row's form opens in place ---- */
.a7-act { display: inline-block; vertical-align: top; }
.a7-act > .pg-more-menu { position: static; margin-top: 8px; padding: 12px; min-width: 260px; box-shadow: none; }
.a7-form { display: grid; gap: 10px; margin: 0; }
.a7-form .pg-form-group { margin: 0; }
.a7-form .pg-field { width: 100%; }
.a7-form.wide { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: end; }
.a7-submit { display: flex; align-items: end; }
.a7-inline { display: inline-flex; gap: 6px; margin: 0; }
.a7-cell-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.a7-muted { color: var(--pg-muted); font-size: 14px; }

@media (max-width: 640px) {
  .hem-tabs { display: flex; width: 100%; }
  .hem-tabs .pg-tab { flex: 1 1 0; justify-content: center; padding-inline: 14px; min-height: 44px; }
  .hem-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .hem-kpis .pg-kpi { padding: 16px 14px 14px; }
  .hem-kpis .pg-kpi-value { font-size: 32px; }
  .todo-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "chip when" "main go"; gap: 8px 12px; padding: 14px 16px; }
  .sec-list { grid-template-columns: minmax(0, 1fr); }
  .demo-row { grid-template-columns: 28px minmax(0, 1fr); }
  .demo-row .pg-chip { grid-column: 2; justify-self: start; }
  .a7-act > .pg-more-menu { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  a.pg-kpi:hover, .sec-item:hover { transform: none; }
  a.pg-kpi, .sec-item, .todo-row { transition: none; }
}
