/* Rentabilitet (admin/economy.html, admin/company_economy.html, admin/_economy_calc.html,
   admin/_economy_kv.html, admin/_economy_fig.html, admin/_economy_lines.html;
   src/admin/economy.rs). Scoped under .pg-economy; the rest comes from components.css and
   admin-lists.css. */

/* Two cards side by side (result and operating costs), one column when narrow. */
.pg-economy .cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; }

/* Sum lines of the key/value lists. */
.pg-economy .kv .strong { font-weight: var(--fontWeightSemibold); color: var(--colorNeutralForeground1); }

/* Two lists in one card (the company's investment and financing). */
.pg-economy .kv + .kv { margin-top: 12px; }

/* A calculated figure (#62): a button that shows how it is calculated, a dotted underline
   as the cue. Its popover opens below it (anchored to the button, its invoker), flipping
   above near the bottom; without anchor positioning it opens where it sits. */
.pg-economy button.hint {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; text-align: inherit;
  cursor: help; text-decoration: underline dotted var(--colorNeutralForeground3); text-underline-offset: 3px;
}
.pg-economy button.hint:hover { text-decoration-color: var(--colorNeutralForeground1); }
.pg-economy button.hint:focus-visible { outline: 2px solid var(--colorStrokeFocus2); outline-offset: 2px; border-radius: 2px; }
.pg-economy .hint-pop {
  min-width: 0; max-width: min(360px, calc(100vw - 16px)); padding: 8px 12px;
  font-size: var(--fontSizeBase200); line-height: var(--lineHeightBase200); font-weight: var(--fontWeightRegular); white-space: normal;
}
@supports (position-area: bottom) {
  .pg-economy .hint-pop { position-area: bottom span-left; margin: 4px 0; position-try-fallbacks: flip-block, flip-inline; }
}
.pg-economy .hint-formula { display: block; color: var(--colorNeutralForeground3); }
.pg-economy .hint-numbers { display: block; margin-top: 2px; color: var(--colorNeutralForeground1); font-variant-numeric: tabular-nums; }

/* The company's name in the company page's subtitle is a link inside grey text: underlined,
   not told apart by colour alone (axe link-in-text-block). */
.pg-economy .page-head .sub a { text-decoration: underline; }

/* Kroner amounts are long: a smaller KPI value than the default hero size. */
.pg-economy .kpi-value { font-size: var(--fontSizeBase600); line-height: var(--lineHeightBase600); }

/* Totals row of the rent table and the buildings table. */
.pg-economy .dg tfoot tr.total th, .pg-economy .dg tfoot tr.total td {
  background: var(--colorNeutralBackground2); border-top: 1px solid var(--colorNeutralStroke1); border-bottom: 0;
  font-weight: var(--fontWeightSemibold);
}

/* Explanations under a table or a list. */
.pg-economy .note { margin: 0; padding: 10px 20px 16px; color: var(--colorNeutralForeground3); font-size: var(--fontSizeBase200); line-height: var(--lineHeightBase200); }
.pg-economy .card-body .note { padding: 8px 0 0; }

/* A value below the purchase price (the word is in the column header). */
.pg-economy .dg td.neg { color: var(--fm-danger-fg); }

/* Many years wrap rather than overflow; the rent control (current / expected) wraps below
   the years when they do not fit side by side. */
.pg-economy .cmdbar { flex-wrap: wrap; row-gap: 8px; }
.pg-economy .cmdbar .seg { flex-wrap: wrap; }
@media (max-width: 767px) { .pg-economy .cmdbar { column-gap: 8px; } .pg-economy .cmdbar .sep { display: none; } }

/* The rent, valuation and buildings tables stay tables on a phone (not stackable list
   rows): the less important columns (.hide-n) go, the rest gets tighter. A tag under a
   name (vacant unit, building without figures) sits on its own line. */
.pg-economy .eco-table td.two { white-space: normal; }
.pg-economy .eco-table td.two .second { display: block; margin-top: 2px; }
.pg-economy .eco-table td.name { min-width: 8rem; }
@media (max-width: 767px) {
  .pg-economy .eco-table .hide-n { display: none; }
  .pg-economy .eco-table .dg th, .pg-economy .eco-table .dg td { padding-left: 8px; padding-right: 8px; white-space: normal; }
  .pg-economy .eco-table .dg td.num { white-space: nowrap; }
  .pg-economy .eco-table .dg th:first-child, .pg-economy .eco-table .dg td:first-child { padding-left: 16px; }
  .pg-economy .eco-table .dg th:last-child, .pg-economy .eco-table .dg td:last-child { padding-right: 16px; }
}
