@charset "utf-8";
/* CSS Document */
:root {
    --bg: #0f1115;
    --panel: #161a21;
    --border: rgba(255,255,255,0.08);
    --text: #f3f4f6;
    --muted: #9ca3af;
	--accent: rgba(120, 210, 255, 0.90);
    --accentGlow: rgba(120, 210, 255, 0.20);
}

* {
    box-sizing: border-box;
}

html {
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.portal-header {
    border-bottom: 1px solid var(--border);
    background: var(--panel);
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-weight: 800;
}

.main-nav a {
    color: var(--muted);
    text-decoration: none;
    margin-left: 16px;
}

.main-nav a.active {
    color: var(--text);
}

.portal-main {
    max-width: 1120px;
    margin: 0 auto;
    padding: 32px 28px;
}

.portal-footer {
    text-align: center;
    padding: 24px;
    color: var(--muted);
    font-size: 13px;
}
.powered-icon {
    width: 204px;
    height: 34px;
    opacity: 0.8;
	fill: var(--muted);
}

/* Page header */
.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    margin: 0;
}

.view-toggle {
    margin-top: 12px;
    font-size: 14px;
}

.view-toggle a {
    color: var(--muted);
    text-decoration: none;
}

.view-toggle .active {
    color: var(--text);
    font-weight: 600;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 22px;
    margin-bottom: 32px;
	position: relative;
  	width: 100%;
}

.stat-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
}

.stat-card .label {
    display: block;
    font-size: 13px;
    color: var(--muted);
}

.stat-card .value {
    font-size: 22px;
    font-weight: 700;
}

/* Period list */
.period-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
	width: 100%;
}

/* Selve raden */
.period-row{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;

  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.period-row:hover {
  border-color: rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.06);
}

.period-row a {
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
}

/* Table */
.table-wrap {
    overflow-x: auto;
	width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

th {
    color: var(--muted);
    font-weight: 600;
}

.view-toggle {
  display: inline-flex;
  gap: 8px;
  margin-top: 14px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
}

.chip.active {
  color: var(--text);
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.14);
}

.portal-main {
  position: relative;
  overflow: hidden;
  min-width: 0;
}

/*.portal-main::before {
  content: "";
  position: absolute;
  top: 30px;
  right: 10px;
  width: 360px;
  height: 360px;
  opacity: 0.09;
  pointer-events: none;
  background-repeat: no-repeat;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 420 420'%3E%3Cg fill='none' stroke='white' stroke-width='6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M120 70h130l50 50v220a30 30 0 0 1-30 30H120a30 30 0 0 1-30-30V100a30 30 0 0 1 30-30z'/%3E%3Cpath d='M250 70v60h60'/%3E%3Cpath d='M130 175h160'/%3E%3Cpath d='M130 215h140'/%3E%3Cpath d='M130 255h120'/%3E%3Cpath d='M265 210l-35 65h40l-25 55'/%3E%3C/g%3E%3C/svg%3E");
}*/

.stats-grid::before {
  content: "";
  position: absolute;
  inset: -40px -20px;
  pointer-events: none;
  opacity: 0.35;
  /*background: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.10), transparent 55%),
              radial-gradient(circle at 80% 20%, rgba(255,255,255,0.08), transparent 60%);*/
  filter: blur(8px);
}
.period-list .period-meta{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  opacity: 0.9;
  font-size: 13px;
  color: var(--muted);
}

.period-list .period-title strong{
  font-size: 15px;
  letter-spacing: 0.2px;
}

.muted{ opacity: .5; }

.dot{
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  opacity: 0.9;
  background: rgba(255,255,255,0.25);
}

/* standard */
/*.dot.unpaid { background: #ef4444; }  /* rød */
/*.dot.paid   { background: #22c55e; }  /* grønn */
/*.dot.partial{ background: #f59e0b; }  /* gul */

/* Status */
.status{ display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.status .dot{ width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status.unpaid .dot{ background: #ef4444; }
.status.paid .dot{ background: #22c55e; }

.dot.unpaid { background: #ef4444; }
.dot.paid   { background: #22c55e; }

.dashboard-content {
  max-width: 1180px;   /* kan justeres senere */
  margin: 0 auto;
  padding: 0 28px;
}
/* Venstre side */
.period-left{
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
/* Høyre “Se detalj” */
.period-action{
  white-space: nowrap;
  font-weight: 600;
  opacity: 0.9;
  text-decoration: none;
}
.period-action:hover{ opacity: 1; }

/* Mobil */
@media (max-width: 640px){
  .portal-main{ padding: 24px 16px; }

  .period-row{
    flex-direction: column;
    align-items: flex-start;
	cursor: pointer;
  }
}

.dashboard-grid{
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 22px;
  align-items: start;
}

.dashboard-left{ min-width: 0; }
.dashboard-right{ min-width: 0; order: 2; }

.panel{
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 14px 14px;
  margin-bottom: 14px;
}

.panel h3{
  margin: 0 0 10px 0;
  font-size: 14px;
  color: var(--text);
}

.kv{
  display: grid;
  gap: 10px;
}

.kv > div{
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.kv strong{
  color: var(--text);
  font-weight: 700;
}

.note{
  margin: 10px 0 0 0;
  font-size: 12px;
  color: var(--muted);
  opacity: 0.9;
}

.provider{
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  margin-top: 10px;
}

.provider-logo{
  width: 34px;
  height: 34px;
  object-fit: contain;
  opacity: 0.95;
  filter: invert(1) grayscale(1) brightness(1.6);
}

.panel{
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 14px 16px;
  overflow: visible;
}

.spark{
  width: 100%;
  height: 120px;
  display: block;
  opacity: .95;
  margin-top: 10px;
}
.note{ color: var(--muted); font-size: 12px; margin: 8px 0 0; }


.muted-text{ color: var(--muted); font-size: 12px; }

.panel-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.legend{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
  font-size:12px;
  color: var(--muted);
}

.legend-item{ display:inline-flex; align-items:center; gap:6px; }
.legend-dot{
  width:10px; height:10px; border-radius:999px;
  display:inline-block;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.14);
}

/* SVG bar chart */
.bar-chart{
  width: 100%;
  height: auto;
  display:block;
  margin-top: 10px;
}

.axis{
  stroke: rgba(255,255,255,0.20);
  stroke-width: 1;
}

.bar{
  fill: rgba(255,255,255,0.18);
  stroke: rgba(255,255,255,0.12);
  stroke-width: 1;
  opacity: .9;
}

.bar:hover{
  fill: rgba(255,255,255,0.28);
  stroke: rgba(255,255,255,0.22);
}

.bar-y0{ fill: rgba(255,255,255,0.10); } /* eldste år */
.bar-y1{ fill: rgba(255,255,255,0.22); }
.bar-y2{ fill: rgba(255,255,255,0.34); } /* nyeste år */

.legend-dot.bar-y0{ background: rgba(255,255,255,0.22); }
.legend-dot.bar-y1{ background: rgba(255,255,255,0.40); }
.legend-dot.bar-y2{ background: rgba(255,255,255,0.65); }

.xlab { fill: rgba(255,255,255,0.45); font-size: 11px; }

.chart-foot{
  margin-top: 8px;
  display:flex;
  justify-content:space-between;
  font-size: 12px;
  color: var(--muted);
}


@media (max-width: 980px){
  .dashboard-grid{
    grid-template-columns: 1fr;
  }
}

/* A+ look */
.bar-ghost{
  fill: rgba(255,255,255,0.10);
  stroke: rgba(255,255,255,0.08);
  opacity: 0.55;
}

.bar-latest{
  fill: rgba(255,255,255,0.42);
  stroke: rgba(255,255,255,0.18);
  opacity: 0.95;
}

.bar:hover{
  opacity: 1;
}

/* X labels - små og ryddige */
.xlab{
  fill: rgba(255,255,255,0.50);
  font-size: 10px;
  letter-spacing: 0.2px;
}
.pill { 
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  font-size:.9rem;
}
.spark-grid{
  stroke: rgba(255,255,255,0.08);
  stroke-width: 1;
}
.spark-hit { fill: rgba(255,255,255,0); }
.spark-dot-mini{
  fill: rgba(255,255,255,0.55);
}
.spark-dot-mini:hover{
  fill: rgba(255,255,255,0.95);
}
.spark-wrap{
  position: relative;
  margin-top: 6px;
}

.spark{
  width: 100%;
  height: 56px;
  display: block;
}

.spark-line{
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px var(--accentGlow));
}

.spark-hover-line{
  stroke: rgba(255,255,255,0.22);
  stroke-width: 1;
  opacity: 0;
}

.spark-hover-dot{
  fill: rgba(255,255,255,0.95);
  stroke: rgba(0,0,0,0.25);
  stroke-width: 1;
  opacity: 0;
}

.spark-tip{
  position: absolute;
  top: 0px;
  left: 0;
  transform: translateX(-50%);
  padding: 6px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(10, 12, 16, 0.92);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.92);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
}
.spark-hitbox{
  fill: rgba(0,0,0,0);
  pointer-events: all;
  /*cursor: default;*/
}

.spark-area{
  fill: rgba(120, 210, 255, 0.10);
  stroke: none;
  opacity: 0.9;
}

.pill-up{
  background: rgba(255, 80, 80, .14);
  border-color: rgba(255, 80, 80, .28);
}

.pill-down{
  background: rgba(80, 220, 140, .14);
  border-color: rgba(80, 220, 140, .28);
}

.pill-flat{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
}
.alert{
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  margin-top: 10px;
}

.alert--warn{
  border-color: rgba(255,110,110,0.22);
  background: rgba(255,110,110,0.07);
}

.alert--ok{
  border-color: rgba(90,220,150,0.20);
  background: rgba(90,220,150,0.06);
}

.alert--info{
  border-color: rgba(120,210,255,0.18);
  background: rgba(120,210,255,0.05);
}
.kv-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
.kv{
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  padding:10px 12px;
  background: rgba(255,255,255,.02);
}
.kv .k{ opacity:.7; font-size:.85rem; }
.kv .v{ font-weight:700; font-size:1.05rem; margin-top:2px; }
.kv .s{ opacity:.7; font-size:.85rem; margin-top:4px; }

.btn-link{
  margin-top:10px;
  background:transparent;
  border:0;
  color:inherit;
  opacity:.85;
  cursor:pointer;
  padding:6px 0;
}
.btn-link:hover{ opacity:1; }

.tomorrow-list{
  margin-top:10px;
  max-height:220px;
  overflow:auto;
  border-top:1px solid rgba(255,255,255,.08);
  padding-top:10px;
}
.tomorrow-list .row{
  display:flex;
  justify-content:space-between;
  padding:6px 0;
}
.price-summary{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:6px;
  margin-bottom:10px;
}

.sum-row{
  display:grid;
  grid-template-columns: 90px 1fr;
  grid-template-rows: auto auto;
  gap:2px 12px;
  padding:10px 12px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  background: rgba(255,255,255,.02);
}

.sum-row .label{
  grid-column:1;
  grid-row:1 / span 2;
  display:flex;
  align-items:center;
  opacity:.85;
  font-weight:600;
}

.sum-row .value{
  grid-column:2;
  grid-row:1;
  display:flex;
  align-items:baseline;
  gap:6px;
}

.sum-row .value strong{
  font-size:1.05rem;
}

.sum-row .unit{
  opacity:.75;
  font-size:.9rem;
}

.sum-row .meta{
  grid-column:2;
  grid-row:2;
  opacity:.75;
  font-size:.9rem;
}

.btn-ghost{
  width:100%;
  margin-top:6px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  color: inherit;
  cursor:pointer;
  text-align:left;
  display:flex;
  align-items:center;
  justify-content:space-between;
  opacity:.9;
  text-decoration:none;
}

.btn-ghost:hover{
  opacity:1;
  background: rgba(255,255,255,.05);
}

.tomorrow-list{
  margin-top:10px;
  max-height:220px;
  overflow:auto;
  border-top:1px solid rgba(255,255,255,.08);
  padding-top:10px;
}
.details { margin-top: 8px; }

.details > summary {
  list-style: none;
}
.details > summary::-webkit-details-marker { display:none; }

.details[open] .arrow { transform: rotate(90deg); }
.details .arrow { transition: transform .15s ease; }

.details .tomorrow-list{
  margin-top:10px;
  max-height:220px;
  overflow:auto;
  border-top:1px solid rgba(255,255,255,.08);
  padding-top:10px;
}
/* Strømpris i dag – trend */
.pill.pill--down {
  background: rgba(34, 197, 94, 0.15);   /* grønn */
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.pill.pill--up {
  background: rgba(239, 68, 68, 0.15);   /* rød */
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.pill.pill--flat {
  background: rgba(148, 163, 184, 0.12); /* nøytral */
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}
/* Kompakt "price pill" (tilbake til gammel stil) */
#price-pill.pill{
  font-size: 12px;
  line-height: 1;
  padding: 5px 9px;
  border-radius: 999px;
  letter-spacing: .1px;
  white-space: nowrap;
}

/* Kompakt "price pill" (tilbake til gammel stil) */
/* Tomorrow summary cards */
.tomorrow-cards{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}

@media (min-width: 520px){
  .tomorrow-cards{ grid-template-columns: repeat(3, 1fr); }
}

.tcard{
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.03);
  border-radius: 12px;
  padding: 10px 12px;
}

.tlabel{
  font-size: 12px;
  opacity: .75;
  margin-bottom: 4px;
}

.tvalue{
  font-size: 16px;
  font-weight: 700;
  line-height: 1.1;
}

.tvalue .unit{
  font-size: 12px;
  font-weight: 600;
  opacity: .8;
}

.tsub{
  margin-top: 6px;
  font-size: 12px;
  opacity: .75;
}

/* Collapse button */
.collapse-btn{
  width: 100%;
  margin-top: 10px;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.15);
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  cursor: pointer;
}

.collapse-btn.is-disabled{
  opacity: .5;
  cursor: not-allowed;
}

/* The expanded list: smaller text */
.kv--compact{
  margin-top: 10px;
}

.kv--compact > div{
  font-size: 12px; /* <-- dette er “for stor tekst”-fiksen */
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}

.kv--compact > div strong{
  font-size: 12px;
}
/* ===== Top header ===== */
.dash-top{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:18px;
  margin: 8px 0 18px;
}

.dash-top__left{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:18px;
  width:100%;
}

.dash-title{
  display:flex;
  align-items:center;
  gap:12px;
  min-width: 260px;
}

.dash-title__icon{
  /*width:38px;
  height:59px;*/
  display:grid;
  place-items:center;
  letter-spacing:-0.1em;
  /*border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);*/
  font-size: 45px;
}

.dash-title__h{
  margin:0;
  font-size: 34px;
  letter-spacing:-0.02em;
  line-height:1.05;
}

.dash-title__sub{
  margin-top: 6px;
  display:flex;
  align-items:center;
  gap:8px;
  font-size: 13px;
  color: var(--muted);
}

.dash-title__sub .tenant-name{
  color: rgba(255,255,255,.85);
}

.dash-title__sub .sep{
  opacity:.5;
}

.dash-top__right{
  display:flex;
  align-items:center;
  gap:10px;
  padding-bottom: 0px;
  padding-top: 0px;
}

.user-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.user-dot{
  width:8px; height:8px;
  border-radius: 999px;
  background: rgba(34,197,94,.9);
}

.user-text{
  font-size: 13px;
  color: rgba(255,255,255,.85);
}

.logout-link{
  font-size: 13px;
  color: rgba(255,255,255,.85);
  text-decoration:none;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.02);
}

.logout-link:hover{
  background: rgba(255,255,255,.06);
}

/* ===== Stats grid top ===== */
.stats-grid--top{
  margin-bottom: 26px;
}

.stat-card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.stat-card .label{
  display:block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.stat-card .value{
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.01em;
  display:block;
  line-height: 1.1;
}

.stat-card .hint{
  display:block;
  margin-top: 6px;
  font-size: 12px;
  color: rgba(255,255,255,.55);
}

.value--ok{ color: rgba(34,197,94,.95); }
.value--warn{ color: rgba(239,68,68,.95); }

.stat-card--wide{
  grid-column: span 2;
}

/* Mini alerts inside top card */
.mini-alerts{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top: 2px;
}

.mini-alert{
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
}

.mini-alert strong{
  display:block;
  font-size: 13px;
  margin-bottom: 2px;
}

.mini-alert .muted{
  display:block;
  font-size: 12px;
  color: rgba(255,255,255,.6);
}

.mini-alert--ok{ border-color: rgba(34,197,94,.25); }
.mini-alert--warn{ border-color: rgba(239,68,68,.25); }
.mini-alert--info{ border-color: rgba(59,130,246,.25); }

/* Responsive */
@media (max-width: 900px){
  .dash-top{ flex-direction: column; align-items: flex-start; }
  .dash-top__left{ flex-direction: column; align-items: flex-start; }
  .stat-card--wide{ grid-column: 1 / -1; }
}
/* Varselbjelle */
.notif-wrap {
  position: relative;
}

.notif-btn {
  background: none;
  border: 0;
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  position: relative;
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  background: #ef4444;
  color: white;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
  font-weight: 600;
}

/* Dropdown */
.notif-dropdown {
  position: absolute;
  right: 0;
  top: 34px;
  width: 280px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0,0,0,.4);
  z-index: 100;
}

.notif-head {
  padding: 12px 14px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.notif-list {
  list-style: none;
  margin: 0;
  padding: 6px;
}

.notif-item {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
}

.notif-item + .notif-item {
  margin-top: 4px;
}

.notif--ok    { background: rgba(34,197,94,.08); }
.notif--warn  { background: rgba(234,179,8,.08); }
.notif--info  { background: rgba(59,130,246,.08); }

.notif-empty {
  padding: 14px;
  font-size: 13px;
  color: var(--muted);
}

.notif-more {
  display: block;
  padding: 10px 14px;
  font-size: 13px;
  text-align: right;
}
.top-actions {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* Minimal icon button */
.icon-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  border-radius:999px;
  border:1px solid var(--border);
  background:transparent;
  color:#e5e7eb;          /* lys “outline” */
  cursor:pointer;
  position:relative;
}

.icon-btn:hover{
  background:rgba(255,255,255,.06);
}

/* SVG outline */
.icon-btn .icon{
  width:18px;
  height:18px;
  stroke:currentColor;
  fill:none;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}

/* Badge (antall varsler) */
.icon-btn .badge{
  position:absolute;
  top:-6px;
  right:-6px;
  min-width:18px;
  height:18px;
  padding:0 5px;
  border-radius:999px;
  font-size:11px;
  line-height:18px;
  font-weight:700;
  background:#ef4444;   /* rød badge */
  color:#0b0f14;
  border:1px solid rgba(0,0,0,.35);
}
.notif-btn.has-alerts{
  color:#f8fafc;
  border-color:rgba(34,197,94,.35); /* grønn hint */
}
/* Badge ligger OPPÅ ikonet (ikke ved siden av) */
.bell-badge{
  position:absolute;
  top:-4px;
  right:-4px;
  min-width:18px;
  height:18px;
  padding:0 3px;
  border-radius:999px; /* alltid rund/pill */
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  font-weight:700;
  line-height:1;
  background: #e23b3b;
  color: #fff;
  border: 2px solid rgba(10,12,16,.9); /* mørk “ring” så den popper */
}
/* Selve bjelle-knappen */
.bell-btn{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:36px;
  height:36px;
  border-radius:999px;
}
/* Ikonet */
.bell-btn .icon{
  width:18px;
  height:18px;
  stroke: #fff;
  stroke-width: 2;
  fill: none;
  opacity: .95;
}
.notif-item.is-unread{
  border-left: 3px solid rgba(70, 200, 120, .9);
  background: rgba(70, 200, 120, .06);
}
.notif-link{
  display: block;
  text-decoration: none;
  color: inherit;
}

.notif-link strong{
  font-weight: 700;
}

.notif-link span{
  opacity: .85;
}

.notif-link:hover{
  text-decoration: none;
}

.notif-item:hover{
  background: rgba(255,255,255,0.04); /* eller hva du bruker */
}
.notif-footer {
  display: flex;
  justify-content: flex-end;
  padding: 8px 12px 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.notif-all-link {
  font-size: 13px;
  font-weight: 500;
  color: #5fb3ff;          /* eller din accent */
  text-decoration: none;
}

.notif-all-link:hover {
  text-decoration: none;
}
.notif-all-link::after {
  content: "→";
  margin-left: 4px;
  transition: transform .15s ease;
}

.notif-all-link:hover::after {
  transform: translateX(2px);
}
/* Se alle varsler – link */
.notif-all-link{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #4ea1ff;            /* juster om du vil */
  text-decoration: none;
  font-weight: 500;
}

/* Pil */
.notif-all-link::after{
  content: "→";
  display: inline-block;
  opacity: .7;
  transition: transform .15s ease, opacity .15s ease;
}

/* Hover */
.notif-all-link:hover::after{
  transform: translateX(3px);
  opacity: 1;
}
/*.page-wrap { max-width: 1064px; margin: 0 auto; }*/
.page-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin: 18px 0; }
.page-title { margin:0; }
.page-subtitle { margin:6px 0 0; opacity:.8; }

.page-actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }

.card { border-radius:16px; padding: 14px; }
.card-head { display:flex; justify-content:space-between; align-items:center; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.08); }
.card-body { padding-top: 10px; }
.card-foot { padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); margin-top: 10px; }

.pill-group { display:flex; gap:8px; flex-wrap:wrap; }
.pill { display:inline-flex; padding: 6px 10px; border-radius: 999px; text-decoration:none; border: 1px solid rgba(255,255,255,.12); opacity:.9; }
.pill.active { opacity: 1; border-color: rgba(255,255,255,.28); }

/*.notif-row { display:flex; justify-content:space-between; gap:12px; padding: 12px; border-radius: 14px; border: 1px solid rgba(255,255,255,.08); margin-bottom: 10px; }*/
/*.notif-row.unread { border-color: rgba(255,255,255,.22); box-shadow: 0 0 0 1px rgba(255,255,255,.06) inset; }*/
/*.notif-title { display:flex; align-items:center; gap:10px; }*/
/*.notif-text { margin-top: 6px; opacity:.9; }*/
/*.notif-meta { margin-top: 8px; font-size: .9rem; opacity:.7; }*/
/*.notif-side { display:flex; align-items:center; }*/

.badge-new { font-size:.75rem; padding: 2px 8px; border-radius: 999px; border: 1px solid rgba(255,255,255,.18); opacity:.9; }

.pagination { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; }
.page-indicator { opacity:.75; }

.rent-overview-actions {
    align-items: flex-end;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.rent-filter-form {
    align-items: flex-end;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.rent-filter-form label {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rent-filter-form select {
    min-height: 42px;
}

.rent-overview-table-wrap {
    overflow-x: auto;
}

.rent-overview-tenant-cell strong {
    color: #1f2937;
    font-weight: 750;
}

.rent-pagination {
    align-items: center;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: space-between;
    margin-top: 18px;
    padding-top: 16px;
}

.rent-pagination__links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.empty-state { padding: 18px; opacity:.8; }

/* ========================= 
   Notifications (list page)
   ========================= */

.notif-row{
  display:flex;
  gap: 12px;
  align-items:flex-start;
  justify-content:space-between;

  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 10px;

  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.65);
}

.notif-row.unread{
  border: 1px solid rgba(0,0,0,.14);
  box-shadow: 0 2px 0 rgba(0,0,0,.06);
  background: rgba(255,255,255,.95);
}

.notif-title{
  display:flex;
  align-items:center;
  gap: 8px;
}

.badge.badge-new{
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.14);
  background: rgba(0,0,0,.06);
}

.notif-text{
  margin-top: 6px;
  opacity: .95;
}

.notif-meta{
  margin-top: 8px;
  font-size: 12px;
  opacity: .75;
}

.notif-side{
  flex: 0 0 auto;
}
.page-wrap{
  max-width: 1100px;   /* velg samme som dashboard hvis du har en */
  margin: 0 auto;
  padding: 18px 18px;
}
/* TEST-CSS-2026-02-09-1 */ 
/* =========================================================
   START: Ny portal-layout (Del 10)
   ========================================================= */

:root {
    --portal-bg: #f3f6fb;
    --portal-surface: #ffffff;
    --portal-border: #d9e2ec;
    --portal-text: #1f2937;
    --portal-muted: #6b7280;
    --portal-sidebar: #44556b;
    --portal-sidebar-hover: #52657d;
    --portal-sidebar-text: #f8fafc;
    --portal-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --portal-sidebar-width: 260px;
    --portal-topbar-height: 76px;
    /* Standard spacing between larger standalone cards / card sections. */
    --portal-card-gap: 22px;
}

/* Hele siden */
body.portal-shell {
    margin: 0;
    background: var(--portal-bg);
    color: var(--portal-text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Hovedoppsett */
.portal-layout {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
}

/* Sidebar */
.portal-sidebar {
    width: var(--portal-sidebar-width);
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--portal-sidebar);
    color: var(--portal-sidebar-text);
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-shadow: 2px 0 18px rgba(15, 23, 42, 0.10);
}

.portal-sidebar__brand {
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.portal-menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.10);
    color: #ffffff;
    cursor: pointer;
}

.portal-menu-toggle span {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.portal-brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    text-decoration: none;
}

.portal-brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.portal-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.portal-brand-text strong {
    font-size: 1rem;
    line-height: 1.2;
    color: #ffffff;
}

.portal-brand-text small {
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: 0.625rem;
    font-weight: 500;
    color: #d8dee7;
    line-height: 1.15;
}

.portal-sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.portal-nav__link {
    display: block;
    padding: 11px 14px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: background 0.2s ease, color 0.2s ease, transform 0.18s ease;
}

.portal-nav__link:hover {
    background: rgba(255, 255, 255, 0.10);
    color: #ffffff;
    transform: translateX(2px);
}
.portal-nav__link.is-active {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.10);
}

/* Innholdsområde til høyre for sidebar */
.portal-content-area {
    margin-left: var(--portal-sidebar-width);
    width: calc(100% - var(--portal-sidebar-width));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: var(--portal-topbar-height);
}

/* Toppbar */
.portal-topbar {
    height: var(--portal-topbar-height);
    position: fixed;
    top: 0;
    left: var(--portal-sidebar-width);
    width: calc(100% - var(--portal-sidebar-width));
    z-index: 50;
    background: rgba(243, 246, 251, 0.96);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--portal-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.portal-topbar__left,
.portal-topbar__right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.portal-topbar__page-title {
    color: #334155;
    font-size: 0.95rem;
    font-weight: 600;
}

/* Hovedinnhold */
.portal-main {
    padding: 32px 28px;
    width: 100%;
    max-width: 1400px;
}

/* Toppbar-handlinger */
.portal-admin-link,
.logout-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid var(--portal-border);
    color: var(--portal-text);
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.18s ease;
}

.portal-logout-form {
    margin: 0;
}

.portal-logout-form .logout-link {
    cursor: pointer;
}

.portal-admin-link {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
    font-weight: 700;
}

.portal-user-view-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid var(--portal-border);
    color: #334155;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.portal-user-view-link:hover {
    text-decoration: none;
    background: #f8fafc;
    border-color: #cfd9e4;
    transform: translateY(-1px);
}

