/* Area E – home, dashboard, settings, landlord data, categories, users, privacy, profile, exports, templates, notification centre (docs/AREAS.md).
   Only tokens from theme.css (var(--…)); no all-caps labels, no thick coloured left borders. Touch targets ≥ 44 px on phones. */

/* ---------- Home (mockup "Home"): intro, quick-access cards, "needs attention" strip ---------- */
.home-intro { max-width: 680px; color: var(--text-2); margin: -6px 0 16px; display: flex; flex-direction: column; gap: 6px; }
.home-scope { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-3); }
.home-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.home-card { position: relative; display: flex; flex-direction: column; gap: 4px; min-height: 118px; min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text); text-decoration: none !important; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s, transform .15s; }
.home-card:hover, .home-card:focus-visible { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }
.home-card b { font-size: var(--fs-md); overflow-wrap: anywhere; hyphens: auto; } .home-card small { color: var(--text-3); font-size: var(--fs-sm); }
.hc-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--primary-soft); display: grid; place-items: center; margin-bottom: 6px; } .hc-ic .icon { stroke: var(--primary); }
.hc-go { position: absolute; right: 12px; top: 14px; opacity: 0; transition: opacity .15s; } .hc-go .icon { stroke: var(--text-3); }
.home-card:hover .hc-go, .set-card:hover .hc-go { opacity: 1; }
.attention { margin-top: var(--gap); } .attention-row { display: flex; flex-wrap: wrap; gap: 10px 40px; padding: 14px 18px; }
.att { display: flex; flex-direction: column; color: var(--text); text-decoration: none !important; min-width: 130px; min-height: 44px; }
.att b { font-size: 24px; font-variant-numeric: tabular-nums; line-height: 1.15; } .att b.hot { color: var(--danger); } .att b.calm { color: var(--text); }
.att span { font-size: var(--fs-sm); color: var(--text-3); } .att small { font-size: var(--fs-xs); color: var(--text-3); }
.att:hover span { color: var(--primary); }
.home-alerts { margin-top: var(--gap); }
.count-pill { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--danger-bg); color: var(--danger); font-size: 12px; font-weight: 700; }
.note-list li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 18px; border-bottom: 1px solid var(--border); } .note-list li.unread { background: var(--surface-2); }
@media (max-width: 1100px) { .home-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .home-cards { gap: 10px; } .home-card { min-height: 0; padding: 12px; } .home-card small { display: none; } .attention-row { gap: 10px 24px; } .att { min-width: 0; flex: 1 1 40%; } }

/* ---------- Dashboard (mockup "Dashboard") ---------- */
.dash-scope { display: flex; align-items: center; gap: 6px; margin: -8px 0 12px; }
.dash-kpis { display: grid; gap: 12px; margin-bottom: 12px; } .dash-kpis.six { grid-template-columns: repeat(6, minmax(0, 1fr)); } .dash-kpis.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dash-kpi { color: var(--text); text-decoration: none !important; min-height: 76px; } .dash-kpi.link { transition: border-color .15s, box-shadow .15s; } .dash-kpi.link:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.dash-kpi .val { font-size: 26px; } .dash-kpis.four .val { font-size: 25px; }
.dash-kpi .lbl .icon { stroke: var(--text-3); }
.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; align-items: start; }
.dash-rent { grid-column: span 6; } .dash-late { grid-column: span 6; } .late-who a { white-space: nowrap; } .dash-status { grid-column: span 4; } .dash-occ { grid-column: span 3; } .dash-events { grid-column: span 5; }
.dash-chart .b-exp { fill: var(--c-prev); } .dash-chart .b-rec { fill: var(--primary); } .dash-chart .hit { fill: transparent; } .dash-chart .hit:hover { fill: color-mix(in srgb, var(--text) 5%, transparent); }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--text-2); margin-right: 6px; }
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: 8px; } .legend .sw:first-child { margin-left: 0; }
.legend .sw.exp { background: var(--c-prev); border: 1px solid var(--border-strong); } .legend .sw.rec { background: var(--primary); }
.days { font-variant-numeric: tabular-nums; font-weight: 650; } .days.hot { color: var(--danger); }
:root { --dash-open: color-mix(in srgb, var(--st-open) 45%, var(--surface)); }
.status-bar { display: flex; gap: 2px; height: 18px; border-radius: 6px; overflow: hidden; background: var(--surface-3); }
.status-bar span { min-width: 6px; }
.status-legend { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 4px; }
.status-legend a { display: grid; grid-template-columns: 110px 40px 1fr; align-items: center; gap: 8px; color: var(--text); text-decoration: none !important; padding: 6px 4px; border-radius: 6px; min-height: 36px; }
.status-legend a:hover { background: var(--surface-2); } .status-legend b { font-variant-numeric: tabular-nums; text-align: right; } .status-legend span:last-child { text-align: right; color: var(--text-3); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.occ { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.occ-ring { --p: 0; width: 132px; height: 132px; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: radial-gradient(closest-side, var(--surface) 76%, transparent 77% 100%), conic-gradient(var(--primary) calc(var(--p) * 1%), var(--surface-3) 0); }
.occ-ring b { font-size: 24px; font-variant-numeric: tabular-nums; } .occ-ring span { font-size: var(--fs-xs); color: var(--text-3); }
.occ-dl { display: grid; grid-template-columns: 1fr auto; gap: 4px 18px; margin: 0; font-size: var(--fs-sm); width: 100%; max-width: 200px; } .occ-dl dt { color: var(--text-3); } .occ-dl dd { margin: 0; text-align: right; font-weight: 650; }
.ev-list .ev { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.ev-ic { width: 30px; height: 30px; border-radius: 8px; background: var(--surface-3); display: grid; place-items: center; } .ev-ic .icon { stroke: var(--text-2); }
.ev-main { min-width: 0; display: flex; flex-direction: column; } .ev-kind { font-size: var(--fs-xs); color: var(--text-3); }
.ev-title { color: var(--text); font-weight: 600; overflow-wrap: anywhere; } .ev-sub { display: block; font-weight: 400; font-size: var(--fs-xs); color: var(--text-3); }
.ev-when { text-align: right; display: flex; flex-direction: column; font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; } .ev-when b { color: var(--text); font-size: var(--fs-sm); }
.ev-when.hot b { color: var(--danger); }
.ev-note { padding: 10px 16px; margin: 0; }
@media (max-width: 1280px) { .dash-kpis.six { grid-template-columns: repeat(3, minmax(0, 1fr)); } .dash-rent, .dash-late { grid-column: span 12; } .dash-status { grid-column: span 6; } .dash-occ { grid-column: span 6; } .dash-events { grid-column: span 12; } }
@media (max-width: 720px) { .dash-kpis.six, .dash-kpis.four { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .dash-kpi .val, .dash-kpis.four .val { font-size: 20px; }
  .dash-status, .dash-occ { grid-column: span 12; } .ev-list .ev { padding: 10px 12px; grid-template-columns: 26px minmax(0, 1fr); } .ev-when { grid-column: 2; text-align: left; flex-direction: row; gap: 8px; }
  .status-legend a { grid-template-columns: 100px 32px 1fr; min-height: 44px; } .dash-rent .card-head .right { margin-left: 0; } }

/* ---------- Settings landing (mockup "Settings"): five large cards + more ---------- */
.settings-main { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.set-card { position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 148px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  color: var(--text); text-decoration: none !important; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s, transform .15s; }
.set-card:hover, .set-card:focus-visible { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }
.set-card b { font-size: var(--fs-lg); margin-top: 6px; } .set-card small { color: var(--text-3); font-size: var(--fs-sm); }
.set-more-h { font-size: var(--fs-md); margin: 26px 0 10px; color: var(--text-2); }
.settings-more { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.set-mini { display: flex; gap: 12px; align-items: center; padding: 12px 14px; min-height: 56px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none !important; }
.set-mini:hover { border-color: var(--primary); } .set-mini > .icon { stroke: var(--primary); flex: none; } .set-mini span { display: flex; flex-direction: column; min-width: 0; } .set-mini small { color: var(--text-3); font-size: var(--fs-xs); }
@media (max-width: 900px) { .settings-main { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .settings-main { grid-template-columns: 1fr; } .set-card { min-height: 0; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 4px 12px; padding: 14px; }
  .set-card b { margin: 0; font-size: var(--fs-md); } .set-card small { flex-basis: 100%; padding-left: 54px; margin-top: -8px; } .set-card .hc-go { opacity: 1; top: 50%; transform: translateY(-50%); } }

/* ---------- Categories (mockup "Categories") ---------- */
.cat-cards { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }
.cat-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; min-height: 96px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface);
  color: var(--text); text-decoration: none !important; box-shadow: var(--shadow-sm); transition: border-color .15s, background .15s; min-width: 0; }
.cat-card .tile-ic { width: 34px; height: 34px; border-radius: 9px; } .cat-card .tile-ic .icon { width: 18px; height: 18px; }
.cat-card b { font-size: var(--fs-sm); overflow-wrap: anywhere; } .cat-card small { font-size: var(--fs-xs); color: var(--text-3); }
.cat-card:hover { border-color: var(--primary); }
.cat-card[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 2px var(--primary-soft); } .cat-card[aria-pressed="true"] b { color: var(--primary); }
.cat-current { display: flex; align-items: center; gap: 6px; margin: 14px 0 10px; font-size: var(--fs-sm); color: var(--text-2); } .cat-current .icon { stroke: var(--primary); }
.cat-tbl tr.inactive td { color: var(--text-3); } .cat-desc { max-width: 380px; color: var(--text-2); }
@media (max-width: 1200px) { .cat-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 600px) { .cat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .cat-card { min-height: 0; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 2px 10px; }
  .cat-card small { flex-basis: 100%; } }

/* ---------- Text templates ---------- */
.tpl-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: var(--gap); align-items: start; }
.tpl-side ul { padding: 6px; } .tpl-side a { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 10px 12px; min-height: 44px; border-radius: 8px; color: var(--text); text-decoration: none !important; }
.tpl-side a:hover { background: var(--surface-2); } .tpl-side a.active { background: var(--primary-soft); } .tpl-side a.active b { color: var(--primary); } .tpl-side b { font-size: var(--fs-sm); font-weight: 600; }
.tpl-flags { display: flex; gap: 4px; flex: none; } .tpl-lang { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 5px; background: var(--surface-3); color: var(--text-2); } .tpl-lang.changed { background: var(--info-bg); color: var(--info); }
.tpl-body { font-family: var(--font); line-height: 1.5; min-height: 260px; resize: vertical; }
.tpl-vars { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; } .tpl-var { height: 30px; font-size: var(--fs-xs); }
.tpl-actions { margin-top: 4px; }
.tpl-paper { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; max-width: 720px; }
.tpl-psubject { font-weight: 700; margin-bottom: 12px; } .tpl-ptext { white-space: pre-wrap; font-size: var(--fs-sm); line-height: 1.6; color: var(--text); }
.tpl-preview [data-warn] { display: grid; gap: 8px; margin-bottom: 10px; } .tpl-preview [data-warn]:empty { display: none; }
@media (max-width: 900px) { .tpl-layout { grid-template-columns: 1fr; } .tpl-side ul { display: flex; overflow-x: auto; gap: 4px; } .tpl-side li { flex: none; } .tpl-side a { white-space: nowrap; } }

/* ---------- Exports ---------- */
.exp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.exp-card .form-grid { grid-template-columns: 1fr; } .exp-count { font-size: var(--fs-xs); color: var(--text-3); } .exp-act .btn { width: 100%; justify-content: center; }
@media (max-width: 1100px) { .exp-grid { grid-template-columns: 1fr; } .exp-card .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .exp-card .form-grid { grid-template-columns: 1fr; } }

/* ---------- Privacy ---------- */
.priv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.priv-reasons { margin: 4px 0 0; padding-left: 16px; }
@media (max-width: 900px) { .priv-grid { grid-template-columns: 1fr; } }

/* ---------- My Landlord Data: letterhead preview, summary ---------- */
.ll-summary { margin: 0; padding: 10px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.lh-preview { display: flex; flex-direction: column; gap: 6px; }
.lh-page { width: 300px; max-width: 100%; aspect-ratio: 1.6; background: #fff; border: 1px solid var(--border-strong); border-radius: 6px; padding: 14px 12px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr; gap: 8px; overflow: hidden; box-shadow: var(--shadow-sm); }
.lh-logo { min-height: 24px; } .lh-logo img { display: block; max-height: 30px; object-fit: contain; object-position: left; }
.lh-mono { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; background: var(--brand); color: #fff; font-weight: 700; font-size: 12px; }
.lh-sender { text-align: right; display: flex; flex-direction: column; font-size: 8px; color: #475569; min-width: 0; } .lh-sender b { color: #0f172a; font-size: 9px; overflow-wrap: anywhere; }
.lh-lines { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; padding-top: 8px; } .lh-lines i { display: block; height: 4px; border-radius: 2px; background: #e2e8f0; } .lh-lines i:nth-child(1) { width: 40%; } .lh-lines i:nth-child(2) { width: 85%; } .lh-lines i:nth-child(3) { width: 70%; }
.lh-form { grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: 260px; } .lh-form input[type=range] { flex: 1; min-width: 90px; accent-color: var(--primary); }
@media (max-width: 640px) { .lh-form { grid-template-columns: 1fr; min-width: 0; } [data-logocard] .card-head .right { margin-left: 0; } }

/* ---------- My Profile ---------- */
.prof-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: var(--gap); } .prof-kpis .val { font-size: 22px; overflow: hidden; text-overflow: ellipsis; }
.prof-mail { font-size: 18px !important; } .prof-scope { display: flex; align-items: center; gap: 6px; margin: -6px 0 12px; }
@media (max-width: 900px) { .prof-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .prof-kpis .val { font-size: 17px; } .prof-mail { font-size: 14px !important; } }

/* ---------- User Management ---------- */
.user-legend { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; } .user-legend .icon { stroke: var(--text-3); }
.team-tbl tr[hidden] { display: none; }

/* ---------- phones: 44 px touch targets on the area pages ---------- */
@media (max-width: 720px) {
  .tpl-var, .cat-tbl .btn-icon, .exp-card .btn, .tpl-actions .btn, [data-logocard] .btn, .priv-grid .btn, .dash-late tbody tr td a { min-height: 44px; }
  .cat-tbl .btn-icon { min-width: 44px; }
}