.portal-admin-link:hover {
    text-decoration: none;
    background: #dbeafe;
    border-color: #93c5fd;
    transform: translateY(-1px);
}

.logout-link:hover {
    text-decoration: none;
    background: #f8fafc;
    border-color: #cfd9e4;
    transform: translateY(-1px);
}

.portal-user-menu {
    position: relative;
}

.portal-user-menu[open] .portal-user-menu__button {
    background: #f8fafc;
    border-color: #cfd9e4;
}

.portal-user-menu__button {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 0 12px 0 10px;
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    cursor: pointer;
    font-weight: 700;
    list-style: none;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.18s ease;
}

.portal-user-menu__button::-webkit-details-marker {
    display: none;
}

.portal-user-menu__button:hover {
    background: #f8fafc;
    border-color: #cfd9e4;
    transform: translateY(-1px);
}

.portal-user-menu__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    flex-shrink: 0;
}

.portal-user-menu__avatar svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.portal-user-menu__name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-user-menu__chevron {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1;
}

.portal-user-menu__dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 80;
    width: 250px;
    overflow: hidden;
    border: 1px solid var(--portal-border);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}

.portal-user-menu__header {
    display: grid;
    gap: 3px;
    padding: 14px 16px;
    border-bottom: 1px solid #eef2f7;
    background: #f8fafc;
}

.portal-user-menu__header strong {
    color: #0f172a;
    font-size: 0.94rem;
}

.portal-user-menu__header span {
    color: #64748b;
    font-size: 0.82rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-user-menu__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: 0;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 650;
    text-align: left;
    text-decoration: none;
}

.portal-user-menu__item:hover {
    background: #f8fafc;
    text-decoration: none;
}

.portal-user-menu__item small {
    color: #94a3b8;
    font-size: 0.76rem;
    font-weight: 700;
}

.portal-user-menu__item.is-disabled {
    color: #94a3b8;
    cursor: default;
}

.portal-user-menu__logout-form {
    margin: 0;
    border-top: 1px solid #eef2f7;
}

.portal-user-menu__logout {
    cursor: pointer;
}

.portal-user-menu__about {
    cursor: pointer;
}

.portal-modal-is-open {
    overflow: hidden;
}

.portal-about-modal[hidden] {
    display: none;
}

.portal-about-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: grid;
    place-items: center;
    padding: 32px;
    overflow-y: auto;
}

.portal-about-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(3px);
}

.portal-about-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    max-height: min(820px, calc(100vh - 64px));
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.36);
    display: flex;
    flex-direction: column;
}

.portal-about-modal__hero {
    min-height: 210px;
    padding: 34px 38px;
    display: flex;
    align-items: center;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(68, 85, 107, 0.72)),
        radial-gradient(circle at 18% 30%, rgba(226, 232, 240, 0.24), transparent 32%),
        linear-gradient(135deg, #111827, #334155);
    color: #ffffff;
}

.portal-about-modal__brand {
    display: flex;
    align-items: center;
    gap: 18px;
}

.portal-about-modal__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
    color: #ffffff;
    font-size: 1.35rem;
    font-weight: 850;
    letter-spacing: 0.02em;
}

.portal-about-modal__brand h2 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1;
    letter-spacing: 0;
}

.portal-about-modal__brand p {
    max-width: 480px;
    margin: 10px 0 0;
    color: #dbe4ef;
    font-size: 0.98rem;
    line-height: 1.55;
}

.portal-about-modal__body {
    display: grid;
    gap: 22px;
    padding: 28px 34px 24px;
    background: #f8fafc;
    overflow-y: auto;
}

.portal-about-modal__section {
    display: grid;
    gap: 12px;
}

.portal-about-modal__section h3 {
    margin: 0;
    color: #0f172a;
    font-size: 1rem;
}

.portal-about-modal__section p {
    margin: 0;
    color: #475569;
    font-size: 0.94rem;
    line-height: 1.65;
}

.portal-about-modal__meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.portal-about-modal__meta div {
    padding: 12px;
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    background: #ffffff;
}

.portal-about-modal__meta dt {
    margin: 0 0 4px;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.portal-about-modal__meta dd {
    margin: 0;
    color: #0f172a;
    font-size: 0.92rem;
    font-weight: 750;
    line-height: 1.35;
}

.portal-about-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 24px 20px 34px;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
}

.portal-about-modal__footer span {
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 650;
}

.portal-about-modal__close {
    min-height: 40px;
    padding: 0 18px;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    background: #44556b;
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.portal-about-modal__close:hover {
    background: #334155;
}

@media (max-width: 760px) {
    .portal-about-modal {
        align-items: start;
        padding: 10px;
    }

    .portal-about-modal__dialog {
        max-height: calc(100vh - 20px);
        border-radius: 14px;
    }

    .portal-about-modal__hero {
        min-height: 0;
        padding: 22px 20px;
    }

    .portal-about-modal__brand {
        align-items: flex-start;
        flex-direction: column;
    }

    .portal-about-modal__body {
        gap: 18px;
        padding: 20px;
    }

    .portal-about-modal__meta {
        grid-template-columns: 1fr;
    }

    .portal-about-modal__footer {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
        padding: 14px 20px 18px;
    }
}

@media (max-width: 420px) {
    .portal-about-modal__mark {
        width: 54px;
        height: 54px;
        border-radius: 14px;
        font-size: 1rem;
    }

    .portal-about-modal__brand h2 {
        font-size: 2rem;
    }

    .portal-about-modal__brand p,
    .portal-about-modal__section p {
        font-size: 0.9rem;
    }
}

/* Varselknapp */
.portal-notifications {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.icon-btn.bell-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--portal-border);
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    padding: 0;
    color: inherit;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.18s ease;
}
.icon-btn.bell-btn:hover {
    background: #f8fafc;
    border-color: #cfd9e4;
    transform: translateY(-1px);
    text-decoration: none;
}
.portal-bell-dot {
    position: absolute;
    top: 9px;
    right: 9px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #dc2626;
    box-shadow: 0 0 0 2px #ffffff;
}

.icon-btn.bell-btn .icon {
    width: 20px;
    height: 20px;
    stroke: #334155;
    fill: none;
    stroke-width: 1.8;
}

.bell-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #dc2626;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Dropdown varsler */
.notif-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 320px;
    background: #ffffff;
    border: 1px solid var(--portal-border);
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}

.notif-head {
    padding: 14px 16px;
    font-weight: 700;
    border-bottom: 1px solid #eef2f7;
    background: #f8fafc;
    color: var(--portal-text);
}

.notif-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.notif-item {
    border-bottom: 1px solid #eef2f7;
}

.notif-link {
    display: block;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--portal-text);
}

.notif-link strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.notif-link span {
    display: block;
    font-size: 0.9rem;
    color: var(--portal-muted);
}

.notif-item.is-unread {
    background: #f8fbff;
}

.notif-empty {
    padding: 18px 16px;
    color: var(--portal-muted);
}

.notif-footer {
    padding: 14px 16px;
    background: #fafcff;
}

.notif-all-link {
    color: #334155;
    font-weight: 600;
    text-decoration: none;
}

/* Enkle innholdskort som vi skal bruke videre */
.portal-card {
    background: var(--portal-surface);
    border: 1px solid rgba(217, 226, 236, 0.9);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
    padding: 22px;
}

/* Mobiltilpasning */
@media (max-width: 900px) {
    :root {
        --portal-sidebar-width: 220px;
        --portal-topbar-height: 72px;
    }

    .portal-sidebar {
        padding: 20px 14px;
    }

    .portal-topbar {
        padding: 0 16px;
    }

    .portal-main {
        padding: 22px 16px;
    }

    .portal-quickgrid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .portal-home-grid {
        grid-template-columns: 1fr;
    }

    .portal-card {
        padding: 20px;
    }

    .portal-brand-text small {
        display: none;
    }
}
@media (max-width: 680px) {
    :root {
        --portal-sidebar-width: 88px;
    }

    .portal-sidebar {
        padding: 18px 10px;
    }

    .portal-brand-text {
        display: none;
    }

    .portal-brand-link {
        justify-content: center;
    }

    .portal-sidebar__nav {
        gap: 10px;
    }

    .portal-nav__link {
        text-align: center;
        padding: 12px 8px;
        font-size: 0.82rem;
    }

    .portal-topbar {
        height: auto;
        min-height: 72px;
        padding: 12px 14px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .portal-topbar__left,
    .portal-topbar__right {
        width: 100%;
        justify-content: space-between;
    }

    .portal-main {
        padding: 18px 14px;
    }

    .portal-page-title {
        font-size: 1.6rem;
    }

    .portal-quickgrid {
        grid-template-columns: 1fr;
    }

    .portal-card {
        padding: 18px;
        border-radius: 18px;
    }

    .admin-followup-row,
    .admin-event-row {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 480px) {
    :root {
        --portal-sidebar-width: 74px;
    }

    .portal-sidebar {
        padding: 16px 8px;
    }

    .portal-brand-mark {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        font-size: 0.82rem;
    }

    .portal-nav__link {
        padding: 10px 6px;
        font-size: 0.74rem;
    }

    .portal-page-title {
        font-size: 1.4rem;
    }

    .portal-topbar__page-title {
        font-size: 0.92rem;
    }

    .portal-admin-link,
    .logout-link,
    .portal-user-menu__button {
        min-height: 38px;
        padding: 0 12px;
        font-size: 0.85rem;
    }

    .icon-btn.bell-btn {
        width: 38px;
        height: 38px;
    }

    .portal-card {
        padding: 16px;
        border-radius: 16px;
    }
}

@media (max-width: 760px) {
    .portal-layout {
        display: block;
    }

    :root {
        --portal-sidebar-width: 100%;
        --portal-topbar-height: 0px;
    }

    .portal-sidebar {
        position: relative;
        width: 100%;
        min-height: auto;
        box-shadow: none;
        gap: 0;
    }

    .portal-sidebar__brand {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding-bottom: 0;
        border-bottom: 0;
    }

    .portal-brand-text {
        display: flex;
    }

    .portal-brand-text small {
        display: none;
    }

    .portal-brand-link {
        justify-content: flex-start;
    }

    .portal-menu-toggle {
        display: inline-flex;
    }

    .portal-sidebar__nav {
        display: none;
        margin-top: 14px;
        padding-top: 14px;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
    }

    .portal-sidebar.is-menu-open .portal-sidebar__nav {
        display: grid;
    }

    .portal-nav__link {
        text-align: left;
        padding: 12px 14px;
        font-size: 0.9rem;
    }

    .portal-content-area {
        margin-left: 0;
        width: 100%;
        padding-top: 0;
    }

    .portal-topbar {
        position: relative;
        left: auto;
        width: auto;
        height: auto;
        padding: 16px 18px;
        flex-wrap: wrap;
    }

    .notif-dropdown {
        width: 100%;
        right: auto;
        left: 0;
    }
}

/* =========================================================
   END: Ny portal-layout (Del 10)
   ========================================================= */
/* =========================================================
   START: Portal home (Del 10.3)
   ========================================================= */

.portal-page-intro {
    margin-bottom: 24px;
}

.portal-page-title {
    margin: 0 0 10px;
    font-size: 2rem;
    line-height: 1.2;
    color: var(--portal-text);
}

.portal-page-text {
    margin: 0;
    color: var(--portal-muted);
    font-size: 1rem;
    line-height: 1.6;
}

.portal-section {
    margin-bottom: 28px;
}

.portal-section-header {
    margin-bottom: 16px;
}

.portal-section-header h2 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--portal-text);
    letter-spacing: -0.01em;
}

.portal-quickgrid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--portal-card-gap);
}

.portal-quick-section__header {
    padding-left: 28px;
}

.portal-quick-section__header h2 {
    color: #475569;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.portal-quickcard {
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.portal-quickcard:hover {
    transform: translateY(-2px);
}

.home-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.1fr) minmax(280px, 0.95fr);
    gap: var(--portal-card-gap);
    align-items: stretch;
}

.home-status-card,
.home-power-card,
.home-activity-card {
    min-height: 260px;
}

.home-status-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    border-top: 4px solid #64748b;
}

.home-status-card--legacy {
    display: none;
}

.home-status-card--danger {
    border-top-color: #ef4444;
    background: #fff7f7;
}

.home-status-card--warning {
    border-top-color: #f59e0b;
    background: #fffbeb;
}

.home-status-card--success {
    border-top-color: #22c55e;
    background: #f7fef9;
}

.home-status-card h2,
.home-power-card h2,
.home-activity-card h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.home-status-card p {
    margin: 10px 0 18px;
    color: #64748b;
    font-size: 0.96rem;
    line-height: 1.55;
}

.home-alert-list {
    display: grid;
    gap: 10px;
    width: 100%;
}

.home-alert-item {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) max-content;
    align-items: center;
    gap: 9px;
    min-height: 62px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    color: inherit;
    text-decoration: none;
}

.home-alert-item:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    text-decoration: none;
}

.home-alert-marker {
    width: 8px;
    height: 34px;
    border-radius: 999px;
    background: #64748b;
}

.home-alert-item--danger .home-alert-marker {
    background: #ef4444;
}

.home-alert-item--warning .home-alert-marker {
    background: #f59e0b;
}

.home-alert-item strong,
.home-alert-empty strong {
    display: block;
    max-width: 100%;
    overflow: hidden;
    color: #0f172a;
    font-size: 0.94rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-alert-item small,
.home-alert-empty small {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1.35;
}

.home-dashboard-grid .home-alert-item > span:nth-child(2) {
    min-width: 0;
}

@media (min-width: 521px) {
    .home-dashboard-grid .home-alert-item small {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

.home-item-tenant {
    display: inline-block;
    max-width: 92px;
    overflow: hidden;
    color: #334155;
    font-weight: 850;
    text-overflow: ellipsis;
    vertical-align: bottom;
    white-space: nowrap;
}

.home-item-tenant::after {
    content: " ·";
    color: #94a3b8;
    font-weight: 800;
}

.home-alert-item em {
    color: #475569;
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 800;
    white-space: nowrap;
}

.home-alert-empty {
    display: grid;
    min-height: 150px;
    align-content: center;
    gap: 4px;
    width: 100%;
    padding: 18px;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    background: #f8fafc;
}

.portal-primary-link,
.home-card-link,
.portal-quick-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: #ffffff;
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 750;
    text-decoration: none;
}

.portal-primary-link:hover,
.home-card-link:hover,
.portal-quick-actions a:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    text-decoration: none;
}

.home-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
    width: 100%;
}

.home-card-link {
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.84rem;
    flex-shrink: 0;
}

.home-power-filter-form {
    display: grid;
    gap: 6px;
    min-width: min(190px, 100%);
}

.home-power-filter-form label {
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.home-power-filter-form select {
    min-height: 36px;
    width: 100%;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    padding: 0 34px 0 10px;
}

.home-power-visual {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(38px, 1fr));
    align-items: end;
    gap: 12px;
    height: 112px;
    padding: 16px 18px 10px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background:
        linear-gradient(to top, rgba(148, 163, 184, 0.18) 1px, transparent 1px) 0 16px / 100% 24px,
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    overflow: hidden;
}

.home-power-visual::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 31px;
    height: 1px;
    background: #94a3b8;
    opacity: 0.34;
}

.home-power-bar {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: end;
    justify-items: center;
    gap: 8px;
    height: 100%;
    min-width: 0;
}

.home-power-bar span {
    display: block;
    width: min(100%, 34px);
    min-height: 8px;
    border-radius: 4px 4px 0 0;
    border: 1px solid rgba(51, 65, 85, 0.18);
    border-bottom: 0;
    background: linear-gradient(180deg, #334155 0%, #64748b 100%);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

.home-power-bar small {
    color: #475569;
    font-size: 0.72rem;
    font-weight: 750;
    text-align: center;
    text-transform: capitalize;
}

.home-metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.home-metric-grid div {
    min-height: 76px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
}

.home-metric-grid span,
.home-activity-item small {
    display: block;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 650;
}

.home-metric-grid strong {
    display: block;
    margin-top: 6px;
    color: #0f172a;
    font-size: 0.98rem;
}

.home-power-note {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}

.home-power-note span {
    display: grid;
    gap: 2px;
    min-width: 0;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 750;
}

.home-power-note strong {
    color: #0f172a;
    font-size: 0.88rem;
}

.home-power-note a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 11px;
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    background: #ffffff;
    color: #0f172a;
    font-size: 0.78rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.home-power-note a:hover {
    border-color: #cbd5e1;
    background: #ffffff;
    text-decoration: none;
}

.home-empty-state {
    display: grid;
    gap: 8px;
    min-height: 150px;
    align-content: center;
    padding: 18px;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    background: #f8fafc;
}

.home-empty-state strong {
    color: #0f172a;
}

.home-empty-state p {
    margin: 0;
    color: #64748b;
    line-height: 1.5;
}

.home-mini-grid {
    align-items: stretch;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.home-mini-card {
    min-height: 138px;
    display: grid;
    align-items: center;
    border-top: 4px solid #64748b;
    color: inherit;
    text-decoration: none;
}

.home-mini-card--wifi {
    overflow: hidden;
    padding: 16px;
}

.home-mini-card:hover {
    border-color: #d7e0ec;
    border-top-color: #52657d;
    transform: translateY(-1px);
    text-decoration: none;
}

.home-mini-card--danger {
    border-color: #fecaca;
    border-top-color: #ef4444;
    background: #fff7f7;
}

.home-mini-card--danger .portal-eyebrow {
    background: #fee2e2;
    color: #b91c1c;
}

.home-mini-card--danger strong,
.home-mini-card--danger small {
    color: #991b1b;
}

.home-mini-card--warning {
    border-top-color: #f59e0b;
    background: #fffbeb;
}

.home-mini-card--success {
    border-top-color: #22c55e;
    background: #f7fef9;
}

.home-mini-card--placeholder {
    border-style: dashed;
    border-top-style: solid;
    border-top-color: #94a3b8;
    background:
        linear-gradient(135deg, rgba(248, 250, 252, 0.94), rgba(241, 245, 249, 0.9)),
        #ffffff;
}

.home-mini-card--placeholder .portal-eyebrow {
    background: #eef3f8;
    color: #64748b;
}

.home-mini-card--custom.home-mini-card--has-image:not(.home-mini-card--news-style):not(.home-mini-card--placeholder) {
    align-items: stretch;
    grid-template-rows: 92px minmax(0, 1fr);
    gap: 0;
    overflow: hidden;
    padding: 0;
}

.home-mini-card--custom.home-mini-card--has-image:not(.home-mini-card--news-style):not(.home-mini-card--placeholder) .home-mini-card__media {
    align-self: stretch;
    min-height: 0;
    width: 100%;
    place-items: stretch;
}

.home-mini-card--custom.home-mini-card--has-image:not(.home-mini-card--news-style):not(.home-mini-card--placeholder) .home-mini-card__media img {
    width: 100%;
    height: 92px;
    border: 0;
    border-radius: 0;
}

.home-mini-card--custom.home-mini-card--has-image:not(.home-mini-card--news-style):not(.home-mini-card--placeholder) .home-mini-card__content {
    align-content: start;
    padding: 14px 24px 22px;
}

.home-mini-card--news-style {
    min-height: 138px;
    overflow: hidden;
    padding: 0;
    border-top: 0;
}

.home-mini-card--news-style .home-mini-card__body,
.home-mini-card--news-style.home-mini-card--custom {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 0;
    height: 100%;
    min-height: 138px;
    padding: 0;
}

.home-mini-card--news-style .home-mini-card__media {
    align-self: stretch;
    min-height: 100%;
    padding: 0;
    background: #eef3f8;
    border-right: 1px solid #e2e8f0;
}

.home-mini-card--news-style:not(.home-mini-card--wifi) .home-mini-card__media img {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
}

.home-mini-card--news-style .home-mini-card__placeholder-mark {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
}

.home-mini-card--news-style .home-mini-card__content {
    align-content: center;
    gap: 7px;
    padding: 18px 20px;
}

.home-mini-card--news-style .home-mini-card__topline {
    justify-content: flex-start;
}

.home-mini-card--news-style .portal-eyebrow {
    justify-self: start;
    width: fit-content;
}

.home-mini-card.home-mini-card--news-style strong {
    font-size: 1.03rem;
    line-height: 1.14;
}

.home-mini-card.home-mini-card--news-style small {
    max-width: 28ch;
}

.home-mini-card--news-style.home-mini-card--wifi {
    padding: 0;
}

.home-mini-card--news-style.home-mini-card--wifi .home-mini-card__media {
    padding: 16px;
    background: #f8fafc;
}

.home-mini-card--news-style.home-mini-card--wifi .home-mini-card__media img,
.home-mini-card--news-style.home-mini-card--wifi .home-wifi-placeholder {
    width: 80px;
    height: 80px;
}

.home-mini-card--news-style.home-mini-card--wifi .home-mini-card__content strong {
    font-size: 0.83rem;
}

.home-mini-card strong {
    color: #0f172a;
    font-size: 1.15rem;
    line-height: 1.1;
}

.home-mini-card small {
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 650;
    line-height: 1.35;
}

.home-mini-card em {
    color: #334155;
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 850;
    margin-top: 2px;
}

.home-mini-card__media {
    align-self: stretch;
    display: grid;
    min-width: 0;
    place-items: center;
}

.home-mini-card__media img {
    width: 92px;
    height: 92px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #ffffff;
    object-fit: cover;
}

.home-mini-card__body {
    display: grid;
    align-items: center;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 14px;
    height: 100%;
    width: 100%;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.home-mini-card__content {
    align-content: center;
    display: grid;
    gap: 5px;
    min-width: 0;
}

.home-mini-card__topline {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
    min-width: 0;
}

.home-mini-card__placeholder-mark {
    align-items: center;
    align-self: stretch;
    background: #eef3f8;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: #64748b;
    display: flex;
    font-size: 0.82rem;
    font-weight: 900;
    height: 92px;
    justify-content: center;
    text-transform: uppercase;
    width: 92px;
}

.home-mini-card--wifi strong {
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
}

.home-wifi-toggle {
    display: inline-flex;
    padding: 3px;
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    background: #f8fafc;
}

.home-wifi-toggle button {
    min-height: 28px;
    padding: 0 9px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #64748b;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 850;
    cursor: pointer;
}

.home-wifi-toggle button.is-active {
    background: #44556b;
    color: #ffffff;
}

.home-wifi-panel {
    display: none;
}

.home-wifi-panel.is-active {
    display: grid;
}

.home-mini-card--wifi .home-mini-card__content small {
    font-size: 0.76rem;
    line-height: 1.15;
}

.home-mini-card--wifi .home-mini-card__content strong {
    display: block;
    font-size: 0.78rem;
    line-height: 1.1;
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
}

.home-wifi-placeholder {
    width: 92px;
    height: 92px;
    display: grid;
    place-items: center;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 900;
}

.home-activity-list {
    display: grid;
    gap: 10px;
}

.home-activity-item {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    color: inherit;
    text-decoration: none;
}

.home-activity-item:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    text-decoration: none;
}

.home-activity-dot {
    width: 10px;
    height: 10px;
    margin-top: 4px;
    border-radius: 999px;
    background: #64748b;
}

.home-activity-item--danger .home-activity-dot {
    background: #ef4444;
}

.home-activity-item--warning .home-activity-dot,
.home-activity-item--attention .home-activity-dot {
    background: #f59e0b;
}

.home-activity-item--success .home-activity-dot {
    background: #22c55e;
}

.home-activity-item strong {
    display: block;
    color: #0f172a;
    font-size: 0.92rem;
}

.home-activity-title-row,
.activity-timeline-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.home-activity-title-row time,
.activity-timeline-title-row time {
    flex: 0 0 auto;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.3;
    white-space: nowrap;
}

.home-activity-item small {
    margin-top: 3px;
    line-height: 1.4;
}

.activity-page-card {
    max-width: 860px;
}

.reminders-page-card {
    max-width: 960px;
}

.portal-list-layout {
    align-items: start;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 0.8fr);
    gap: 24px;
}

.portal-list-layout > .portal-card {
    max-width: none;
}

.portal-list-sidebar {
    display: grid;
    gap: 12px;
}

.portal-list-side-card {
    display: grid;
    gap: 8px;
    min-height: 96px;
}

.portal-list-side-card--attention {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.portal-list-side-card strong {
    color: #0f172a;
    font-size: 1.35rem;
    line-height: 1;
}

.portal-list-side-card small {
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 650;
}

.portal-list-side-card--links a {
    align-items: center;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    color: #0f172a;
    display: flex;
    font-size: 0.86rem;
    font-weight: 850;
    justify-content: space-between;
    min-height: 38px;
    padding: 0 12px;
    text-decoration: none;
}

.portal-list-side-card--links a:hover {
    background: #f8fafc;
    text-decoration: none;
}

.reminders-page-list .home-alert-item {
    min-height: 72px;
    padding: 14px 16px;
}

.reminders-page-list .home-alert-item strong {
    white-space: normal;
}

.reminders-page-list .home-item-tenant {
    max-width: 180px;
}

.activity-timeline {
    display: grid;
    gap: 10px;
}

.activity-timeline-item {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    color: inherit;
    text-decoration: none;
}

.activity-timeline-item:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    text-decoration: none;
}

.activity-timeline-dot {
    width: 10px;
    height: 10px;
    margin-top: 5px;
    border-radius: 999px;
    background: #64748b;
}

.activity-timeline-item--danger .activity-timeline-dot {
    background: #ef4444;
}

.activity-timeline-item--warning .activity-timeline-dot,
.activity-timeline-item--attention .activity-timeline-dot {
    background: #f59e0b;
}

.activity-timeline-item--success .activity-timeline-dot {
    background: #22c55e;
}

.activity-timeline-main strong {
    display: block;
    color: #0f172a;
    font-size: 0.98rem;
    line-height: 1.25;
}

.activity-timeline-main small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 0.84rem;
    font-weight: 650;
    line-height: 1.4;
}

.portal-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-left: 28px;
}

.admin-quickgrid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-home-grid {
    align-items: stretch;
}

.admin-hero-card .portal-page-title {
    margin-bottom: 8px;
}

.admin-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-filter-row {
    justify-content: flex-start;
    margin-bottom: 18px;
}

.admin-status-form h2,
.issue-reply-form h2 {
    margin: 0;
    color: var(--portal-text);
    font-size: 1.1rem;
}

.admin-document-toolbar {
    grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(150px, 190px)) auto auto;
}

.admin-documents-table__head,
.admin-document-row {
    grid-template-columns: minmax(260px, 1.4fr) 0.7fr 0.55fr 0.7fr auto;
}

.admin-inline-action {
    min-height: 34px;
    padding: 0 11px;
    font-size: 0.86rem;
}

.admin-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-inline-action--primary {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.admin-inline-action--primary:hover {
    background: #dbeafe;
    text-decoration: none;
}

.admin-product-toolbar {
    grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(150px, 190px)) auto auto;
}

.admin-product-list {
    gap: 12px;
}

.admin-product-row {
    grid-template-columns: 74px minmax(0, 1fr) auto;
}

.admin-product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.admin-product-actions {
    display: flex;
    align-items: center;
}

.admin-tenant-toolbar {
    grid-template-columns: minmax(220px, 1fr) minmax(150px, 220px) auto auto;
}

.admin-tenants-table__head,
.admin-tenant-row {
    grid-template-columns: minmax(260px, 1.3fr) 0.75fr 0.55fr 0.65fr auto;
}

.admin-muted-link {
    color: #475569;
    font-weight: 700;
    text-decoration: none;
}

.admin-muted-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.admin-billing-toolbar {
    grid-template-columns: minmax(220px, 1fr) minmax(170px, 230px) minmax(160px, 210px) auto auto;
}

.admin-billing-table__head,
.admin-billing-row {
    grid-template-columns: minmax(220px, 1.1fr) minmax(140px, 0.75fr) minmax(150px, 0.7fr) 0.5fr 0.55fr auto;
}

.issue-form ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}

.issue-form ul li label {
    display: flex;
    grid-template-columns: none;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.admin-reply-kind {
    margin: 0;
    padding: 0;
    border: 0;
    display: grid;
    gap: 10px;
}

.admin-reply-kind legend {
    margin-bottom: 2px;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 700;
}

.admin-reply-kind__option {
    display: grid !important;
    grid-template-columns: 16px minmax(0, 1fr);
    align-items: start !important;
    gap: 10px !important;
    padding: 10px 12px;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
}

.admin-reply-kind__option:has(input:checked) {
    border-color: #93c5fd;
    background: #eff6ff;
}

.admin-reply-kind__option input {
    width: 16px !important;
    height: 16px;
    min-height: 16px !important;
    margin: 2px 0 0;
}

.admin-reply-kind__option span {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.admin-reply-kind__option strong {
    color: #0f172a;
    font-size: 0.92rem;
}

.admin-reply-kind__option small {
    color: #64748b;
    font-size: 0.84rem;
    font-weight: 500;
}

.admin-followup-list,
.admin-event-list {
    display: grid;
    gap: 10px;
}

.admin-followup-row,
.admin-event-row {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #ffffff;
    color: inherit;
    text-decoration: none;
}

.admin-followup-row {
    grid-template-columns: minmax(0, 1fr) minmax(100px, auto);
    align-items: center;
}

.admin-event-row {
    grid-template-columns: 132px minmax(0, 1fr);
}

.admin-followup-row:hover,
.admin-event-row:hover {
    border-color: #bfdbfe;
    background: #f8fafc;
    text-decoration: none;
}

.admin-followup-row--danger {
    border-color: #fecaca;
    background: #fef2f2;
}

.admin-followup-row strong,
.admin-followup-row span,
.admin-event-row strong,
.admin-event-row span,
.admin-event-row small {
    display: block;
}

.admin-followup-row strong,
.admin-event-row strong {
    color: #0f172a;
    font-size: 0.94rem;
}

.admin-followup-row span,
.admin-event-row span,
.admin-event-row time,
.admin-event-row small {
    color: #64748b;
    font-size: 0.84rem;
}

.admin-event-row small {
    margin-top: 3px;
    color: #475569;
}

.admin-section-header-split {
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.admin-section-header-split h2 {
    margin-top: 4px;
}

.admin-event-row--compact {
    grid-template-columns: 112px minmax(0, 1fr);
}

.admin-followup-row--warning {
    border-color: #fde68a;
    background: #fffbeb;
}

.admin-followup-row mark {
    justify-self: end;
}

.admin-stats-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: #64748b;
    font-size: 0.86rem;
    font-weight: 700;
}

.admin-stats-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.admin-stats-legend__dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.admin-stats-legend__dot--views {
    background: #44556b;
}

.admin-stats-legend__dot--logins {
    background: #f59e0b;
}

.admin-usage-chart {
    display: grid;
    grid-template-columns: repeat(14, minmax(28px, 1fr));
    gap: 10px;
    align-items: end;
    min-height: 220px;
    padding: 18px 8px 4px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background:
        linear-gradient(to top, rgba(148, 163, 184, 0.18) 1px, transparent 1px) 0 0 / 100% 25%,
        #f8fafc;
}

.admin-usage-chart__day {
    display: grid;
    gap: 8px;
    align-items: end;
    min-width: 0;
}

.admin-usage-chart__bars {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 4px;
    height: 160px;
}

.admin-usage-chart__bar {
    width: 9px;
    min-height: 3px;
    border-radius: 999px 999px 2px 2px;
}

.admin-usage-chart__bar--views {
    background: linear-gradient(180deg, #64748b, #334155);
}

.admin-usage-chart__bar--logins {
    background: linear-gradient(180deg, #fbbf24, #d97706);
}

.admin-usage-chart__day small {
    overflow: hidden;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
}

.admin-stats-list {
    display: grid;
    gap: 12px;
}

.admin-stats-row {
    display: grid;
    gap: 9px;
    padding: 12px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #ffffff;
}

.admin-stats-row strong,
.admin-stats-row span,
.admin-stats-row small {
    display: block;
}

.admin-stats-row strong {
    color: #0f172a;
    font-size: 0.94rem;
}

.admin-stats-row span,
.admin-stats-row small {
    color: #64748b;
    font-size: 0.84rem;
}

.admin-stats-row small {
    margin-top: 3px;
}

.admin-stats-bar {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.admin-stats-bar span {
    display: block;
    height: 100%;
    min-width: 4px;
    border-radius: inherit;
    background: linear-gradient(90deg, #44556b, #93a4bb);
}

@media (max-width: 760px) {
    .admin-usage-chart {
        grid-template-columns: repeat(7, minmax(28px, 1fr));
    }
}

.portal-quickcard h3 {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.portal-quickcard p {
    margin: 0;
    color: var(--portal-muted);
    line-height: 1.6;
    font-size: 0.97rem;
}

.portal-home-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--portal-card-gap);
}

.portal-info-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.portal-info-item {
    padding: 15px 0;
    border-bottom: 1px solid #eef2f7;
}

.portal-info-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.portal-info-item strong {
    display: block;
    margin-bottom: 6px;
    font-size: 0.97rem;
    font-weight: 700;
    color: var(--portal-text);
    letter-spacing: -0.01em;
}

.portal-info-item p {
    margin: 0;
    color: var(--portal-muted);
    line-height: 1.6;
    font-size: 0.97rem;
}

.portal-connectivity-info {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.portal-connectivity-qr-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

.portal-connectivity-qr-list figure {
    margin: 0;
    display: grid;
    gap: 6px;
    justify-items: center;
}

.portal-connectivity-qr-list img {
    width: 128px;
    height: 128px;
    object-fit: contain;
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    background: #ffffff;
}

.portal-connectivity-qr-list figcaption {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 800;
}

.portal-network-row {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.portal-network-row p span {
    display: inline-flex;
    margin-right: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #edf2f7;
    color: #44556b;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.portal-password-field {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 360px;
}

.portal-password-field > span {
    color: var(--portal-muted);
    font-size: 0.88rem;
    font-weight: 750;
}

.portal-password-field input {
    min-width: 0;
    flex: 1;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
    font-weight: 700;
}

.portal-password-toggle {
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #ffffff;
    color: #44556b;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

@media (max-width: 1000px) {
    .home-dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }

    .home-mini-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-activity-card {
        grid-column: 1 / -1;
    }

    .portal-quickgrid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .home-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .portal-list-layout {
        grid-template-columns: 1fr;
    }

    .home-activity-card {
        grid-column: auto;
    }

    .home-mini-card--wifi {
        padding: 16px;
    }

    .home-mini-card__body {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 8px;
    }

    .home-mini-card__media img,
    .home-mini-card__placeholder-mark,
    .home-wifi-placeholder {
        width: 72px;
        height: 72px;
    }

    .home-mini-card--wifi .home-mini-card__content strong {
        font-size: 0.74rem;
    }
}

@media (min-width: 761px) and (max-width: 820px) {
    .home-mini-card__body {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .home-mini-card__media img,
    .home-mini-card__placeholder-mark,
    .home-wifi-placeholder {
        width: 64px;
        height: 64px;
    }
}

@media (max-width: 760px) {
    .portal-page-title {
        font-size: 1.6rem;
    }

    .portal-quickgrid,
    .portal-home-grid,
    .home-mini-grid,
    .home-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .home-activity-card {
        grid-column: auto;
    }

    .home-metric-grid {
        grid-template-columns: 1fr;
    }

    .home-card-header {
        flex-direction: column;
    }

    .home-power-filter-form {
        width: 100%;
    }

    .home-power-note {
        grid-template-columns: 1fr;
    }

    .home-power-note a {
        width: 100%;
    }

    .portal-quick-section__header,
    .portal-quick-actions {
        padding-left: 0;
    }
}

@media (max-width: 520px) {
    .home-alert-item {
        grid-template-columns: 8px minmax(0, 1fr);
        align-items: start;
    }

    .home-alert-item em {
        grid-column: 2;
        justify-self: start;
        white-space: normal;
    }

    .home-activity-title-row {
        flex-direction: column;
        gap: 4px;
    }

    .home-activity-title-row time {
        white-space: normal;
    }
}

/* =========================================================
   END: Portal home (Del 10.3)
   ========================================================= */
   /* =========================================================
   START: Login (Del 10.8)
   ========================================================= */

.portal-login-form {
    margin-top: 20px;
}

.portal-login-form p {
    margin-bottom: 16px;
}

.portal-login-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--portal-text);
}

.portal-login-form input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--portal-border);
    border-radius: 10px;
    font-size: 1rem;
    box-sizing: border-box;
    background: #ffffff;
}

.portal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: #44556b;
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.portal-btn:hover {
    opacity: 0.96;
}

/* =========================================================
   END: Login (Del 10.8)
   ========================================================= */
   /* =========================================================
   START: Auth layout (Del 10.15)
   ========================================================= */

.portal-auth-wrap {
    min-height: calc(100vh - 140px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.portal-auth-card {
    width: 100%;
    max-width: 520px;
    background: #ffffff;
    border: 1px solid rgba(217, 226, 236, 0.9);
    border-radius: 20px;
    box-shadow: var(--portal-shadow);
    padding: 0;
    overflow: hidden;
}

.portal-auth-brand {
    display: grid;
    gap: 12px;
    justify-items: center;
    padding: 34px 32px 30px;
    text-align: center;
    background:
        linear-gradient(135deg, rgba(68, 85, 107, 0.97), rgba(105, 118, 138, 0.95)),
        var(--portal-sidebar);
    color: #ffffff;
}

.portal-auth-kicker {
    color: rgba(248, 250, 252, 0.78);
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.portal-auth-brand-link {
    justify-content: center;
}

.portal-auth-brand p {
    max-width: 330px;
    margin: 0;
    color: rgba(248, 250, 252, 0.84);
    font-size: 1rem;
    line-height: 1.5;
}

.portal-auth-header {
    padding: 28px 28px 0;
    margin-bottom: 20px;
}

.portal-auth-card .portal-page-title {
    font-size: 1.65rem;
}

.portal-auth-card .portal-login-form {
    padding: 0 28px 28px;
}

.portal-auth-card .portal-form-alert {
    margin-left: 28px;
    margin-right: 28px;
}

.portal-form-row {
    margin-bottom: 16px;
}

.portal-form-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--portal-text);
}

.portal-form-row input {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--portal-border);
    border-radius: 10px;
    font-size: 1rem;
    color: var(--portal-text);
    background: #ffffff;
    box-sizing: border-box;
}

.portal-form-row input:focus {
    outline: none;
    border-color: #7c8ea3;
    box-shadow: 0 0 0 3px rgba(124, 142, 163, 0.12);
}

.portal-form-alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 0.95rem;
}

.portal-field-errors .errorlist,
.portal-form-help ul {
    margin: 8px 0 0;
    padding-left: 18px;
}

.portal-field-errors {
    color: #991b1b;
    font-size: 0.88rem;
    line-height: 1.45;
}

.portal-form-help {
    margin: -2px 0 18px;
    padding: 12px 14px;
    border: 1px solid #dbe3ec;
    border-radius: 12px;
    background: #f8fafc;
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.5;
}

.portal-btn-full {
    width: 100%;
}

@media (max-width: 760px) {
    .portal-auth-card {
        border-radius: 18px;
    }

    .portal-auth-brand {
        padding: 28px 20px 24px;
    }

    .portal-auth-brand .portal-brand-text {
        display: flex;
    }

    .portal-auth-brand .portal-brand-text small {
        display: block;
    }

    .portal-auth-header {
        padding: 24px 20px 0;
    }

    .portal-auth-card .portal-login-form {
        padding: 0 20px 22px;
    }

    .portal-auth-card .portal-form-alert {
        margin-left: 20px;
        margin-right: 20px;
    }
}

/* =========================================================
   END: Auth layout (Del 10.15)
   ========================================================= */
   /* =========================================================
   START: Home improvements (Del 10.16)
   ========================================================= */

.portal-hero-card {
    padding: 24px;
}

.portal-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.portal-hero__content {
    max-width: 760px;
    min-width: 0;
}

.portal-eyebrow {
    display: inline-block;
    margin-bottom: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef3f8;
    color: #44556b;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.portal-hero__meta {
    min-width: 220px;
    display: grid;
    gap: 12px;
}

.home-weather-card {
    box-sizing: border-box;
    display: grid;
    grid-template-rows: 16px 53px 23px 15px 15px;
    align-content: start;
    row-gap: 0;
    width: 256px;
    min-width: 256px;
    height: 153px;
    padding: 14px 18px;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(239, 246, 255, 0.9), rgba(248, 250, 252, 0.96)),
        #ffffff;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
}

.home-weather-card__label {
    display: block;
    margin: 0;
    color: #475569;
    font-size: 0.76rem;
    line-height: 16px;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.home-weather-card__main {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 42px;
}

.home-weather-card strong {
    display: block;
    color: #0f172a;
    font-size: 2.1rem;
    line-height: 42px;
}

.home-weather-icon {
    position: relative;
    width: 58px;
    height: 42px;
    flex: 0 0 auto;
}

.home-weather-icon__sun,
.home-weather-icon__cloud,
.home-weather-icon__rain,
.home-weather-icon__snow,
.home-weather-icon__fog {
    position: absolute;
    display: none;
}

.home-weather-icon__sun {
    inset: 6px auto auto 8px;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: #fbbf24;
    box-shadow:
        0 0 0 5px rgba(251, 191, 36, 0.22),
        0 0 18px rgba(251, 191, 36, 0.38);
}

.home-weather-icon__cloud {
    left: 14px;
    bottom: 9px;
    width: 36px;
    height: 18px;
    border-radius: 999px;
    background: #94a3b8;
    box-shadow: -12px 4px 0 -2px #cbd5e1, 9px 3px 0 -1px #64748b;
}

.home-weather-icon__cloud::before {
    content: "";
    position: absolute;
    left: 6px;
    top: -13px;
    width: 19px;
    height: 19px;
    border-radius: 999px;
    background: inherit;
}

.home-weather-icon__rain {
    left: 22px;
    bottom: 0;
    width: 5px;
    height: 12px;
    border-radius: 999px;
    background: #2563eb;
    box-shadow: 12px -2px 0 #2563eb, 24px -1px 0 #2563eb;
    transform: rotate(12deg);
}

.home-weather-icon__snow {
    left: 22px;
    bottom: 0;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #60a5fa;
    box-shadow: 13px -2px 0 #60a5fa, 26px -1px 0 #60a5fa;
}

.home-weather-icon__fog {
    left: 7px;
    right: 4px;
    bottom: 7px;
    height: 3px;
    border-radius: 999px;
    background: #94a3b8;
    box-shadow: 0 9px 0 #cbd5e1, 12px -9px 0 #cbd5e1;
}

.home-weather-icon--sun .home-weather-icon__sun,
.home-weather-icon--partly-cloudy .home-weather-icon__sun,
.home-weather-icon--partly-cloudy .home-weather-icon__cloud,
.home-weather-icon--cloud .home-weather-icon__cloud,
.home-weather-icon--rain .home-weather-icon__cloud,
.home-weather-icon--rain .home-weather-icon__rain,
.home-weather-icon--snow .home-weather-icon__cloud,
.home-weather-icon--snow .home-weather-icon__snow,
.home-weather-icon--sleet .home-weather-icon__cloud,
.home-weather-icon--sleet .home-weather-icon__rain,
.home-weather-icon--sleet .home-weather-icon__snow,
.home-weather-icon--fog .home-weather-icon__fog {
    display: block;
}

.home-weather-icon--partly-cloudy .home-weather-icon__cloud {
    left: 20px;
}

.home-weather-card small,
.home-weather-card__meta,
.home-weather-card em {
    display: block;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: #64748b;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-weather-card small {
    color: #334155;
    font-size: 0.82rem;
    line-height: 18px;
}

.home-weather-card__meta,
.home-weather-card em {
    font-size: 0.76rem;
    line-height: 15px;
}

.home-weather-card em {
    font-style: normal;
}

.portal-meta-card {
    padding: 14px 16px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e7edf4;
}

.portal-meta-card--link {
    display: block;
    text-decoration: none;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.portal-meta-card--link:hover {
    transform: translateY(-1px);
    border-color: #cbd5e1;
}

.portal-meta-card--attention {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.portal-meta-card--success {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.portal-meta-card--warning {
    background: #fffbeb;
    border-color: #fde68a;
}

.portal-meta-card--danger {
    background: #fef2f2;
    border-color: #fecaca;
}

.portal-meta-card__label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--portal-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.portal-meta-card__value {
    font-size: 1rem;
    color: var(--portal-text);
}

.portal-quickcard__label {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #66788a;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.portal-quickcard {
    min-height: 190px;
}

@media (max-width: 900px) {
    .portal-hero {
        flex-direction: column;
    }

    .portal-hero__meta {
        min-width: 0;
        width: 100%;
        grid-template-columns: 1fr 1fr;
    }

    .home-weather-card {
        width: 100%;
        min-width: 0;
        max-width: none;
    }
}

@media (max-width: 760px) {
    .portal-hero-card {
        padding: 20px;
    }

    .portal-hero__meta {
        grid-template-columns: 1fr;
    }

    .portal-quickcard {
        min-height: auto;
    }
}

/* =========================================================
   END: Home improvements (Del 10.16)
   ========================================================= */
   /* =========================================================
   START: Auth base layout (Del 10.17)
   ========================================================= */

.portal-auth-shell {
    background:
        radial-gradient(circle at top left, rgba(82, 101, 125, 0.10), transparent 32%),
        radial-gradient(circle at bottom right, rgba(68, 85, 107, 0.10), transparent 28%),
        var(--portal-bg);
}

.portal-auth-page {
    min-height: 100vh;
}

/* =========================================================
   END: Auth base layout (Del 10.17)
   ========================================================= */
   /* =========================================================
   START: Page header utility (Del 10.22)
   ========================================================= */

.portal-page-header {
    margin-bottom: 24px;
}

.portal-page-header .portal-card {
    position: relative;
    overflow: hidden;
}

.portal-page-header .portal-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, rgba(68, 85, 107, 0.95), rgba(124, 142, 163, 0.75));
}

.portal-page-header .portal-page-title {
    margin-top: 4px;
}

/* =========================================================
   END: Page header utility (Del 10.22)
   ========================================================= */
   /*.portal-card + .portal-card {
    margin-top: 22px;
}*/
.portal-section > .portal-card:last-child {
    margin-bottom: 0;
}
/* START: Power overview */
.portal-grid {
    display: grid;
    gap: var(--portal-card-gap);
}

.portal-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.card-header {
    margin-bottom: 16px;
}

.card-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.card-content p {
    margin-top: 0;
}

.card-muted {
    color: #6b7280;
    font-size: 0.95rem;
}

.price-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.simple-list {
    margin: 0;
    padding-left: 18px;
}

@media (max-width: 900px) {
    .portal-grid--2 {
        grid-template-columns: 1fr;
    }
}
/* END: Power overview */
/* START: Power dashboard layout */
.power-overview-stack {
    --power-section-gap: var(--portal-card-gap);
    display: grid;
    gap: var(--power-section-gap);
}

.power-overview-stack > * {
    margin: 0;
    min-width: 0;
}

.power-top-grid {
    --power-card-inner-gap: 16px;
    --power-chart-height: 241px;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.95fr);
    gap: var(--portal-card-gap);
    margin-bottom: 0;
    align-items: stretch;
}

.power-day-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--power-section-gap);
    flex-wrap: wrap;
    min-height: 42px;
}

.power-day-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid #dbe3ec;
    border-radius: 999px;
    background: #f8fafc;
}

.power-day-toggle-button {
    appearance: none;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1;
    min-width: 82px;
    padding: 9px 14px;
    transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.power-day-toggle-button.is-active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.power-day-toggle-button:disabled {
    color: #94a3b8;
    cursor: not-allowed;
}

.power-day-toolbar-note {
    margin: 0;
    color: #64748b;
    font-size: 0.84rem;
    line-height: 1.4;
}

.power-hero-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 100%;
    padding: 16px;
}

.power-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.power-hero-label {
    font-size: 0.92rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0;
}

.power-hero-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.05;
    color: #0f172a;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    display: inline-block;
    flex-shrink: 0;
}

.status-badge-dot--down {
    background: #10b981;
}

.status-badge-dot--up {
    background: #f97316;
}

.status-badge-dot--flat {
    background: #64748b;
}

.status-badge--good {
    background: #ecfdf3;
    color: #047857;
}

.status-badge--warning {
    background: #fff7ed;
    color: #c2410c;
}

.status-badge--danger {
    background: #fef2f2;
    color: #b91c1c;
}

.status-badge--neutral {
    background: #f1f5f9;
    color: #475569;
}

.power-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.power-trend-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.power-trend-pill--down {
    background: #f0fdf4;
    color: #15803d;
}

.power-trend-pill--up {
    background: #fff7ed;
    color: #c2410c;
}

.power-trend-pill--flat {
    background: #f8fafc;
    color: #475569;
}

.power-hero-meta {
    margin: 0;
    font-size: 0.88rem;
    white-space: nowrap;
}

.power-stat-panel {
    padding: 16px;
    align-self: stretch;
    height: 100%;
}

.power-stat-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.power-stat-panel-header .card-muted {
    margin: 4px 0 0;
    font-size: 0.88rem;
}

.power-stat-toggle {
    display: none;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 750;
    line-height: 1;
    padding: 9px 13px;
    white-space: nowrap;
}

.power-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.power-stat-card {
    min-height: 126px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f8fafc;
}

.power-stat-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 6px;
    line-height: 1.3;
}

.power-stat-value {
    font-size: 1.02rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
    line-height: 1.2;
}

.power-usage-panel {
    margin-top: var(--power-card-inner-gap);
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.power-usage-header {
    margin-bottom: 12px;
}

.power-usage-title {
    margin: 0;
    color: #0f172a;
    font-size: 0.98rem;
    font-weight: 750;
    line-height: 1.25;
}

.power-usage-lead {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 0.84rem;
    line-height: 1.4;
}

.power-usage-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.power-usage-item {
    min-height: 118px;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
}

.power-usage-label {
    margin-bottom: 5px;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.25;
}

.power-usage-value {
    color: #0f172a;
    font-size: 0.96rem;
    font-weight: 750;
    line-height: 1.25;
    white-space: nowrap;
}

.power-usage-meta {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.4;
}

.portal-card--full {
    grid-column: 1 / -1;
}

@media (max-width: 1100px) {
    .power-top-grid {
        grid-template-columns: 1fr;
    }

    .power-stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .portal-card--full {
        grid-column: auto;
    }

    .power-tomorrow-stats,
    .power-usage-grid,
    .power-stat-grid {
        grid-template-columns: 1fr;
    }

    .power-provider-list {
        grid-template-columns: 1fr;
    }

    .power-header-layout {
        grid-template-columns: 1fr;
    }

    .power-header-side {
        justify-content: flex-start;
    }

    .power-header-providers {
        width: 100%;
    }

    .power-header-provider {
        width: 100%;
        justify-content: flex-start;
        border-radius: 14px;
    }
}
/* END: Power dashboard layout */
/* START: Power content details */
.power-detail-text {
    margin-top: 2px;
    margin-bottom: 0;
    font-size: 0.84rem;
    color: #64748b;
    line-height: 1.4;
    max-width: 58ch;
}

.power-chart-panel {
    margin-top: var(--power-card-inner-gap);
    padding: 8px 10px 6px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
}

.power-chart-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.power-chart-panel-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
}

.power-chart-panel-subtitle {
    font-size: 0.78rem;
    color: #64748b;
}

.power-chart-panel-subtitle::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 8px;
    border-radius: 999px;
    background: var(--portal-sidebar);
    opacity: 0.5;
    vertical-align: middle;
}

.power-hour-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.power-hour-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}

.power-hour-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.power-hour-time {
    font-weight: 600;
    color: #0f172a;
}

.power-hour-price {
    color: #475569;
    font-weight: 500;
}

.power-tomorrow-message {
    margin: 0;
    color: #475569;
    line-height: 1.6;
}

.power-alert-list {
    display: grid;
    gap: 16px;
}

.power-alert-item {
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f8fafc;
}

.power-alert-title {
    font-size: 0.98rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 6px;
}

.power-alert-text {
    margin: 0;
    color: #475569;
    line-height: 1.6;
}
/* END: Power content details */
/* START: Tomorrow card */
.power-tomorrow-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.power-tomorrow-stat {
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f8fafc;
}

.power-tomorrow-stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 6px;
    line-height: 1.3;
}

.power-tomorrow-stat-value {
    font-size: 0.98rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.power-tomorrow-stat-meta {
    margin-top: 4px;
    color: #64748b;
    font-size: 0.84rem;
    line-height: 1.35;
}
/* END: Tomorrow card */
/* START: Power chart */
.power-chart-wrap {
    margin-top: 0;
    height: var(--power-chart-height);
    min-height: var(--power-chart-height);
    max-height: var(--power-chart-height);
    padding-top: 0;
}

.power-chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}
/* END: Power chart */
.power-consumption-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.power-consumption-filter-form {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    min-width: 220px;
}

.power-consumption-filter-form label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.power-consumption-filter-form select {
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
    font: inherit;
}

.power-section-lead {
    margin: 6px 0 0;
    max-width: 70ch;
    color: #64748b;
    line-height: 1.55;
}

.power-consumption-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
    min-width: 0;
}

.power-consumption-summary--compact {
    gap: 12px;
    margin-bottom: 12px;
}

.power-consumption-summary--single {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 16px;
}

.power-consumption-stat {
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.power-consumption-stat--meter {
    background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
    border-color: #bfdbfe;
}

.power-consumption-stat-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 8px;
}

.power-consumption-stat-value {
    font-size: 1.18rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}

.power-consumption-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
    padding: 0 2px;
    min-width: 0;
}

.power-consumption-toolbar-copy {
    min-width: 0;
}

.power-consumption-toolbar-label {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
}

.power-consumption-toolbar-text {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.45;
}

.power-consumption-chart-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    padding: 14px 16px 16px;
    min-width: 0;
    overflow: hidden;
}

.power-consumption-chart-wrap {
    height: 250px;
    margin-top: 8px;
    min-width: 0;
}

.power-consumption-chart-wrap canvas {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
}

.power-secondary-grid .portal-card {
    padding: 20px;
}

.power-secondary-grid {
    gap: 16px;
}

.power-secondary-grid .portal-card .card-header {
    margin-bottom: 12px;
}

.power-secondary-grid .portal-card .card-title {
    font-size: 1rem;
}

.power-providers-card {
    padding: 18px 20px;
}

.power-providers-card .card-header {
    margin-bottom: 14px;
}

.power-providers-card .card-muted {
    margin: 4px 0 0;
    font-size: 0.88rem;
}

.power-header-card {
    padding: 20px 22px;
}

.power-header-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: start;
}

.power-header-main {
    min-width: 0;
}

.power-header-side {
    display: flex;
    justify-content: flex-end;
}

.power-header-providers {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 0;
    min-width: 280px;
}

.power-header-provider {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 72px;
    padding: 13px 16px;
    border: 1px solid #e7edf4;
    border-radius: 14px;
    background: #f8fafc;
    box-sizing: border-box;
}

.power-header-provider-logo-wrap {
    width: 58px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.power-header-provider-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.power-header-provider-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
}

.power-header-provider-name {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.power-header-provider-role {
    font-size: 0.82rem;
    font-weight: 700;
    color: #64748b;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    order: -1;
}

.power-provider-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.power-provider-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f8fafc;
}

.power-provider-logo-wrap {
    width: 58px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.power-provider-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.power-provider-content {
    min-width: 0;
}

.power-provider-name {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.power-provider-role {
    margin-top: 4px;
    font-size: 0.88rem;
    color: #64748b;
    line-height: 1.35;
}

@media (max-width: 900px) {
    .power-header-layout {
        grid-template-columns: 1fr;
    }

    .power-header-side {
        justify-content: flex-start;
    }

    .power-header-providers {
        width: 100%;
        min-width: 0;
    }

    .power-header-provider {
        width: 100%;
    }
}

.power-window-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 0;
    max-width: 100%;
    min-width: 0;
}

.power-window-chip {
    appearance: none;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #475569;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.power-window-chip:hover {
    border-color: #94a3b8;
    color: #0f172a;
}

.power-window-chip.is-active {
    background: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
}

.power-consumption-insight {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    min-width: 0;
}

.power-consumption-insight-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
}

.power-consumption-insight-pill--high {
    background: #f6efec;
    color: #8a5a52;
}

.power-consumption-insight-pill--low {
    background: #edf3f2;
    color: #3f6f73;
}

.power-consumption-year-totals {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
    min-width: 0;
}

.power-consumption-year-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 0.82rem;
}

.power-consumption-year-pill strong {
    color: #0f172a;
}

.power-consumption-empty {
    padding: 18px;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    background: #f8fafc;
}

.power-consumption-empty p {
    margin-bottom: 0;
    color: #475569;
    line-height: 1.6;
}

@media (max-width: 640px) {
    .power-day-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .power-day-toggle {
        width: 100%;
    }

    .power-day-toggle-button {
        flex: 1;
        min-width: 0;
    }

    .power-hero-top {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .power-hero-value {
        font-size: 2.1rem;
    }

    .power-chart-panel {
        margin-top: 10px;
        padding: 10px;
    }

    .power-chart-wrap {
        height: 140px;
        min-height: 140px;
        max-height: 140px;
        flex: 0 0 auto;
    }

    .power-chart-panel-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .power-stat-panel {
        padding: 14px 16px;
    }

    .power-stat-panel-header {
        align-items: center;
        margin-bottom: 0;
    }

    .power-stat-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .power-stat-collapsible {
        margin-top: 12px;
    }

    .power-stat-panel.is-mobile-collapsed .power-stat-collapsible {
        display: none;
    }
}

@media (max-width: 900px) {
    .power-consumption-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .power-consumption-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .power-consumption-chart-wrap {
        height: 270px;
    }
}

@media (max-width: 640px) {
    .power-consumption-summary {
        grid-template-columns: 1fr;
    }

    .power-consumption-header {
        gap: 12px;
    }

    .power-consumption-filter-form,
    .power-consumption-filter-form select {
        width: 100%;
        min-width: 0;
    }

    .power-consumption-toolbar {
        align-items: stretch;
        gap: 10px;
        margin-bottom: 10px;
        padding: 0;
    }

    .power-consumption-toolbar-text {
        font-size: 0.86rem;
    }

    .power-window-toggle {
        width: 100%;
        overflow-x: auto;
        border-radius: 14px;
    }

    .power-window-chip {
        flex: 1 0 auto;
    }

    .power-consumption-chart-card {
        padding: 12px;
        border-radius: 14px;
    }

    .power-consumption-chart-wrap {
        height: 220px;
        margin-top: 6px;
    }

    .power-consumption-insight,
    .power-consumption-year-totals {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .power-consumption-insight-pill,
    .power-consumption-year-pill {
        width: 100%;
        justify-content: flex-start;
        border-radius: 14px;
        white-space: normal;
    }
}

.tenant-preview-control {
    position: fixed;
    z-index: 1000;
    right: 18px;
    bottom: 18px;
    max-width: calc(100vw - 36px);
    color: #334155;
    font-size: 0.82rem;
}

.tenant-preview-control__panel {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid #b9c8da;
    border-radius: 8px;
    background: rgba(233, 241, 249, 0.97);
    box-shadow: 0 8px 24px rgba(51, 65, 85, 0.16);
    backdrop-filter: blur(8px);
}

.tenant-preview-control__text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 0 6px;
    line-height: 1.25;
}

.tenant-preview-control__text small {
    color: #64748b;
    font-size: 0.72rem;
}

.tenant-preview-control__toggle,
.tenant-preview-control__exit,
.tenant-preview-control__restore {
    padding: 6px 12px;
    border: 1px solid #9fb1c7;
    border-radius: 6px;
    background: #ffffff;
    color: #172a42;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.tenant-preview-control__restore {
    display: none;
    box-shadow: 0 8px 24px rgba(51, 65, 85, 0.16);
}

.tenant-preview-control.is-hidden .tenant-preview-control__panel {
    display: none;
}

.tenant-preview-control.is-hidden .tenant-preview-control__restore {
    display: inline-flex !important;
}

.portal-news-section {
    display: grid;
    gap: 16px;
}

.portal-news-list {
    display: grid;
    gap: 16px;
}

.portal-news-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    overflow: hidden;
    padding: 0;
}

.portal-news-card--has-image {
    grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
}

.portal-news-card--unread {
    border-color: #9fb5ce;
    box-shadow: 0 14px 34px rgba(51, 65, 85, 0.12);
}

.portal-news-card__image {
    width: 100%;
    height: 100%;
    min-height: 260px;
    object-fit: cover;
}

.portal-news-card__content {
    min-width: 0;
    padding: 28px;
}

.portal-news-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
}

.portal-news-card__meta span {
    padding: 3px 7px;
    border-radius: 999px;
    background: #e8f0f8;
    color: #334e6f;
}

.portal-news-card h2 {
    margin: 0 0 8px;
}

.portal-news-card__summary {
    margin: 0 0 16px;
    color: #334155;
    font-size: 1rem;
    font-weight: 700;
}

.portal-news-card__body {
    color: #475569;
    line-height: 1.65;
}

.portal-news-card__body p:first-child {
    margin-top: 0;
}

.portal-news-card__attachment {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
    padding: 14px 16px;
    border: 1px solid #d7e0eb;
    border-radius: 8px;
    background: #f6f9fc;
}

.portal-news-card__attachment span {
    display: grid;
    gap: 3px;
}

.portal-news-card__attachment small {
    color: #64748b;
}

.portal-news-card__attachment a,
.portal-news-card__link {
    color: #172a42;
    font-weight: 800;
    white-space: nowrap;
}

.portal-news-card__link {
    display: inline-flex;
    margin-top: 18px;
}

@media (max-width: 640px) {
    .tenant-preview-control {
        right: 10px;
        bottom: 10px;
        max-width: calc(100vw - 20px);
    }

    .tenant-preview-control__panel {
        flex-wrap: wrap;
    }

    .tenant-preview-control__text {
        width: 100%;
        padding: 2px 4px 5px;
    }

    .tenant-preview-control__toggle,
    .tenant-preview-control__exit {
        flex: 1;
        text-align: center;
    }

    .portal-news-card--has-image {
        grid-template-columns: minmax(0, 1fr);
    }

    .portal-news-card__image {
        min-height: 0;
        aspect-ratio: 16 / 9;
    }

    .portal-news-card__content {
        padding: 20px;
    }

    .portal-news-card__attachment {
        align-items: stretch;
        flex-direction: column;
    }
}
/* START: Power data source status */
.power-source-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.power-source-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: lowercase;
}

.power-source-pill--api {
    background: #ecfdf3;
    color: #047857;
}

.power-source-pill--demo {
    background: #fff7ed;
    color: #c2410c;
}

.power-source-pill--missing {
    background: #f8fafc;
    color: #475569;
}
/* END: Power data source status */
/* ---------------------------------------------------------
   Billing stats cards
--------------------------------------------------------- */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.stat-label {
    margin: 0 0 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-value {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: #111827;
}
/* ---------------------------------------------------------
   Billing detail page
--------------------------------------------------------- */

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.detail-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px;
}

.detail-label {
    margin: 0 0 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
}

.detail-value {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}
/* ---------- Billing table ---------- */

.billing-table th {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 14px 16px;
}

.billing-table td {
    font-size: 0.95rem;
    padding: 16px;
    vertical-align: middle;
}

.billing-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
}

.billing-table tbody tr:hover {
    background-color: #f9fafb;
}

.text-muted {
    color: #9ca3af;
    font-size: 0.9rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-pending {
    background-color: #fef3c7;
    color: #92400e;
}
/* ---------- Baseline row ---------- */

.baseline-row {
    background-color: #f8fafc;
}

.baseline-row:hover {
    background-color: #f1f5f9;
}

.baseline-period {
    font-weight: 600;
    color: #111827;
}

.baseline-subtext {
    margin-top: 4px;
    font-size: 0.82rem;
    color: #64748b;
}

.baseline-note {
    font-size: 0.88rem;
    color: #475569;
}

.table-empty {
    color: #94a3b8;
    font-size: 0.9rem;
    font-style: italic;
}

.status-baseline {
    background-color: #dbeafe;
    color: #1d4ed8;
}
/* ---------- Billing detail ---------- */

.billing-detail-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.billing-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.billing-detail-header h1 {
    margin: 0 0 6px;
    font-size: 1.6rem;
    font-weight: 700;
    color: #111827;
}

.billing-detail-subtitle {
    margin: 0;
    color: #6b7280;
    font-size: 0.95rem;
}

.billing-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.detail-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.detail-card h3 {
    margin: 0 0 16px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #111827;
}

.detail-card-wide {
    grid-column: 1 / -1;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row span {
    color: #6b7280;
}

.detail-row strong {
    color: #111827;
    text-align: right;
}

.detail-row-highlight {
    margin-top: 8px;
    padding-top: 16px;
    font-size: 1rem;
}

.detail-row-highlight strong {
    font-size: 1.05rem;
}

.detail-row-total {
    margin-top: 8px;
    padding-top: 16px;
    font-size: 1rem;
}

.detail-row-total strong {
    font-size: 1.1rem;
}

.detail-empty {
    color: #94a3b8;
    font-weight: 500;
}

.detail-muted {
    margin: 0 0 14px;
    color: #64748b;
    font-size: 0.94rem;
}

.detail-placeholder-box {
    padding: 14px 16px;
    border-radius: 12px;
    background: #f8fafc;
    color: #475569;
    border: 1px dashed #cbd5e1;
}

@media (max-width: 900px) {
    .billing-detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-card-wide {
        grid-column: auto;
    }

    .billing-detail-header {
        flex-direction: column;
    }
}
/* =========================================================
   FELLES SIDEINTRO / WRAPPER
========================================================= */

.page-content {
    max-width: 1100px;
}

.page-intro-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 24px 28px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
    margin-bottom: 24px;
}

.page-intro-text h1 {
    margin: 0 0 8px;
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
}

.page-intro-text p {
    margin: 0;
    color: #6b7280;
    font-size: 0.98rem;
}

.page-intro-actions {
    flex-shrink: 0;
}

.link-button {
    color: #7c3aed;
    text-decoration: underline;
    font-size: 0.95rem;
}

/* =========================================================
   BILLING DETAIL
========================================================= */

.billing-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.detail-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.detail-card h3 {
    margin: 0 0 16px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #111827;
}

.detail-card-wide {
    grid-column: 1 / -1;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row span {
    color: #6b7280;
}

.detail-row strong {
    color: #111827;
    text-align: right;
}

.detail-row-highlight {
    margin-top: 8px;
    padding-top: 16px;
    font-size: 1rem;
}

.detail-row-highlight strong {
    font-size: 1.05rem;
}

.detail-row-total {
    margin-top: 8px;
    padding-top: 16px;
    font-size: 1rem;
}

.detail-row-total strong {
    font-size: 1.1rem;
}

.detail-empty {
    color: #94a3b8;
    font-weight: 500;
}

.detail-muted {
    margin: 0 0 14px;
    color: #64748b;
    font-size: 0.94rem;
}

.detail-placeholder-box {
    padding: 14px 16px;
    border-radius: 12px;
    background: #f8fafc;
    color: #475569;
    border: 1px dashed #cbd5e1;
}

@media (max-width: 900px) {
    .page-intro-card {
        flex-direction: column;
    }

    .billing-detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-card-wide {
        grid-column: auto;
    }
}
/* ===== BILLING DETAIL ===== */

.billing-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row span {
    color: #6b7280;
}

.detail-row strong {
    color: #111827;
    text-align: right;
}

.detail-row-highlight {
    margin-top: 8px;
    padding-top: 16px;
    font-size: 1rem;
}

.detail-row-highlight strong {
    font-size: 1.05rem;
}

.detail-row-total {
    margin-top: 8px;
    padding-top: 16px;
    font-size: 1rem;
}

.detail-row-total strong {
    font-size: 1.1rem;
}

.detail-empty {
    color: #94a3b8;
    font-weight: 500;
}

.detail-muted {
    margin: 0 0 14px;
    color: #64748b;
    font-size: 0.94rem;
}

.detail-placeholder-box {
    padding: 14px 16px;
    border-radius: 12px;
    background: #f8fafc;
    color: #475569;
    border: 1px dashed #cbd5e1;
}

.portal-inline-link {
    display: inline-block;
    margin-top: 12px;
    font-size: 0.95rem;
    color: #7c3aed;
    text-decoration: underline;
}

@media (max-width: 900px) {
    .billing-detail-grid {
        grid-template-columns: 1fr;
    }
}
/* ===== BILLING STATUS ===== */

.detail-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    padding: 12px 0 2px;
}

.status-badge.status-missing_power {
    background-color: #fef3c7;
    color: #92400e;
}

.status-badge.status-missing_grid {
    background-color: #fde2e2;
    color: #b42318;
}

.status-badge.status-ready {
    background-color: #dcfce7;
    color: #166534;
}

.status-badge.status-sent {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.status-badge.status-overdue {
    background-color: #fee2e2;
    color: #b91c1c;
}

.status-badge.status-paid {
    background: rgba(34, 197, 94, 0.15);
    color: #047857;
}

.status-badge.status-partial {
    background-color: #fef3c7;
    color: #92400e;
}

.status-badge.status-overpaid {
    background-color: #dbeafe;
    color: #1d4ed8;
}
/* ===== BILLING DETAIL IMAGES ===== */

.detail-image-title {
    margin: 0 0 12px;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.detail-meter-image {
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}
.billing-section-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.billing-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.billing-summary-grid .label {
    display: block;
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.billing-image-preview {
    margin-bottom: 1rem;
}

.billing-image-preview img {
    width: 100%;
    max-width: 320px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.billing-files {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.billing-file-link {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    text-decoration: none;
    color: #111827;
    background: #f9fafb;
}

.billing-table {
    width: 100%;
    border-collapse: collapse;
}

.billing-table th,
.billing-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.billing-table thead th {
    background: #f9fafb;
    font-size: 0.9rem;
    color: #6b7280;
}

.billing-table tfoot th {
    background: #f3f4f6;
    font-size: 1rem;
}

.negative-value {
    color: #dc2626;
    font-weight: 600;
}

.billing-total-card {
    display: flex;
    flex-direction: column;
    justify-content: left;
}

.billing-grand-total {
    font-size: 2.25rem;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.02em;
}

.billing-explanation-list {
    margin: 0;
    padding-left: 1.25rem;
    color: #4b5563;
}

.billing-explanation-list li {
    margin-bottom: 0.5rem;
}
/* ===== BILLING REGNEGRUNNLAG ===== */

.billing-info-note {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: #475569;
    font-size: 0.94rem;
    line-height: 1.5;
}
/* ===== BILLING OVERVIEW ===== */

.billing-table {
    width: 100%;
    border-collapse: collapse;
}

.billing-table th,
.billing-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: middle;
}

.billing-table thead th {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6b7280;
    background: #f8fafc;
}

.billing-table tbody tr:hover {
    background: #fafafa;
}

.table-empty {
    color: #94a3b8;
    font-size: 0.9rem;
    font-style: italic;
}

.baseline-row {
    background: #f8fafc;
}

.baseline-row:hover {
    background: #f1f5f9 !important;
}

.baseline-period {
    font-weight: 600;
    color: #111827;
}

.baseline-subtext {
    margin-top: 4px;
    font-size: 0.82rem;
    color: #64748b;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
}

.status-missing_power {
    background: #fef3c7;
    color: #92400e;
}

.status-missing_grid {
    background: #fee2e2;
    color: #b91c1c;
}

.status-ready {
    background: #dcfce7;
    color: #166534;
}

.status-sent {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-paid {
    background: #ede9fe;
    color: #6d28d9;
}

.status-baseline {
    background: #e0f2fe;
    color: #075985;
}

.billing-table .btn {
    white-space: nowrap;
}
.billing-note-cell {
    max-width: 260px;
    color: #475569;
    font-size: 0.93rem;
}
.billing-total-value {
    font-size: 0.96rem;
    color: #111827;
}
/* ===== BILLING DETAIL LAYOUT ===== */

.billing-detail-grid,
.billing-section-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.billing-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 20px;
}

.billing-summary-grid .label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.billing-summary-grid strong {
    font-size: 0.98rem;
    color: #111827;
}
.billing-image-preview {
    margin-bottom: 16px;
}

.billing-image-preview a {
    display: inline-block;
}

.billing-image-preview img {
    display: block;
    width: 100%;
    max-width: 320px;
    max-height: 220px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.billing-files {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.billing-file-link {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f8fafc;
    color: #1f2937;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.billing-file-link:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
/* ===== BILLING DETAIL TABLES ===== */

.billing-table {
    width: 100%;
    border-collapse: collapse;
}

.billing-table th,
.billing-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: middle;
}

.billing-table thead th {
    background: #f8fafc;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.billing-table tbody tr:hover {
    background: #fafafa;
}

.billing-table tfoot th {
    background: #f8fafc;
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
}

.billing-table td:last-child,
.billing-table th:last-child {
    text-align: right;
}

.negative-value {
    color: #b91c1c;
    font-weight: 600;
}
.billing-total-card {
    display: flex;
    flex-direction: column;
    justify-content: left;
}

.billing-grand-total {
    margin-top: 10px;
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #111827;
}
.billing-explanation-list {
    margin: 0;
    padding-left: 18px;
    color: #475569;
}

.billing-explanation-list li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.billing-info-note {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: #475569;
    font-size: 0.94rem;
    line-height: 1.5;
}
@media (max-width: 900px) {
    .billing-detail-grid,
    .billing-section-grid,
    .billing-summary-grid {
        grid-template-columns: 1fr;
    }

    .billing-image-preview img {
        max-width: 100%;
    }

    .billing-table {
        font-size: 0.92rem;
    }
}
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #f8fafc;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.15s ease;
}

.back-button:hover {
    background: #eef2f7;
    border-color: #cbd5e1;
}
/* ===== BILLING DETAIL IMPROVEMENTS ===== */

.billing-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.billing-header-actions {
    flex-shrink: 0;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 13px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #f8fafc;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.back-button:hover {
    background: #eef2f7;
    border-color: #cbd5e1;
}

.billing-section-grid,
.billing-detail-grid,
.billing-totals-grid {
    display: grid;
    gap: 20px;
    align-items: stretch;
}

.billing-section-grid,
.billing-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.billing-totals-grid {
    grid-template-columns: 2fr 1fr;
}

.billing-section-grid > .portal-card,
.billing-detail-grid > .portal-card,
.billing-totals-grid > .portal-card,
.billing-side-stack > .portal-card,
.portal-home-grid > .portal-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.billing-side-stack {
    display: grid;
    gap: 20px;
    align-items: stretch;
}

.billing-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 20px;
}

.billing-summary-grid .label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.billing-summary-grid strong {
    font-size: 0.98rem;
    color: #111827;
}

.billing-attachments {
    display: grid;
    gap: 16px;
}

.billing-attachment-preview {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.meter-thumb-button {
    width: fit-content;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.meter-thumb-image {
    display: block;
    width: 92px;
    height: 140px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.billing-files {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.billing-file-link,
.billing-file-button {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f8fafc;
    color: #1f2937;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.billing-file-link:hover,
.billing-file-button:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.billing-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.billing-table th,
.billing-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.billing-table th:nth-child(1),
.billing-table td:nth-child(1) {
    text-align: left;
    width: 32%;
}

.billing-table th:nth-child(2),
.billing-table td:nth-child(2) {
    text-align: right;
    width: 20%;
}

.billing-table th:nth-child(3),
.billing-table td:nth-child(3) {
    text-align: right;
    width: 20%;
}

.billing-table th:nth-child(4),
.billing-table td:nth-child(4) {
    text-align: right;
    width: 28%;
}

.billing-table thead th {
    background: #f8fafc;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.billing-table tbody tr:hover {
    background: #fafafa;
}

.billing-table tfoot th {
    background: #f8fafc;
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
}

.negative-value {
    color: #b91c1c;
    font-weight: 600;
}

.billing-total-card {
    justify-content: left;
}

.billing-grand-total {
    margin-top: 10px;
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #111827;
}

.billing-mini-sums {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
    display: grid;
    gap: 10px;
}

.billing-mini-sum-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #475569;
}

.billing-mini-sum-row strong {
    color: #111827;
}

.billing-paid-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0 14px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

.billing-note-box {
    margin-top: 8px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: #475569;
    line-height: 1.5;
}

.billing-info-note {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: #475569;
    font-size: 0.94rem;
    line-height: 1.5;
}

.meter-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;
}

.meter-modal.is-open {
    display: block;
}

.meter-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
}

.meter-modal-dialog {
    position: relative;
    max-width: 900px;
    margin: 40px auto;
    padding: 24px;
    z-index: 2;
}

.meter-modal-dialog img {
    display: block;
    max-width: 100%;
    max-height: 85vh;
    margin: 0 auto;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.meter-modal-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

@media (max-width: 900px) {
    .billing-header-row,
    .billing-summary-grid,
    .billing-section-grid,
    .billing-detail-grid,
    .billing-totals-grid {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .meter-thumb-image {
        width: 84px;
        height: 128px;
    }

    .billing-table {
        font-size: 0.92rem;
    }
	    .billing-lower-grid {
        grid-template-columns: 1fr;
    }
	    .billing-lower-grid {
        grid-template-columns: 1fr;
    }

    .billing-left-stack,
    .billing-right-stack {
        grid-template-columns: 1fr;
    }
}
/*.billing-lower-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    align-items: start;
}

.billing-right-stack {
    display: grid;
    gap: 20px;
    align-items: start;
}*/
.billing-lower-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    align-items: start;
}

.billing-left-stack,
.billing-right-stack {
    display: grid;
    gap: 20px;
    align-items: start;
}
/* ===== BILLING ATTACHMENTS ===== */

.billing-attachments-list {
    display: grid;
    gap: 12px;
}

.billing-attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f8fafc;
}

.billing-attachment-meta {
    min-width: 0;
}

.billing-attachment-text {
    margin: 4px 0 0;
    font-size: 0.9rem;
    color: #64748b;
}

.billing-attachment-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #ffffff;
    color: #374151;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.billing-attachment-link:hover {
    background: #eef2f7;
    border-color: #cbd5e1;
}

/* ===== FILE VIEWER MODAL ===== */

.file-viewer-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;
}

.file-viewer-modal.is-open {
    display: block;
}

.file-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.74);
}

.file-viewer-dialog {
    position: relative;
    z-index: 2;
    width: min(1100px, calc(100vw - 32px));
    margin: 24px auto;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
}

.file-viewer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

.file-viewer-title {
    font-weight: 700;
    color: #111827;
}

.file-viewer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-viewer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #ffffff;
    color: #374151;
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
}

.file-viewer-body {
    height: min(80vh, 900px);
    background: #0f172a;
}

.file-viewer-image-wrap {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: auto;
    padding: 24px;
}

.file-viewer-image-wrap img {
    max-width: 100%;
    max-height: 100%;
    transform-origin: center center;
    transition: transform 0.15s ease;
    background: #ffffff;
    border-radius: 12px;
}

.file-viewer-frame {
    display: none;
    width: 100%;
    height: 100%;
    border: 0;
    background: #ffffff;
}

@media (max-width: 900px) {
    .billing-attachment-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .file-viewer-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .file-viewer-actions {
        flex-wrap: wrap;
    }
}
/* =========================================================
   START: Billing detail page
========================================================= */

.billing-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.billing-header-actions {
    display: flex;
    align-items: center;
}

.billing-section-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.billing-top-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: auto;
}

.billing-section-grid > .billing-top-card {
    height: auto;
}

.billing-top-card .portal-section-header {
    margin-bottom: 16px;
}

.billing-summary-total-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e2e8f0;
}

.billing-summary-total-label {
    font-size: 0.98rem;
    font-weight: 600;
    color: #475569;
}

.billing-summary-total-value {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.1;
    color: #0f172a;
}

.billing-summary-total-amount {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.billing-vat-note {
    display: block;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 500;
}

.billing-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
}

.billing-summary-grid .label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.82rem;
    color: #64748b;
}

.billing-summary-grid strong {
    display: block;
    font-size: 0.98rem;
    color: #0f172a;
}

.billing-summary-subvalue {
    display: block;
    margin-top: 6px;
    font-size: 0.82rem;
    color: #64748b;
}

.billing-status-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.billing-status-inline .billing-summary-subvalue {
    display: inline-flex;
    margin-top: 0;
    white-space: nowrap;
}

.billing-summary-subvalue-standalone {
    margin-top: 0;
    font-size: 0.98rem;
    font-weight: 700;
    color: #0f172a;
}

.billing-summary-note {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.billing-summary-note-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.billing-summary-note-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #475569;
}

.billing-note-box-inline {
    margin-top: 0;
}

.billing-attachments-list {
    display: flex;
    flex-direction: column;
    gap: 13.75px;
    justify-content: flex-start;
}

.billing-document-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 92px;
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.billing-document-card:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.billing-document-card-highlight {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.billing-document-card-muted .billing-document-title,
.billing-document-card-muted .billing-document-description,
.billing-document-card-muted .table-empty {
    color: #94a3b8;
}

.billing-document-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}

.billing-document-preview {
    width: 64px;
    height: 64px;
    border: none;
    padding: 0;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
}

.billing-document-preview-document {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    text-decoration: none;
}

.billing-document-preview img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    display: block;
    border-radius: 12px;
    border: 1px solid #dbe2ea;
    background: #fff;
}

.billing-document-icon {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    border: 1px solid #dbe2ea;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    flex-shrink: 0;
}

.billing-document-icon-document {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    color: #b91c1c;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.billing-document-icon-document-highlight {
    color: #1d4ed8;
}

.billing-document-preview-document:hover .billing-document-icon-document {
    transform: translateY(-1px);
    border-color: #cbd5e1;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
}

.billing-document-icon-glyph {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.billing-document-icon-empty {
    background: #f8fafc;
    color: #94a3b8;
}

.billing-document-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.billing-document-title {
    font-size: 0.96rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.2;
}

.billing-document-description {
    font-size: 0.87rem;
    color: #64748b;
    line-height: 1.35;
}

.billing-document-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #ffffff;
    color: #0f172a;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.billing-document-open:hover {
    background: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
}

.billing-lower-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.58fr) minmax(380px, 0.82fr);
    gap: 20px;
    align-items: stretch;
}

.billing-left-stack,
.billing-right-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
}

.billing-right-stack {
    min-height: 100%;
    justify-content: space-between;
}

.billing-table {
    width: 100%;
    border-collapse: collapse;
}

.billing-table thead th {
    padding: 12px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: left;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
}

.billing-table tbody td,
.billing-table tfoot th {
    padding: 14px;
    border-bottom: 1px solid #eef2f7;
    vertical-align: middle;
    color: #0f172a;
}

.billing-table tfoot th {
    font-weight: 700;
    color: #111827;
}

.billing-table tbody tr:last-child td {
    border-bottom: 1px solid #e2e8f0;
}

.billing-table .billing-subheading-row td {
    padding: 16px 14px 8px;
    background: #f8fafc;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
}

.billing-table tfoot tr th {
    padding-top: 16px;
}

.billing-inline-note {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 0.86rem;
    line-height: 1.45;
    color: #475569;
}

/* ===== BILLING OVERVIEW ===== */

.billing-overview-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.billing-overview-card > h2 {
    margin: 0;
    font-size: 1.1rem;
    color: #0f172a;
}

.billing-overview-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.billing-overview-actions {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.billing-overview-lead {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.5;
}

.billing-filter-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 220px;
}

.billing-filter-form label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.billing-filter-form select {
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
    font: inherit;
}

.billing-overview-table {
    width: 100%;
    min-width: 820px;
    border-collapse: collapse;
    table-layout: auto;
}

.billing-overview-table th,
.billing-overview-table td {
    padding: 16px 18px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

.billing-overview-table thead th {
    background: #f8fafc;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.billing-overview-table tbody tr:hover {
    background: #fafafa;
}

.billing-overview-table .billing-overview-number {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.billing-overview-table .billing-overview-number-heading {
    text-align: right;
}

.billing-overview-period {
    font-weight: 600;
    color: #0f172a;
}

.billing-overview-period-note {
    margin-top: 6px;
    max-width: 320px;
    white-space: normal;
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.45;
}

.billing-overview-table .billing-overview-total-cell {
    min-width: 130px;
}

.billing-overview-status-meta {
    display: block;
    margin-top: 6px;
    font-size: 0.82rem;
    color: #64748b;
}

.billing-overview-table .billing-overview-status-cell {
    white-space: normal;
}

.billing-overview-table .billing-overview-action-cell {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

.billing-overview-table .billing-overview-action-heading {
    text-align: right;
}

.billing-overview-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #ffffff;
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.billing-overview-link:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

.billing-overview-table .table-empty {
    color: #94a3b8;
    font-size: 0.9rem;
    font-style: italic;
}

.billing-overview-table .baseline-row {
    background: #f8fafc;
}

.billing-overview-table .baseline-row:hover {
    background: #f1f5f9;
}

.billing-overview-table .baseline-period {
    font-weight: 600;
    color: #111827;
}

.billing-overview-table .baseline-subtext {
    margin-top: 4px;
    font-size: 0.82rem;
    color: #64748b;
}

.billing-overview-table .status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
}

.rent-payment-info {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(0, 2.4fr);
    gap: 18px;
    padding: 18px;
    border: 1px solid #dbe5ef;
    border-radius: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 70%);
}

.rent-payment-info__intro {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rent-payment-info__intro strong {
    max-width: none;
    color: #0f172a;
    font-size: 1rem;
    line-height: 1.35;
    white-space: nowrap;
}

.rent-receipt-pdf-action {
    gap: 8px;
}

.rent-receipt-pdf-action > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 22px;
    padding: 0 5px;
    border-radius: 5px;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0;
}

.rent-payment-info__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.rent-payment-info__grid > div {
    min-width: 0;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}

.rent-payment-info__grid dt {
    margin: 0 0 6px;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.rent-payment-info__grid dd {
    margin: 0;
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.rent-overview-table td {
    vertical-align: middle;
}

.rent-overview-period-cell {
    min-width: 260px;
}

.rent-overview-period,
.rent-overview-amount-cell strong,
.rent-overview-date-cell strong {
    display: block;
    color: #0f172a;
    font-size: 0.96rem;
    line-height: 1.25;
}

.rent-overview-reference,
.rent-overview-amount-cell span,
.rent-overview-date-cell span,
.rent-overview-muted-action {
    display: block;
    margin-top: 6px;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.35;
    white-space: normal;
}

.billing-overview-table .rent-overview-amount-heading,
.billing-overview-table .rent-overview-amount-cell {
    text-align: left;
}

.billing-overview-table .rent-overview-amount-cell {
    min-width: 145px;
}

.rent-overview-date-cell {
    min-width: 120px;
}

.rent-overview-status-cell {
    min-width: 150px;
}

.rent-overview-muted-action {
    max-width: 240px;
    margin-left: auto;
}

.rent-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.8fr);
    gap: var(--portal-card-gap);
    align-items: start;
}

.rent-detail-card,
.rent-detail-side-card,
.rent-detail-lines-card {
    min-width: 0;
}

.rent-detail-lines-card {
    grid-column: 1 / -1;
}

.rent-detail-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.rent-detail-list > div,
.rent-detail-payment-box {
    min-width: 0;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}

.rent-detail-list dt,
.rent-detail-payment-box dt {
    margin: 0 0 7px;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.rent-detail-list dd,
.rent-detail-payment-box dd {
    margin: 0;
    color: #0f172a;
    font-size: 0.96rem;
    font-weight: 800;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.rent-detail-side-card {
    display: grid;
    gap: 14px;
}

.rent-detail-side-card h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1.2rem;
    line-height: 1.2;
}

.rent-detail-side-card p {
    margin: 0;
    color: #52657d;
    line-height: 1.55;
}

.rent-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rent-detail-payment-box {
    display: grid;
    gap: 12px;
    margin-top: 4px;
    background: #ffffff;
}

.rent-detail-payment-box dl {
    display: grid;
    gap: 10px;
    margin: 0;
}

.rent-detail-lines {
    display: grid;
    gap: 12px;
}

.rent-detail-lines__header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
}

.rent-detail-lines__header h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1.25rem;
    line-height: 1.2;
}

.rent-detail-lines__table-wrap {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
}

.rent-detail-lines__table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
}

.rent-detail-lines__table th,
.rent-detail-lines__table td {
    padding: 14px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: top;
}

.rent-detail-lines__table th {
    background: #f8fafc;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rent-detail-lines__table tbody tr:last-child td {
    border-bottom: 0;
}

.rent-detail-lines__table strong,
.rent-detail-lines__amount {
    color: #0f172a;
    font-weight: 850;
}

.rent-detail-lines__table span {
    display: block;
    margin-top: 5px;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.35;
}

.rent-detail-lines__amount {
    text-align: right;
    white-space: nowrap;
}

.rent-detail-lines__summary td {
    background: #f8fafc;
}

@media (max-width: 900px) {
    .billing-overview-card {
        gap: 16px;
    }

    .billing-overview-header {
        flex-direction: column;
    }

    .billing-overview-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .billing-overview-table th,
    .billing-overview-table td {
        padding: 12px 14px;
    }

    .rent-payment-info {
        grid-template-columns: 1fr;
    }

    .rent-payment-info__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rent-detail-layout {
        grid-template-columns: 1fr;
    }

    .rent-detail-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .billing-overview-header .documents-secondary-action {
        width: 100%;
    }

    .billing-overview-page .billing-filter-form,
    .billing-overview-page .billing-filter-form select,
    .power-overview-stack .billing-filter-form,
    .power-overview-stack .billing-filter-form select {
        width: 100%;
        min-width: 0;
    }

    .billing-overview-page .table-wrap,
    .power-overview-stack .table-wrap {
        overflow: visible;
    }

    .billing-overview-page .billing-overview-table,
    .power-overview-stack .billing-overview-table {
        display: block;
        min-width: 0;
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
    }

    .billing-overview-page .billing-overview-table thead,
    .power-overview-stack .billing-overview-table thead {
        display: none;
    }

    .billing-overview-page .billing-overview-table tbody,
    .power-overview-stack .billing-overview-table tbody {
        display: grid;
        gap: 12px;
    }

    .billing-overview-page .billing-overview-table tbody tr,
    .power-overview-stack .billing-overview-table tbody tr {
        display: grid;
        gap: 12px;
        padding: 14px;
        border: 1px solid #e2e8f0;
        border-radius: 14px;
        background: #fff;
    }

    .billing-overview-page .billing-overview-table tbody tr:hover,
    .power-overview-stack .billing-overview-table tbody tr:hover {
        background: #fff;
    }

    .billing-overview-page .billing-overview-table td,
    .power-overview-stack .billing-overview-table td {
        display: grid;
        grid-template-columns: minmax(96px, 0.36fr) minmax(0, 1fr);
        gap: 12px;
        align-items: start;
        padding: 0;
        border-bottom: 0;
        text-align: left;
        white-space: normal;
    }

    .billing-overview-page .billing-overview-table td::before,
    .power-overview-stack .billing-overview-table td::before {
        content: attr(data-label);
        color: #64748b;
        font-size: 0.78rem;
        font-weight: 800;
        line-height: 1.35;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    .billing-overview-page .billing-overview-table .billing-overview-number,
    .power-overview-stack .billing-overview-table .billing-overview-number,
    .billing-overview-page .billing-overview-table .billing-overview-action-cell,
    .power-overview-stack .billing-overview-table .billing-overview-action-cell {
        width: auto;
        text-align: left;
    }

    .billing-overview-page .billing-overview-link,
    .power-overview-stack .billing-overview-link {
        width: 100%;
    }

    .rent-payment-info {
        padding: 14px;
        border-radius: 14px;
    }

    .rent-payment-info__intro strong {
        max-width: none;
        white-space: normal;
    }

    .rent-payment-info__grid {
        grid-template-columns: 1fr;
    }

    .rent-overview-table {
        display: block;
        min-width: 0;
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
    }

    .rent-overview-table thead {
        display: none;
    }

    .rent-overview-table tbody {
        display: grid;
        gap: 12px;
    }

    .rent-overview-table tbody tr {
        display: grid;
        gap: 12px;
        padding: 14px;
        border: 1px solid #e2e8f0;
        border-radius: 14px;
        background: #fff;
    }

    .billing-overview-table.rent-overview-table th,
    .billing-overview-table.rent-overview-table td {
        display: grid;
        grid-template-columns: minmax(88px, 0.34fr) minmax(0, 1fr);
        gap: 12px;
        align-items: start;
        padding: 0;
        border-bottom: 0;
        white-space: normal;
    }

    .billing-overview-table.rent-overview-table td::before {
        content: attr(data-label);
        color: #64748b;
        font-size: 0.78rem;
        font-weight: 800;
        line-height: 1.35;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    .rent-overview-period-cell,
    .billing-overview-table .rent-overview-amount-cell,
    .rent-overview-date-cell,
    .rent-overview-status-cell {
        min-width: 0;
    }

    .billing-overview-table .billing-overview-action-cell {
        width: auto;
        text-align: left;
    }

    .rent-overview-muted-action {
        max-width: none;
        margin-left: 0;
    }
}

.billing-total-card {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    justify-content: center;
    align-self: stretch;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    margin-top: auto;
    min-height: 260px;
    max-height: 320px;
}

.billing-transfer-card {
    min-height: 180px;
}

@media (min-width: 901px) {
    .billing-lower-grid {
        grid-template-rows: auto auto auto;
        align-items: start;
    }

    .billing-left-stack,
    .billing-right-stack {
        display: contents;
    }

    .billing-power-account-card,
    .billing-calculation-card {
        grid-row: 1;
    }

    .billing-grid-account-card,
    .billing-total-card:not(.billing-transfer-card) {
        grid-row: 2;
    }

    .billing-settlement-card,
    .billing-transfer-card {
        grid-row: 3;
    }

    .billing-power-account-card,
    .billing-grid-account-card,
    .billing-settlement-card {
        grid-column: 1;
    }

    .billing-calculation-card,
    .billing-total-card {
        grid-column: 2;
    }

    .billing-total-card:not(.billing-transfer-card) {
        align-self: end;
        margin-top: 0;
    }
}

.billing-grand-total {
    margin-top: 4px;
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
}

.billing-mini-sums {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.billing-mini-sum-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 0.92rem;
}

.detail-status-row,
.billing-paid-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.billing-note-box,
.detail-placeholder-box {
    margin-top: 8px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    line-height: 1.5;
}

.billing-powered-by {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 0 0;
    color: #64748b;
    font-size: 0.82rem;
    text-align: center;
}

.portal-system-footer {
    margin-top: 36px;
    margin-bottom: 0;
}

.billing-powered-by-label {
    font-weight: 600;
    color: #475569;
    line-height: 1;
    transform: translateY(5px);
}

.billing-powered-by-text {
    display: inline-flex;
    align-items: center;
    height: 18px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: 0;
    line-height: 1;
}

.billing-powered-by-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.billing-powered-by-separator {
    width: 1px;
    height: 22px;
    background: #cbd5e1;
    display: inline-block;
}

.billing-powered-by-logo {
    display: block;
    height: 28px;
    width: auto;
}

.billing-powered-by-lp-brand {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transform: translateY(1px);
}

.billing-powered-by-lp-mark {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    background: linear-gradient(135deg, #4c5c74, #65748a);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: 700;
    line-height: 1;
}

.billing-powered-by-meta {
    flex-basis: 100%;
    color: #94a3b8;
}

.negative-value {
    color: #b91c1c;
    font-weight: 600;
}

.table-empty {
    color: #94a3b8;
    font-size: 0.9rem;
}

/* =========================================================
   START: File viewer modal
========================================================= */

.file-viewer-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 2000;
}

.file-viewer-modal.is-open {
    display: block;
}

.file-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.file-viewer-dialog {
    position: relative;
    z-index: 1;
    width: min(1100px, calc(100vw - 32px));
    height: min(90vh, 900px);
    margin: 4vh auto;
    border-radius: 20px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.25);
    display: flex;
    flex-direction: column;
}

.file-viewer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.file-viewer-title {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
}

.file-viewer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.file-viewer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #ffffff;
    color: #111827;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.file-viewer-btn:hover {
    background: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
}

.file-viewer-body {
    flex: 1;
    min-height: 0;
    background: #e5e7eb;
    position: relative;
}

.file-viewer-image-wrap {
    width: 100%;
    height: 100%;
}

.file-viewer-image-wrap {
    display: none;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 24px;
    background: #f1f5f9;
}

.file-viewer-image-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.15s ease;
    transform-origin: center center;
}

/* =========================================================
   START: Responsive
========================================================= */

@media (max-width: 980px) {
    .billing-section-grid,
    .billing-lower-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .billing-summary-grid {
        grid-template-columns: 1fr;
    }

    .billing-summary-total-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .billing-summary-total-amount {
        align-items: flex-start;
    }

    .billing-summary-note-header {
        align-items: flex-start;
    }

    .billing-document-card {
        align-items: flex-start;
    }

    .billing-document-left {
        align-items: flex-start;
    }

    .billing-lower-grid .billing-table {
        display: block;
        border-collapse: separate;
        border-spacing: 0;
    }

    .billing-lower-grid .billing-table thead {
        display: none;
    }

    .billing-lower-grid .billing-table tbody,
    .billing-lower-grid .billing-table tfoot {
        display: grid;
        gap: 12px;
    }

    .billing-lower-grid .billing-table tbody {
        margin-bottom: 12px;
    }

    .billing-lower-grid .billing-table tr {
        display: grid;
        gap: 10px;
        padding: 14px;
        border: 1px solid #e2e8f0;
        border-radius: 14px;
        background: #fff;
    }

    .billing-lower-grid .billing-table tbody tr:hover {
        background: #fff;
    }

    .billing-lower-grid .billing-table .billing-subheading-row {
        display: block;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .billing-lower-grid .billing-table .billing-subheading-row td {
        display: block;
        padding: 10px 0 0;
        border: 0;
        background: transparent;
    }

    .billing-lower-grid .billing-table td,
    .billing-lower-grid .billing-table tfoot th {
        display: grid;
        grid-template-columns: minmax(82px, 0.34fr) minmax(0, 1fr);
        gap: 12px;
        align-items: start;
        width: auto;
        padding: 0;
        border-bottom: 0;
        text-align: left;
        white-space: normal;
    }

    .billing-lower-grid .billing-table td::before,
    .billing-lower-grid .billing-table tfoot th::before {
        content: attr(data-label);
        color: #64748b;
        font-size: 0.78rem;
        font-weight: 800;
        line-height: 1.35;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    .billing-lower-grid .billing-table td:nth-child(1):not([data-label])::before,
    .billing-lower-grid .billing-table tfoot th:nth-child(1):not([data-label])::before {
        content: "Post";
    }

    .billing-lower-grid .billing-table td:nth-child(2):not([data-label])::before,
    .billing-lower-grid .billing-table tfoot th:nth-child(2):not([data-label])::before {
        content: "Forbruk";
    }

    .billing-lower-grid .billing-table td:nth-child(3):not([data-label])::before,
    .billing-lower-grid .billing-table tfoot th:nth-child(3):not([data-label])::before {
        content: "Pris";
    }

    .billing-lower-grid .billing-table td:nth-child(4):not([data-label])::before,
    .billing-lower-grid .billing-table tfoot th:nth-child(4):not([data-label])::before {
        content: "Sum";
    }

    .billing-lower-grid .billing-table tfoot th:empty {
        display: none;
    }

    .file-viewer-dialog {
        width: calc(100vw - 16px);
        height: calc(100vh - 16px);
        margin: 8px auto;
        border-radius: 16px;
    }

    .file-viewer-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* =========================================================
   END: Billing detail page
========================================================= */

/* =========================================================
   START: Documents page concept
========================================================= */

.documents-hero .portal-page-text {
    max-width: 680px;
}

.billing-overview-page {
    margin-top: -21px;
}

.documents-hero__inner {
    align-items: stretch;
}

.documents-hero__meta {
    align-self: stretch;
}

.documents-category-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.documents-category {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 178px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #ffffff;
    color: var(--portal-text);
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.documents-category:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.documents-category__icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: #f1f5f9;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.documents-category__label,
.documents-product-kicker,
.documents-pill,
.documents-table__head {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.documents-category strong {
    font-size: 1rem;
    line-height: 1.25;
}

.documents-category small {
    color: var(--portal-muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.documents-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
    gap: 22px;
    align-items: stretch;
}

.documents-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.documents-section-heading h2 {
    margin: 4px 0 0;
    font-size: 1.18rem;
    line-height: 1.25;
    color: var(--portal-text);
}

.documents-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
}

.documents-product-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.documents-product-row {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #ffffff;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.documents-product-row:hover {
    transform: translateY(-1px);
    border-color: #cbd5e1;
    background: #fbfdff;
}

.documents-product-row.is-active {
    border-color: #c7d2fe;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.documents-product-thumb {
    width: 74px;
    height: 74px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    border: 1px solid #dbe2ea;
    background: #f8fafc;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 800;
    overflow: hidden;
}

.documents-product-thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.documents-product-thumb--washer {
    background: linear-gradient(135deg, #f8fafc, #e0f2fe);
}

.documents-product-thumb--heat {
    background: linear-gradient(135deg, #f8fafc, #ecfccb);
}

.documents-product-thumb--lock {
    background: linear-gradient(135deg, #f8fafc, #fef3c7);
}

.documents-product-main h3 {
    margin: 3px 0 5px;
    font-size: 1rem;
    line-height: 1.25;
}

.documents-product-main p {
    margin: 0;
    color: var(--portal-muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.documents-product-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 36px;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    color: #334155;
    font-size: 0.86rem;
    font-weight: 700;
}

.documents-detail-panel {
    padding: 0;
    overflow: hidden;
}

.documents-detail-cover {
    min-height: 178px;
    display: grid;
    place-items: center;
    background:
        linear-gradient(135deg, rgba(68, 85, 107, 0.12), rgba(124, 142, 163, 0.08)),
        #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.documents-detail-device {
    position: relative;
    width: 118px;
    height: 136px;
    border-radius: 24px;
    border: 1px solid #dbe2ea;
    background: #ffffff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.documents-detail-device__mark {
    position: absolute;
    top: 18px;
    left: 18px;
    color: #334155;
    font-size: 0.76rem;
    font-weight: 800;
}

.documents-detail-device__line {
    position: absolute;
    top: 44px;
    left: 18px;
    right: 18px;
    height: 1px;
    background: #e2e8f0;
}

.documents-detail-device__dial {
    position: absolute;
    left: 50%;
    bottom: 24px;
    width: 52px;
    height: 52px;
    transform: translateX(-50%);
    border-radius: 999px;
    border: 10px solid #e2e8f0;
    background: #f8fafc;
}

.documents-detail-image {
    width: 100%;
    height: 220px;
    display: block;
    object-fit: cover;
}

.documents-detail-content {
    padding: 24px;
}

.documents-detail-content h2 {
    margin: 4px 0 8px;
    font-size: 1.28rem;
}

.documents-detail-lead {
    margin: 0;
    color: var(--portal-muted);
    line-height: 1.55;
}

.documents-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0;
}

.documents-primary-action,
.documents-secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
}

.documents-primary-action {
    background: var(--portal-sidebar);
    color: #ffffff;
}

.billing-transfer-note {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 500;
}

.documents-primary-action:hover {
    background: var(--portal-sidebar-hover);
}

.documents-secondary-action {
    border: 1px solid #d1d5db;
    color: #334155;
    background: #ffffff;
}

.documents-secondary-action:hover {
    border-color: #aeb9c7;
    background: #f8fafc;
}

.documents-key-info {
    margin-top: 28px;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.documents-key-info h3 {
    margin: 0 0 12px;
    font-size: 0.94rem;
    color: var(--portal-text);
}

.documents-key-info dl {
    margin: 0;
    display: grid;
    gap: 10px;
}

.documents-key-info dl div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.documents-key-info dl div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.documents-key-info dt,
.documents-key-info dd {
    margin: 0;
    font-size: 0.9rem;
}

.documents-key-info dt {
    color: #64748b;
}

.documents-key-info dd {
    color: var(--portal-text);
    font-weight: 600;
    text-align: right;
}

.documents-warranty-box {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid #dbeafe;
    background: #eff6ff;
}

.documents-warranty-box__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.documents-warranty-box h3 {
    margin: 0;
    font-size: 0.94rem;
    color: var(--portal-text);
}

.documents-warranty-box__header span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 0.82rem;
    font-weight: 700;
}

.documents-warranty-box dl {
    margin: 0;
    display: grid;
    gap: 10px;
}

.documents-warranty-box dl div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(37, 99, 235, 0.14);
}

.documents-warranty-box dl div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.documents-warranty-box dt,
.documents-warranty-box dd {
    margin: 0;
    font-size: 0.9rem;
}

.documents-warranty-box dt {
    color: #64748b;
}

.documents-warranty-box dd {
    color: var(--portal-text);
    font-weight: 600;
    text-align: right;
}

.documents-guide-grid {
    display: grid;
    gap: 16px;
}

.documents-guide-grid--detail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.documents-guide-block--wide {
    grid-column: 1 / -1;
}

.documents-guide-grid h3 {
    margin: 0 0 8px;
    font-size: 0.94rem;
}

.documents-guide-grid ul {
    margin: 0;
    padding-left: 18px;
    list-style: disc;
    color: var(--portal-muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.documents-guide-grid li {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.documents-guide-grid li:last-child {
    margin-bottom: 0;
}

.documents-troubleshooting-list li {
    margin-bottom: 10px;
    padding-bottom: 0;
}

.documents-troubleshooting-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.documents-troubleshooting-list strong {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: #334155;
    font-weight: 500;
}

.documents-error-code-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: #1f2937;
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1;
}

.documents-troubleshooting-list span {
    display: block;
    margin-top: 4px;
    color: #64748b;
    line-height: 1.5;
}

.documents-troubleshooting-list strong .documents-error-code-badge {
    margin-top: 0;
    color: #ffffff;
}

.documents-problem-table {
    display: grid;
    gap: 0;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
}

.documents-problem-table__head,
.documents-problem-row {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(92px, 0.42fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.documents-problem-table__head {
    padding: 10px 14px;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 700;
}

.documents-problem-row {
    padding: 11px 14px;
    border-top: 1px solid #eef2f7;
    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.42;
}

.documents-problem-row:nth-child(even) {
    background: #fbfdff;
}

.documents-problem-description strong {
    display: block;
    color: #334155;
    font-weight: 600;
}

.documents-problem-description span,
.documents-problem-solution span {
    display: block;
    margin-top: 2px;
}

.documents-problem-code {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.documents-problem-empty,
.documents-problem-empty-state {
    color: #94a3b8;
}

.documents-problem-empty-state {
    padding: 14px;
    border-top: 1px solid #eef2f7;
}

.documents-support-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.72fr);
    gap: 24px;
    align-items: start;
}

.documents-support-grid--single {
    grid-template-columns: 1fr;
}

.documents-error-code-list {
    display: grid;
    gap: 10px;
}

.documents-error-code {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}

.documents-error-code__code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    min-height: 30px;
    padding: 0 8px;
    border-radius: 10px;
    background: #1f2937;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
}

.documents-error-code strong {
    display: block;
    color: #334155;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.35;
}

.documents-error-code p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.45;
}

.documents-library-card {
    overflow: hidden;
}

.documents-filter-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.documents-filter {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 11px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #ffffff;
    color: #475569;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: default;
    line-height: 1;
    text-align: center;
    text-decoration: none;
}

.documents-filter.is-active {
    background: #1f2937;
    border-color: #1f2937;
    color: #ffffff;
}

.documents-archive-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px) auto auto;
    gap: 12px;
    align-items: end;
    padding: 4px 0 18px;
}

.documents-search-field {
    display: grid;
    gap: 7px;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 700;
}

.documents-search-field input,
.documents-search-field select {
    min-height: 42px;
    border: 1px solid #d8e0ea;
    border-radius: 10px;
    padding: 0 12px;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
    font-weight: 500;
}

.documents-archive-filter-row {
    justify-content: flex-start;
    padding-bottom: 16px;
}

.documents-table {
    min-width: 0;
}

.documents-table__head,
.documents-file-row {
    display: grid;
    grid-template-columns: minmax(260px, 1.4fr) 0.7fr 0.55fr 0.6fr;
    gap: 16px;
    align-items: center;
}

.documents-table__head {
    padding: 12px 14px;
    border-radius: 12px;
    background: #f8fafc;
}

.documents-file-row {
    padding: 16px 14px;
    border-bottom: 1px solid #eef2f7;
    color: #334155;
    text-decoration: none;
}

.documents-file-row[hidden] {
    display: none;
}

.documents-file-row:hover {
    background: #fbfdff;
}

.documents-file-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.documents-file-title strong,
.documents-file-title small {
    display: block;
}

.documents-file-title strong {
    color: var(--portal-text);
    font-size: 0.96rem;
}

.documents-file-title small {
    margin-top: 3px;
    color: var(--portal-muted);
    font-size: 0.86rem;
}

.documents-file-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 12px;
    background: #f1f5f9;
    color: #334155;
    font-size: 0.72rem;
    font-weight: 800;
}

.documents-status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 700;
}

.documents-status--ok {
    background: #ecfdf5;
    color: #047857;
}

.documents-status--active {
    background: #ecfdf5;
    color: #047857;
}

.documents-status--info {
    background: #eff6ff;
    color: #1d4ed8;
}

.documents-status--new {
    background: #eff6ff;
    color: #1d4ed8;
}

.documents-status--archived {
    background: #f8fafc;
    color: #64748b;
}

.documents-status--admin {
    background: #fef3c7;
    color: #92400e;
}

.documents-status--overdue {
    background: #fee2e2;
    color: #b91c1c;
}

.documents-status--sent {
    background: #eff6ff;
    color: #1d4ed8;
}

.documents-status--draft {
    background: #f8fafc;
    color: #64748b;
}

.documents-status--paid {
    background: #dcfce7;
    color: #166534;
}

.documents-status--partial {
    background: #fef3c7;
    color: #92400e;
}

.documents-status--cancelled {
    background: #f3f4f6;
    color: #6b7280;
}

.deposit-card {
    align-content: start;
}

.deposit-overview-layout {
    align-items: start;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.25fr);
}

.deposit-empty-state {
    align-items: start;
    display: grid;
    gap: 10px;
    min-height: 190px;
    padding: 26px;
}

.deposit-empty-state__mark {
    align-items: center;
    background: #eef3f8;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    color: #64748b;
    display: inline-flex;
    font-size: 1.25rem;
    font-weight: 900;
    height: 48px;
    justify-content: center;
    width: 48px;
}

.deposit-empty-state strong {
    color: #0f172a;
    font-size: 1.15rem;
    line-height: 1.2;
}

.deposit-empty-state p {
    color: #64748b;
    line-height: 1.55;
    margin: 0;
    max-width: 520px;
}

.deposit-info-card {
    align-content: start;
    display: grid;
    gap: 12px;
    min-height: 100%;
    padding: 26px;
}

.deposit-info-card h2 {
    color: #0f172a;
    font-size: 1.25rem;
    line-height: 1.25;
    margin: 0;
}

.deposit-info-card p {
    color: #64748b;
    line-height: 1.6;
    margin: 0;
    max-width: 620px;
}

.deposit-info-steps {
    display: grid;
    gap: 10px;
    margin-top: 8px;
}

.deposit-info-steps span {
    align-items: center;
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    color: #64748b;
    display: flex;
    font-size: 0.88rem;
    font-weight: 800;
    gap: 10px;
    min-height: 42px;
    padding: 0 12px;
}

.deposit-info-steps span::before {
    background: #cbd5e1;
    border-radius: 999px;
    content: "";
    flex: 0 0 auto;
    height: 9px;
    width: 9px;
}

.deposit-info-steps span.is-complete {
    background: #f7fef9;
    border-color: #bbf7d0;
    color: #166534;
}

.deposit-info-steps span.is-complete::before {
    background: #22c55e;
}

.deposit-detail-list {
    display: grid;
    gap: 10px;
    margin: 16px 0 18px;
}

.deposit-detail-list div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eef2f7;
}

.deposit-detail-list dt,
.deposit-detail-list dd {
    margin: 0;
    font-size: 0.92rem;
}

.deposit-detail-list dt {
    color: #64748b;
}

.deposit-detail-list dd {
    color: var(--portal-text);
    font-weight: 700;
    text-align: right;
}

.documents-roadmap-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.documents-roadmap-grid div {
    padding: 16px 0 0;
    border-top: 1px solid #e5e7eb;
}

.documents-roadmap-grid strong {
    display: block;
    margin-bottom: 6px;
    color: var(--portal-text);
}

.documents-roadmap-grid p {
    margin: 0;
    color: var(--portal-muted);
    font-size: 0.94rem;
    line-height: 1.55;
}

.documents-empty-state {
    padding: 18px 0 4px;
    color: var(--portal-muted);
}

.documents-empty-state strong {
    display: block;
    margin-bottom: 6px;
    color: var(--portal-text);
}

.documents-empty-state p {
    margin: 0;
    line-height: 1.55;
}

.issue-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.42fr);
    gap: 24px;
    align-items: start;
}

.issue-layout--detail {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.42fr);
}

.issue-form-card,
.issue-help-card {
    padding: 24px;
}

.issue-form {
    display: grid;
    gap: 18px;
}

.issue-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.issue-form-grid--admin .issue-form-field--wide {
    grid-column: 1 / -1;
}

.issue-form label {
    display: grid;
    gap: 7px;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 700;
}

.issue-form input,
.issue-form select,
.issue-form textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: #ffffff;
    color: var(--portal-text);
    font: inherit;
    font-weight: 500;
    padding: 10px 12px;
}

.issue-form textarea {
    min-height: 132px;
    resize: vertical;
    line-height: 1.5;
}

.issue-form input[type="file"] {
    padding: 8px 10px;
}

.issue-form small {
    color: var(--portal-muted);
    font-weight: 500;
    line-height: 1.4;
}

.issue-form .errorlist {
    margin: 0;
    padding-left: 18px;
    color: #b91c1c;
    font-weight: 600;
}

.issue-submit {
    border: 0;
    cursor: pointer;
    justify-self: start;
}

.issue-submit:disabled {
    opacity: 0.7;
    cursor: wait;
}

.issue-success {
    display: grid;
    gap: 4px;
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid #bbf7d0;
    border-radius: 14px;
    background: #f0fdf4;
    color: #166534;
}

.issue-success strong {
    color: #14532d;
}

.issue-help-card h2 {
    margin: 8px 0 12px;
    font-size: 1.1rem;
}

.issue-help-card ul {
    margin: 0;
    padding-left: 18px;
    color: var(--portal-muted);
    line-height: 1.55;
}

.issue-help-card li {
    margin-bottom: 8px;
}

.issue-side-column {
    position: sticky;
    top: calc(var(--portal-topbar-height) + 24px);
    display: grid;
    gap: 16px;
}

.issue-list-card,
.issue-thread-card {
    padding: 24px;
}

.issue-list {
    display: grid;
    border-top: 1px solid #e5e7eb;
}

.issue-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 16px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #e5e7eb;
    color: inherit;
    text-decoration: none;
}

.issue-row--updated {
    margin: 0 -12px;
    padding: 16px 12px;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    background: #eff6ff;
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.08);
}

.issue-row:hover strong {
    color: #1d4ed8;
}

.issue-row__main {
    display: grid;
    gap: 4px;
}

.issue-row__title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.issue-row__main strong {
    color: var(--portal-text);
}

.issue-update-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.8rem;
    font-weight: 800;
}

.issue-row__main small,
.issue-row__meta {
    color: var(--portal-muted);
    font-size: 0.9rem;
}

.issue-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 0.8rem;
    font-weight: 800;
    white-space: nowrap;
}

.issue-status--new {
    background: #dbeafe;
    color: #1d4ed8;
}

.issue-status--in_progress {
    background: #fef3c7;
    color: #92400e;
}

.issue-status--resolved {
    background: #dcfce7;
    color: #166534;
}

.issue-status--read {
    background: #dcfce7;
    color: #166534;
}

.issue-thread-card {
    display: grid;
    gap: 16px;
}

.issue-reply-list {
    display: grid;
    gap: 16px;
}

.issue-reply-items {
    display: grid;
    gap: 16px;
}

.issue-reply-list__heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding-top: 2px;
    color: #64748b;
}

.issue-reply-list__heading strong {
    color: var(--portal-text);
    font-size: 0.95rem;
}

.issue-reply-list__heading span {
    font-size: 0.86rem;
}

.issue-load-more {
    min-height: 42px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #ffffff;
    color: #334155;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
}

.issue-load-more:hover {
    background: #f8fafc;
}

.issue-load-more:disabled {
    opacity: 0.7;
    cursor: wait;
}

.issue-message,
.issue-waiting {
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
}

.issue-message--admin {
    border-color: #dbeafe;
    background: #eff6ff;
}

.issue-message--tenant {
    background: #f8fafc;
}

.issue-message--primary {
    border-color: #cbd5e1;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.issue-message--primary h3 {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 1.06rem;
    line-height: 1.3;
}

.issue-message__meta {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 8px;
    color: var(--portal-muted);
    font-size: 0.86rem;
}

.issue-message__meta strong {
    color: var(--portal-text);
}

.issue-message__phone {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 600;
}

.issue-message__phone::before {
    content: "·";
    margin-right: 8px;
    color: #94a3b8;
    font-weight: 700;
}

.issue-message p {
    margin: 0;
    color: #334155;
    line-height: 1.55;
}

.issue-contact-box {
    display: inline-grid;
    gap: 2px;
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #eff6ff;
    color: #475569;
}

.issue-contact-box span {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.issue-contact-box strong {
    color: #0f172a;
    font-size: 0.94rem;
}

.issue-attachment {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #334155;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
}

.issue-attachment:hover {
    border-color: #aeb9c7;
    background: #f8fafc;
}

.issue-waiting {
    display: grid;
    gap: 4px;
    color: var(--portal-muted);
}

.issue-waiting strong {
    color: var(--portal-text);
}

.issue-reply-form {
    padding: 24px;
}

.issue-reply-form h2 {
    margin: 0;
    color: var(--portal-text);
    font-size: 1.1rem;
}

.issue-reply-form input[type="file"] {
    min-height: 44px;
    padding: 9px 10px;
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
    cursor: pointer;
}

.issue-closed-card {
    padding: 24px;
}

.issue-closed-card h2 {
    margin: 0 0 8px;
    color: var(--portal-text);
    font-size: 1.1rem;
}

.issue-closed-card p {
    margin: 0;
    color: #64748b;
    line-height: 1.5;
}

.issue-form-status {
    min-height: 20px;
    margin: -6px 0 0;
    color: #64748b;
    font-size: 0.86rem;
    line-height: 1.4;
}

@media (max-width: 1100px) {
    .documents-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .deposit-overview-layout {
        grid-template-columns: 1fr;
    }

    .documents-workspace {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .documents-section-heading {
        flex-direction: column;
    }

    .documents-filter-row {
        justify-content: flex-start;
    }

    .documents-archive-toolbar {
        grid-template-columns: 1fr;
    }

    .documents-table__head {
        display: none;
    }

    .documents-file-row {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 16px 0;
    }

    .documents-file-row > span:not(.documents-file-title) {
        padding-left: 54px;
    }

    .documents-roadmap-grid {
        grid-template-columns: 1fr;
    }

    .documents-guide-grid--detail {
        grid-template-columns: 1fr;
    }

    .documents-support-grid {
        grid-template-columns: 1fr;
    }

    .issue-layout,
    .issue-form-grid {
        grid-template-columns: 1fr;
    }

    .issue-side-column {
        position: static;
    }

    .issue-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

@media (max-width: 560px) {
    .documents-category-grid {
        grid-template-columns: 1fr;
    }

    .documents-product-row {
        grid-template-columns: 58px minmax(0, 1fr);
    }

    .documents-product-thumb {
        width: 58px;
        height: 58px;
        border-radius: 14px;
    }

    .documents-product-action {
        grid-column: 2;
        justify-self: start;
    }

    .documents-detail-actions {
        flex-direction: column;
    }

    .documents-primary-action,
    .documents-secondary-action {
        width: 100%;
    }
}

/* =========================================================
   END: Documents page concept
========================================================= */

.issue-unavailable-card {
    padding: 28px;
}

.issue-unavailable-hero {
    align-items: stretch;
}

.issue-unavailable-user {
    font-size: 1rem;
    line-height: 1.25;
    word-break: break-word;
}

.issue-unavailable-id {
    font-size: 1.2rem;
}

.issue-unavailable-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.issue-unavailable-actions form {
    margin: 0;
}

.issue-unavailable-actions button {
    border: 0;
    cursor: pointer;
    font: inherit;
}

.issue-unavailable-note {
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: #eff6ff;
    color: #475569;
    line-height: 1.5;
}

.issue-unavailable-note strong {
    color: #1e3a8a;
}

@media (max-width: 640px) {
    .issue-unavailable-card {
        padding: 20px;
    }

    .issue-unavailable-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .issue-unavailable-actions form,
    .issue-unavailable-actions a,
    .issue-unavailable-actions button {
        width: 100%;
    }
}

.meter-reading-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 0.8fr);
    gap: 24px;
    align-items: start;
}

.meter-reading-detail-image {
    display: block;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.meter-reading-detail-image img {
    display: block;
    width: 100%;
    max-height: 720px;
    object-fit: contain;
}

.meter-reading-detail-list {
    display: grid;
    gap: 0;
    margin: 20px 0 0;
}

.meter-reading-detail-list > div {
    padding: 14px 0;
    border-bottom: 1px solid #e2e8f0;
}

.meter-reading-detail-list dt {
    margin-bottom: 5px;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.meter-reading-detail-list dd {
    margin: 0;
    font-weight: 700;
}

@media (max-width: 860px) {
    .meter-reading-detail-grid {
        grid-template-columns: 1fr;
    }
}
