/* ==========================================================================
   Eignaumsjón – theme based on the "Property Maintenance Hub" design.
   Colours, type and radii are tokens below; change --accent to re-colour the site.
   Fonts are self-hosted (public/assets/fonts, SIL Open Font License).
   ========================================================================== */

@font-face { font-family: "Inter"; src: url("../fonts/Inter-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-SemiBold.woff2") format("woff2"); font-weight: 600 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("../fonts/SpaceGrotesk-Variable.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }

:root {
    /* Surfaces and text */
    --bg: #F6F5F1;
    --surface: #FFFFFF;
    --surface-alt: #FAFAF7;
    --segment: #EAEAE5;
    --text: #1C1F1D;
    --text-2: #3A403C;
    --muted: #5A615D;
    --border: #E2E3DE;
    --border-input: #C9CCC6;
    --divider: #EEEEEA;

    /* Accent (deep green) */
    --accent: #2F5D50;
    --accent-dark: #1F4238;
    --accent-soft: #E8EFEC;
    --accent-tile: #EEF2EF;
    --on-accent-muted: #DCE7E2;

    /* Status colours: soft background / text / dot */
    --warn-bg: #FBEBDD;  --warn-fg: #8A3D0B;  --warn-dot: #B5651D;
    --info-bg: #E3ECF6;  --info-fg: #1E4470;  --info-dot: #2F68A8;
    --ok-bg: #E6EFEA;    --ok-fg: #24503F;    --ok-dot: #3E7A62;
    --plum-bg: #F1E9F5;  --plum-fg: #4B2A5E;  --plum-dot: #6B4580;
    --neutral-bg: #F1F1EE; --neutral-fg: #4A514D; --neutral-dot: #A9AEA8;
    --bad: #A3301F;      --bad-bg: #FBE9E6;

    /* Type */
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;

    /* Shape */
    --r-sm: 8px;
    --r: 10px;
    --r-card: 14px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.08);
    --wrap: 1280px;
}

/* ---- Base ---------------------------------------------------------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; min-height: 100vh; display: flex; flex-direction: column;
    font-family: var(--font-body); font-size: 15px; line-height: 1.5;
    color: var(--text); background: var(--bg);
}
h1, h2, h3 { font-family: var(--font-display); color: var(--text); }
h1 { font-size: 36px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 8px; }
h2 { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; margin: 32px 0 14px; }
h3 { font-size: 17px; font-weight: 600; margin: 20px 0 6px; }
p { margin: 0 0 12px; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.muted { color: var(--muted); }
.small { font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Header -------------------------------------------------------------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: relative; }
.header-inner {
    max-width: var(--wrap); margin: 0 auto; padding: 12px 24px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.header-left { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand:hover { color: var(--text); }
.brand svg { flex: none; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.brand-assoc { display: flex; flex-direction: column; line-height: 1.2; }
.brand-assoc .assoc-label { font-size: 13px; color: var(--muted); font-weight: 500; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.main-nav a {
    padding: 11px 11px; border-radius: var(--r-sm); color: var(--text-2);
    font-weight: 500; font-size: 15px; text-decoration: none; white-space: nowrap;
}
.main-nav a:hover { background: var(--surface-alt); color: var(--text); }
.main-nav a.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }

.header-right { display: flex; align-items: center; gap: 10px; }
.header-link {
    display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px;
    border: 1px solid var(--border); border-radius: var(--r); color: var(--text-2);
    font-weight: 500; font-size: 14px; text-decoration: none;
}
.header-link:hover { color: var(--text); border-color: var(--border-input); }

.account { position: relative; }
.account summary {
    list-style: none; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px 0 6px;
    border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); cursor: pointer;
}
.account summary::-webkit-details-marker { display: none; }
.account[open] summary, .account summary:hover { border-color: var(--border-input); }
.avatar {
    width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #FFFFFF;
    display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex: none;
}
.account-name { font-size: 14px; font-weight: 500; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 230px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    padding: 6px; display: flex; flex-direction: column;
}
.account-menu .menu-email { padding: 8px 10px 10px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--divider); margin-bottom: 4px; overflow-wrap: anywhere; }
.account-menu a, .account-menu button {
    display: flex; align-items: center; min-height: 40px; padding: 0 10px; border-radius: var(--r-sm);
    font: inherit; font-size: 14px; color: var(--text); text-decoration: none; background: none; border: 0; width: 100%; text-align: left; cursor: pointer;
}
.account-menu a:hover, .account-menu button:hover { background: var(--surface-alt); }
.account-menu form { margin: 0; }

/* Board members have eleven tabs (and Polish names are long): on mid-size screens the account
   button shows only the initials and the tabs tighten; if they still don't fit, they scroll sideways. */
@media (min-width: 761px) {
    .header-inner { flex-wrap: nowrap; }
    .header-left { flex: 1 1 auto; flex-wrap: nowrap; }
    .main-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-width: 0; }
    .main-nav::-webkit-scrollbar { display: none; }
}
@media (min-width: 761px) {
    .header-inner.compact .account-name { display: none; }
    .header-inner.compact .main-nav a { padding: 10px 8px; font-size: 14.5px; }
}
/* Narrow desktops and tablets: the tabs wrap onto a second row rather than hide. */
@media (min-width: 761px) and (max-width: 1180px) {
    .main-nav { flex-wrap: wrap; overflow: visible; }
    .header-left { flex-wrap: wrap; row-gap: 6px; }
}
@media (max-width: 760px) {
    .header-inner { padding: 10px 16px; gap: 10px; }
    .header-left { gap: 10px; width: 100%; padding-right: 64px; }
    .main-nav { flex-wrap: nowrap; overflow-x: auto; width: calc(100% + 64px); padding-bottom: 2px; scrollbar-width: none; }
    .main-nav a { padding: 10px 12px; }
    .header-right { position: absolute; top: 10px; right: 16px; }
    .account-name, .header-link span { display: none; }
}

/* ---- Page frame ---------------------------------------------------------- */
.container { flex: 1; width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 36px 24px 64px; }
@media (max-width: 560px) { .container { padding: 24px 16px 48px; } h1 { font-size: 28px; } }
.site-footer { padding: 20px 24px; color: var(--muted); font-size: 13px; text-align: center; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head h1 { margin: 0; }
.page-head .muted { margin-top: 6px; font-size: 15px; }
.page-head .button { margin-top: 0; }
.page-head + .muted.small { margin-top: -12px; margin-bottom: 20px; }

/* ---- Cards ---------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 24px; }
.card.empty { text-align: center; color: var(--muted); padding: 40px 24px; }
.card.empty .button { margin-top: 8px; }
.card h2:first-child, .card > input[type=hidden]:first-child + h2 { margin-top: 0; }
.section { margin-top: 24px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.section-head h2 { margin: 0; }

/* ---- Flash messages ------------------------------------------------------- */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r); margin-bottom: 20px; font-size: 15px; font-weight: 500; }
.flash::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: currentColor; }
.flash-success { background: var(--ok-bg); color: var(--ok-fg); }
.flash-info { background: var(--info-bg); color: var(--info-fg); }
.flash-warning { background: var(--warn-bg); color: var(--warn-fg); }
.flash-error { background: var(--bad-bg); color: var(--bad); }

/* ---- Buttons --------------------------------------------------------------- */
.button, button.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 46px; padding: 0 18px; margin-top: 20px; border: 0; border-radius: var(--r);
    background: var(--accent); color: #FFFFFF; font: inherit; font-weight: 600; font-size: 15px;
    text-decoration: none; cursor: pointer; white-space: nowrap;
}
.button:hover { background: var(--accent-dark); color: #FFFFFF; }
.button-secondary, a.button-secondary {
    display: inline-flex; align-items: center; height: 46px; padding: 0 18px; margin-left: 10px;
    border: 1px solid var(--border-input); border-radius: var(--r); background: var(--surface);
    color: var(--text); font-weight: 600; text-decoration: none;
}
.button-secondary:hover { border-color: var(--text-2); color: var(--text); }
.button.button-danger { background: var(--bad); }
.button.button-danger:hover { background: #7E2416; }
.link-button { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-button:hover { color: var(--accent-dark); }
.link-button.danger { color: var(--bad); }
.inline-form { display: inline; margin: 0; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; }
.actions .button, .actions form { margin-top: 16px; }
.actions > a:not(.button) { margin-top: 16px; font-weight: 500; }

/* ---- Forms ---------------------------------------------------------------- */
form label { display: block; font-weight: 600; font-size: 14px; margin: 18px 0 6px; }
form input[type=text], form input[type=email], form input[type=password], form input[type=search],
form input[type=date], form input[type=time], form input[type=datetime-local], form select, form textarea {
    width: 100%; min-height: 48px; padding: 0 14px; font: inherit; font-size: 15px; color: var(--text);
    border: 1px solid var(--border-input); border-radius: var(--r); background: var(--surface);
}
form textarea { padding: 12px 14px; line-height: 1.5; resize: vertical; }
form select { padding: 0 12px; }
form input:focus, form select:focus, form textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
form input[readonly] { background: var(--surface-alt); color: var(--muted); }
form input::placeholder, form textarea::placeholder { color: #7A807C; }
form input[type=file] {
    width: 100%; padding: 14px; font: inherit; font-size: 14px;
    border: 1px dashed var(--border-input); border-radius: var(--r); background: var(--surface-alt);
}
form .hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
form fieldset { border: 0; padding: 0; margin: 0 0 24px; }
form legend { font-family: var(--font-display); font-size: 19px; font-weight: 600; margin-bottom: 2px; padding: 0; }
.form { max-width: 600px; }
.form-wide { max-width: 760px; }
.field-error { color: var(--bad); font-size: 14px; font-weight: 500; margin: 6px 0 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

label.checkbox { display: flex; align-items: center; gap: 10px; font-weight: 400; font-size: 15px; margin-top: 16px; cursor: pointer; min-height: 44px; }
label.checkbox input { flex: 0 0 18px; width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.radio-group legend.label { font-family: var(--font-body); font-weight: 600; font-size: 14px; margin-bottom: 0; }
.radio-group label.checkbox { align-items: flex-start; margin-top: 10px; }
.radio-group label.checkbox input { margin-top: 3px; }

.input-small { width: 100%; min-width: 140px; height: 40px; padding: 0 10px; font: inherit; font-size: 14px; border: 1px solid var(--border-input); border-radius: var(--r-sm); }
.num-input { text-align: right; max-width: 120px; }

/* ---- Badges / status pills ---------------------------------------------- */
.badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
    font-size: 13px; font-weight: 600; white-space: nowrap; line-height: 1.5;
    background: var(--neutral-bg); color: var(--neutral-fg);
}
/* Status pills get a dot, like the design */
.badge-pending::before, .badge-urgent::before, [class*="badge-rs-"]::before, [class*="badge-status-"]::before, .badge-cancelled::before {
    content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none;
}
.badge-board, .badge-pinned { background: var(--accent-soft); color: var(--accent-dark); }
.badge-owner { background: var(--neutral-bg); color: var(--neutral-fg); }
.badge-admin { background: var(--info-bg); color: var(--info-fg); }
.badge-pending, .badge-rs-new, .badge-urgent { background: var(--warn-bg); color: var(--warn-fg); }
.badge-pending::before, .badge-rs-new::before, .badge-urgent::before { background: var(--warn-dot); }
.badge-rs-in_progress, .badge-status-planned { background: var(--info-bg); color: var(--info-fg); }
.badge-rs-in_progress::before, .badge-status-planned::before { background: var(--info-dot); }
.badge-rs-done, .badge-status-held { background: var(--ok-bg); color: var(--ok-fg); }
.badge-rs-done::before, .badge-status-held::before { background: var(--ok-dot); }
.badge-rs-rejected, .badge-status-cancelled, .badge-cancelled { background: var(--neutral-bg); color: var(--neutral-fg); }
.badge-rs-rejected::before, .badge-status-cancelled::before, .badge-cancelled::before { background: var(--neutral-dot); }
.badge-internal { background: var(--plum-bg); color: var(--plum-fg); margin-left: 6px; }

/* ---- Segmented filter ------------------------------------------------------ */
.pill-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--segment); border-radius: 12px; margin: 0 0 20px; }
.pill-tabs a { height: 40px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 9px; color: #4A514D; font-weight: 500; font-size: 14px; text-decoration: none; }
.pill-tabs a:hover { color: var(--text); }
.pill-tabs a.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }

/* ---- Tables ---------------------------------------------------------------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); }
table.list { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 15px; }
table.list th, table.list td { text-align: left; padding: 15px 20px; border-bottom: 1px solid var(--divider); vertical-align: top; }
table.list thead th { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; border-bottom-color: var(--border); padding-top: 14px; padding-bottom: 14px; }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list tfoot th { color: var(--text); font-size: 15px; border-top: 1px solid var(--border); border-bottom: 0; background: var(--surface-alt); }
table.list .num { text-align: right; font-variant-numeric: tabular-nums; }
table.list td a { text-decoration: none; }
table.list td a:hover { text-decoration: underline; }
table.list td strong { font-weight: 600; }
.card .table-wrap { border-radius: var(--r); }
.board-member + .board-member { margin-top: 12px; }
.ok { color: var(--ok-fg); font-weight: 600; }
.bad { color: var(--bad); font-weight: 600; }
.bad small { color: var(--muted); font-weight: 400; }

table.checks { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; }
table.checks th, table.checks td { text-align: left; padding: 14px 20px; border-bottom: 1px solid var(--divider); vertical-align: top; }
table.checks tr:last-child th, table.checks tr:last-child td { border-bottom: 0; }
table.checks th { width: 45%; font-weight: 600; }

/* ---- Auth (split screen) -------------------------------------------------- */
.auth-split { min-height: 100vh; display: flex; flex-wrap: wrap; }
.auth-panel {
    flex: 1 1 480px; background: var(--accent); color: #FFFFFF; padding: 56px 64px;
    display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
}
.auth-panel .brand, .auth-panel .brand:hover { color: #FFFFFF; }
.auth-panel .brand-name { font-size: 22px; }
.auth-pitch { max-width: 460px; }
.auth-pitch h2 { color: #FFFFFF; font-size: 46px; line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 18px; }
.auth-pitch p { color: var(--on-accent-muted); font-size: 17px; line-height: 1.55; margin: 0; }
.auth-features { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px 32px; font-size: 14px; color: var(--on-accent-muted); }
.auth-features li { display: flex; align-items: center; gap: 8px; }
.auth-main { flex: 1 1 480px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 24px; }
.auth-box { width: 100%; max-width: 400px; }
.auth-box h1 { font-size: 30px; letter-spacing: -0.01em; margin: 0 0 8px; }
.auth-box .lead { color: var(--muted); font-size: 15px; margin: 0 0 8px; }
.auth-box form .button { width: 100%; height: 50px; font-size: 16px; margin-top: 24px; }
.auth-box .label-row { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 0 6px; }
.auth-box .label-row label { margin: 0; }
.auth-box .label-row a { font-size: 14px; }
.auth-box .below { text-align: center; color: var(--muted); font-size: 14px; margin-top: 20px; }
.auth-box .flash { margin-bottom: 16px; }
.auth-box .button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.auth-box .button-row .button { margin-top: 0; }
.auth-box .button-row .button-secondary { margin-left: 0; }
@media (max-width: 760px) {
    .auth-panel { padding: 28px 24px; gap: 20px; flex-basis: 100%; }
    .auth-pitch h2 { font-size: 28px; margin-bottom: 8px; }
    .auth-pitch p { font-size: 15px; }
    .auth-features { display: none; }
    .auth-main { padding: 32px 16px 48px; align-items: flex-start; }
}

/* ---- Association overview ------------------------------------------------- */
.overview-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; }
@media (max-width: 860px) { .overview-grid { grid-template-columns: 1fr; } }
.overview-grid h2:first-child { margin-top: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stats-stack { grid-template-columns: 1fr; }
@media (max-width: 860px) { .stats-stack { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); } }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 20px 24px; text-decoration: none; color: var(--text); }
.stat:hover { border-color: var(--border-input); color: var(--text); }
.stat-value { font-family: var(--font-display); font-size: 34px; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
.stat-label { color: var(--muted); font-size: 15px; }
.stat-note { font-size: 13px; color: var(--muted); margin-top: 6px; }
.stat-note.warn { color: var(--warn-fg); font-weight: 600; }
.next-meeting { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; text-decoration: none; background: var(--accent); border-color: var(--accent); }
.next-meeting, .next-meeting:hover { color: #FFFFFF; }
.next-meeting .muted { color: var(--on-accent-muted); }
.next-meeting strong { font-family: var(--font-display); font-size: 20px; font-weight: 600; }

.association-list { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 12px; }
.association-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px; }
.association-list a { color: var(--text); text-decoration: none; }
.association-list a:hover { color: var(--accent); }

/* ---- Announcements -------------------------------------------------------- */
.announcement { margin-bottom: 12px; }
.announcement h3 { margin: 0 0 2px; font-size: 18px; }
.announcement h3 a { color: var(--text); text-decoration: none; }
.announcement h3 a:hover { color: var(--accent); }
.announcement.pinned { border-color: #CFDDD6; box-shadow: inset 0 3px 0 var(--accent); }
.announcement .badge-pinned { margin-bottom: 8px; }
.announcement-full h1 { margin-top: 6px; font-size: 32px; }
.prose { margin-top: 12px; overflow-wrap: anywhere; font-size: 15px; }
.prose p { margin: 0 0 10px; }
.prose p:last-child { margin-bottom: 0; }
.pager { display: flex; justify-content: center; align-items: center; gap: 20px; margin-top: 20px; }

/* ---- Documents ------------------------------------------------------------- */
details.upload { margin-bottom: 24px; }
details.upload summary { cursor: pointer; font-weight: 600; color: var(--accent); list-style: none; display: flex; align-items: center; gap: 10px; min-height: 28px; }
details.upload summary::-webkit-details-marker { display: none; }
details.upload summary::before { content: "+"; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 7px; background: var(--accent-soft); font-weight: 700; }
details.upload[open] summary::before { content: "–"; }
details.upload[open] summary { margin-bottom: 4px; }
.doc-folder h2 { margin: 28px 0 10px; }
.doc-list { list-style: none; margin: 0; padding: 0 20px; }
.doc-list li { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--divider); }
.doc-list li:last-child { border-bottom: 0; }
.file-type {
    flex: 0 0 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; letter-spacing: 0.02em; color: var(--accent); background: var(--accent-tile); border-radius: var(--r);
}
.doc-main { flex: 1; min-width: 0; }
.doc-main a { text-decoration: none; color: var(--text); }
.doc-main a:hover { color: var(--accent); text-decoration: underline; }
.doc-actions { display: flex; gap: 16px; align-items: center; white-space: nowrap; }
.doc-link { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 500; }

/* ---- Units / members -------------------------------------------------------- */
.owner-list { list-style: none; padding: 0; margin: 0 0 8px; }
.owner-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--divider); }
.section > .hint { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.danger-zone { border-color: #EBC9C3; }
.role-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.role-form select, .role-form input[type=text] { width: auto; min-height: 40px; height: 40px; padding: 0 10px; font-size: 14px; border-radius: var(--r-sm); }
.role-form input[type=text] { width: 150px; }

/* ---- Meetings ---------------------------------------------------------------- */
.meeting-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.meeting-row { display: flex; align-items: center; gap: 16px; padding: 14px 20px; }
.meeting-date { flex: 0 0 64px; height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: var(--r); background: var(--accent-tile); line-height: 1.15; }
.meeting-date .day { font-family: var(--font-display); font-size: 24px; font-weight: 600; color: var(--accent-dark); }
.meeting-date .mon { font-size: 12px; color: var(--muted); }
.meeting-main { flex: 1; min-width: 0; }
.meeting-main a { color: var(--text); text-decoration: none; font-size: 16px; }
.meeting-main a:hover { color: var(--accent); }
.board-panel { margin-bottom: 16px; }
.board-panel h2 { margin-top: 0; }
.notice-check { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0; font-weight: 600; padding: 10px 14px; border-radius: var(--r); }
.notice-check::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: currentColor; }
.notice-check.ok { background: var(--ok-bg); color: var(--ok-fg); }
.notice-check.warn { background: var(--warn-bg); color: var(--warn-fg); }
.notice-check.bad { background: var(--bad-bg); color: var(--bad); }
.board-actions { margin-top: 8px; }
ol.agenda { margin: 0; padding-left: 1.4em; }
ol.agenda li { padding: 10px 0; border-bottom: 1px solid var(--divider); }
ol.agenda li:last-child { border-bottom: 0; }
.decision { margin-top: 8px; padding: 10px 14px; background: var(--ok-bg); border-radius: var(--r-sm); font-size: 15px; }
.decision .prose, .decision p { margin: 0; display: inline; }
.decision-label { font-weight: 600; color: var(--ok-fg); }
table.attendance td { vertical-align: middle; }
table.attendance input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }

/* ---- Cost splitting ------------------------------------------------------- */
.methods { margin-top: 20px; }
.methods label.method { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r); align-items: flex-start; }
.methods label.method input { margin-top: 3px; }
.methods label.method:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.methods label.method span strong { display: block; }
.usage-col { display: none; }
.method-c .usage-col { display: table-cell; }
.result { box-shadow: inset 0 3px 0 var(--ok-dot); }
.result h2 { margin-top: 0; }
table.cost-lines .amount { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
table.cost-lines tfoot .amount { font-size: 16px; }

/* ---- Maintenance reports --------------------------------------------------- */
.report-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.report-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; }
.report-row.priority-urgent { box-shadow: inset 3px 0 0 var(--warn-dot); }
.report-main { min-width: 0; }
.report-main a { color: var(--text); text-decoration: none; font-size: 16px; }
.report-main a:hover { color: var(--accent); }
.report-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 16px; }
.photo-grid img { width: 100%; height: 150px; object-fit: cover; border-radius: var(--r); border: 1px solid var(--border); display: block; }
ol.timeline { list-style: none; padding: 0; margin: 0 0 16px; border-left: 2px solid var(--border); }
ol.timeline li { position: relative; padding: 10px 14px 14px 20px; }
ol.timeline li::before { content: ""; position: absolute; left: -7px; top: 15px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
ol.timeline li.internal { background: var(--plum-bg); border-radius: 0 var(--r) var(--r) 0; }
ol.timeline li.internal::before { border-color: var(--plum-dot); }
.status-change { margin-top: 4px; font-size: 15px; display: flex; align-items: center; gap: 8px; }

/* ---- Addresses ------------------------------------------------------------- */
.head-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.head-actions .button { margin-top: 0; }
.head-actions .button-secondary { margin-left: 0; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.toolbar .pill-tabs { margin: 0; }
.search { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border: 1px solid var(--border-input); border-radius: var(--r); background: var(--surface); flex: 0 1 320px; margin-left: auto; }
.search input[type=search] { border: 0; outline: none; min-height: 0; height: 40px; padding: 0; font: inherit; font-size: 15px; width: 100%; background: transparent; }
.search:focus-within { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
table.list tr.group-row th { background: var(--surface-alt); color: var(--text); font-size: 14px; font-weight: 600; text-transform: none; letter-spacing: 0; padding-top: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
table.list tr.group-row th .muted { font-weight: 500; }

.address-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.address-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; }
.address-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; flex: 1 1 420px; }
.address-edit input[type=text] { width: auto; flex: 1 1 200px; min-height: 44px; }
.address-edit input.postcode { flex: 0 1 180px; }
.address-meta { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.order-buttons { display: inline-flex; gap: 4px; }
.icon-button { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--text-2); cursor: pointer; }
.icon-button:hover:not(:disabled) { border-color: var(--border-input); color: var(--text); }
.icon-button:disabled { opacity: 0.35; cursor: default; }

.quick-select { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -4px 0 10px; }
.chip-button { height: 32px; padding: 0 12px; border: 1px solid var(--border-input); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.chip-button:hover { border-color: var(--accent); color: var(--accent-dark); }
.address-meta > a { min-width: 120px; text-align: right; }
@media (max-width: 760px) {
    .search { flex: 1 1 100%; margin-left: 0; }
    .head-actions { width: 100%; }
}

/* ---- Team ------------------------------------------------------------------ */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.team-card header { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.team-card h2 { margin: 0; font-size: 18px; }
.team-card h2 a { color: var(--text); text-decoration: none; }
.team-card h2 a:hover { color: var(--accent); }
.avatar-lg { width: 44px; height: 44px; font-size: 17px; }
.avatar-contractor { background: var(--accent-tile); color: var(--accent-dark); }
.team-facts { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; margin: 0; font-size: 14px; }
.team-facts dt { color: var(--muted); font-weight: 500; }
.team-facts dd { margin: 0; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-size: 13px; font-weight: 500; }
.team-tasks-note { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--divider); }
.segmented { display: inline-flex; gap: 4px; padding: 4px; background: var(--segment); border-radius: 12px; margin-top: 8px; }
.segmented label { margin: 0; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented span { display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border-radius: 9px; font-weight: 500; font-size: 14px; color: #4A514D; }
.segmented input:checked + span { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 16px; }
.check-grid label.checkbox { margin-top: 4px; min-height: 40px; }
.access-box { margin-top: 24px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-alt); }
.access-box label.checkbox { margin-top: 0; }
.access-box .hint { margin-top: 2px; }

/* ---- Tasks ----------------------------------------------------------------- */
/* Status pills: New = blue, Assigned = plum, In progress = orange, Waiting = grey, Done = green */
.badge-ts-new { background: var(--info-bg); color: var(--info-fg); }
.badge-ts-new::before { background: var(--info-dot); }
.badge-ts-assigned { background: var(--plum-bg); color: var(--plum-fg); }
.badge-ts-assigned::before { background: var(--plum-dot); }
.badge-ts-in_progress { background: var(--warn-bg); color: var(--warn-fg); }
.badge-ts-in_progress::before { background: var(--warn-dot); }
.badge-ts-waiting { background: var(--neutral-bg); color: var(--neutral-fg); }
.badge-ts-waiting::before { background: var(--neutral-dot); }
.badge-ts-done { background: var(--ok-bg); color: var(--ok-fg); }
.badge-ts-done::before { background: var(--ok-dot); }
[class*="badge-ts-"]::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.badge-prio-high { background: var(--warn-bg); color: var(--warn-fg); }
.badge-prio-urgent { background: var(--bad-bg); color: var(--bad); }
.overdue-text, .task-due.overdue, .task-card-due.overdue { color: var(--bad); font-weight: 600; }

.pill-tabs-compact { margin: 0; }
.pill-tabs-compact a { height: 38px; padding: 0 14px; }
.quick-views { margin-bottom: 14px; }
.quick-views .count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: rgba(0, 0, 0, 0.06); font-size: 12px; font-weight: 600; }
.quick-views a.has-warn .count { background: var(--bad-bg); color: var(--bad); }

.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 20px; }
.filter-bar select, .filter-bar input[type=search] { width: auto; min-height: 40px; height: 40px; font-size: 14px; padding: 0 10px; flex: 0 1 auto; max-width: 220px; }
.filter-bar input[type=search] { flex: 1 1 180px; max-width: 280px; }
.button.button-small, button.button.button-small { height: 40px; margin-top: 0; padding: 0 16px; font-size: 14px; }

.task-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.task-row { display: grid; grid-template-columns: minmax(0, 1fr) 180px 150px 220px; align-items: center; gap: 16px; padding: 14px 20px; }
.task-row.priority-urgent { box-shadow: inset 3px 0 0 var(--bad); }
.task-row.priority-high { box-shadow: inset 3px 0 0 var(--warn-dot); }
.task-row.is-done .task-main a { color: var(--muted); }
.task-main { min-width: 0; }
.task-main a { color: var(--text); text-decoration: none; font-size: 16px; }
.task-main a:hover { color: var(--accent); }
.task-assignee { display: flex; align-items: center; gap: 8px; font-size: 14px; min-width: 0; }
.task-assignee span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-due { font-size: 14px; display: flex; flex-direction: column; }
.avatar-sm { width: 28px; height: 28px; font-size: 12px; flex: none; }
.avatar-xs { width: 22px; height: 22px; font-size: 11px; flex: none; }
@media (max-width: 860px) {
    .task-row { grid-template-columns: 1fr auto; gap: 6px 12px; }
    .task-row .task-main { grid-column: 1 / -1; }
    .task-row .report-badges { grid-column: 2; grid-row: 2 / span 2; align-self: start; }
}

/* Board view (kanban): five columns, scrolls sideways on small screens */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.kanban-col { background: var(--segment); border-radius: var(--r-card); padding: 10px; display: grid; gap: 8px; min-height: 120px; }
.kanban-col > header { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 4px; }
.kanban-empty { margin: 0; padding: 16px 8px; text-align: center; color: var(--muted); font-size: 13px; }
.task-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 12px; display: grid; gap: 6px; justify-items: start; }
.task-card.priority-urgent { box-shadow: inset 3px 0 0 var(--bad); }
.task-card.priority-high { box-shadow: inset 3px 0 0 var(--warn-dot); }
.task-card-title { color: var(--text); text-decoration: none; font-weight: 600; line-height: 1.35; }
.task-card-title:hover { color: var(--accent); }
.task-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; font-size: 13px; }
.task-card-who { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.task-card-due { white-space: nowrap; color: var(--text-2); }
.task-card-move { display: flex; gap: 4px; width: 100%; justify-content: flex-end; border-top: 1px solid var(--divider); padding-top: 6px; }
.icon-button-sm { width: 30px; height: 28px; font-size: 14px; }

/* Task page */
.task-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.task-layout aside .card h2 { margin-top: 0; }
.task-layout article.card > .prose:first-child { margin-top: 0; }
@media (max-width: 900px) { .task-layout { grid-template-columns: 1fr; } .task-layout aside { order: -1; } }
.task-facts-card .team-facts { grid-template-columns: 100px 1fr; }
.task-created { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--divider); }
.task-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 14px; }
.task-actions .button-secondary { margin-left: 0; height: 42px; font: inherit; font-weight: 600; cursor: pointer; }
.entry-chips { margin-top: 8px; }
.chip-neutral { background: var(--neutral-bg); color: var(--neutral-fg); }
.from-report { padding: 12px 16px; border-radius: var(--r); background: var(--accent-tile); margin-bottom: 4px; }
.from-report .hint { margin-top: 4px; }
[data-for-scope][hidden] { display: none; }
h2.first-heading { margin-top: 0; }

/* Team cards: workload */
.team-load { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--divider); }
.team-load > a { margin-left: auto; }

/* ---- Resident notices (shut-offs) ----------------------------------------- */
.notice-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.notice-row { display: flex; align-items: center; gap: 16px; padding: 14px 20px; }
.notice-row.is-cancelled .notice-main a { text-decoration: line-through; color: var(--muted); }
.notice-main { flex: 1; min-width: 0; }
.notice-main a { color: var(--text); text-decoration: none; font-size: 16px; }
.notice-main a:hover { color: var(--accent); }
.date-tile { flex: none; width: 54px; height: 58px; border-radius: var(--r); background: var(--info-bg); color: var(--info-fg); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.date-day { font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.date-month { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.notice-electricity .date-tile, .notice-heating .date-tile, .notice-hot_water .date-tile { background: var(--warn-bg); color: var(--warn-fg); }
.notice-elevator .date-tile, .notice-access .date-tile, .notice-noise .date-tile, .notice-other .date-tile { background: var(--plum-bg); color: var(--plum-fg); }
.chip-kind { background: var(--neutral-bg); color: var(--neutral-fg); }
.badge-notice-draft { background: var(--warn-bg); color: var(--warn-fg); }
.badge-notice-sent { background: var(--ok-bg); color: var(--ok-fg); }
.badge-notice-cancelled { background: var(--bad-bg); color: var(--bad); }
.badge-notice-now { background: var(--bad-bg); color: var(--bad); }
@media (max-width: 640px) { .notice-row { flex-wrap: wrap; } .notice-row .report-badges { width: 100%; justify-content: flex-start; padding-left: 70px; } }

.kind-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.kind-option { margin: 0 !important; cursor: pointer; }
.kind-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.kind-option span { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border: 1px solid var(--border-input); border-radius: 999px; font-weight: 500; font-size: 14px; background: var(--surface); }
.kind-option input:checked + span { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.kind-option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.scope-pick { margin-top: 12px; }
.unit-group + .unit-group { margin-top: 10px; }
.unit-group-head { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; margin-top: 6px; }

.send-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 16px 20px; margin-bottom: 20px; border-radius: var(--r-card); background: var(--warn-bg); color: var(--warn-fg); }
.send-box .button { margin-top: 0; }
.send-box .field-error { margin: 0; }
.notice-facts { font-size: 15px; grid-template-columns: 110px 1fr; }
.notice-body { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--divider); }
.task-actions-top { margin-top: 0; margin-bottom: 0; }

.notice-card { margin-bottom: 12px; padding: 20px; box-shadow: inset 0 3px 0 var(--warn-dot); }
.notice-card .section-head { margin-bottom: 8px; }
.notice-card h2 { font-size: 17px; }
.notice-mini { display: grid; gap: 1px; padding: 10px 0; color: var(--text); text-decoration: none; border-top: 1px solid var(--divider); }
.notice-mini:hover strong { color: var(--accent); }
.notice-mini-static { padding: 14px 18px; margin-bottom: 8px; }

/* ---- Repeating tasks ------------------------------------------------------- */
.schedule-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 180px 170px auto; align-items: center; gap: 16px; padding: 14px 20px; }
.schedule-row.is-paused { opacity: 0.65; }
.schedule-icon { width: 40px; height: 40px; border-radius: var(--r); background: var(--accent-tile); color: var(--accent-dark); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 600; }
.schedule-next { display: flex; flex-direction: column; align-items: flex-start; font-size: 14px; }
.schedule-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
@media (max-width: 960px) {
    .schedule-row { grid-template-columns: 40px 1fr; }
    .schedule-row > :not(.schedule-icon):not(.task-main) { grid-column: 2; }
    .schedule-actions { flex-direction: row; gap: 16px; align-items: center; }
}
.schedule-layout { display: grid; grid-template-columns: minmax(0, 760px) minmax(0, 1fr); gap: 24px; align-items: start; }
.schedule-layout aside .card h2 { margin-top: 0; }
@media (max-width: 1000px) { .schedule-layout { grid-template-columns: 1fr; } }
.repeat-box { margin-bottom: 0; }
.repeat-every { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; font-weight: 500; }
.repeat-every .input-small { width: auto; min-width: 0; height: 44px; }
.repeat-every input.num-input { width: 80px; }
.date-list { margin: 0; padding-left: 1.3em; display: grid; gap: 4px; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plain-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.repeat-mark { color: var(--accent); font-weight: 600; }

/* ---- Calendar ---------------------------------------------------------------- */
.cal-head { align-items: center; }
.cal-filter select { width: auto; min-height: 42px; height: 42px; font-size: 14px; padding: 0 10px; border: 1px solid var(--border-input); border-radius: var(--r); background: var(--surface); font-family: inherit; }
.month-nav { display: flex; align-items: center; gap: 8px; }
.month-nav .icon-button { width: 42px; height: 42px; font-size: 20px; text-decoration: none; }
.month-name { font-family: var(--font-display); font-size: 20px; font-weight: 600; min-width: 150px; text-align: center; }
.button-today { height: 42px !important; margin-left: 4px !important; }

.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--border); gap: 1px; border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; }
.cal-weekday { background: var(--surface-alt); padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.cal-day { position: relative; background: var(--surface); min-height: 112px; padding: 6px 6px 8px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.weekend { background: #FCFCFA; }
.cal-day.other-month { background: var(--surface-alt); }
.cal-day.other-month .cal-date { color: #A3A8A4; }
.cal-day.is-selected { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-date { align-self: flex-start; display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text-2); text-decoration: none; }
.cal-date::after { content: ""; position: absolute; inset: 0; }          /* the whole cell opens the day */
.cal-day.is-today .cal-date { background: var(--accent); color: #FFFFFF; }
.cal-day:hover { background: var(--surface-alt); }
.cal-ev, .cal-more { position: relative; z-index: 1; }
.cal-ev { display: block; padding: 2px 6px; border-radius: 6px; font-size: 12px; font-weight: 500; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; border-left: 3px solid transparent; }
.cal-ev:hover { filter: brightness(0.96); }
.ev-time { font-weight: 600; margin-right: 3px; }
.cal-more { font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 6px; text-decoration: none; }
.cal-more:hover { color: var(--accent); }

/* Event colours, shared by the grid, the day panel and the legend */
.ev-task { background: var(--info-bg); color: var(--info-fg); border-left-color: var(--info-dot); }
.ev-ts-assigned { background: var(--plum-bg); color: var(--plum-fg); border-left-color: var(--plum-dot); }
.ev-ts-in_progress { background: var(--warn-bg); color: var(--warn-fg); border-left-color: var(--warn-dot); }
.ev-ts-waiting { background: var(--neutral-bg); color: var(--neutral-fg); border-left-color: var(--neutral-dot); }
.ev-ts-done { background: var(--ok-bg); color: var(--ok-fg); border-left-color: var(--ok-dot); text-decoration: line-through; }
.ev-task.ev-overdue { background: var(--bad-bg); color: var(--bad); border-left-color: var(--bad); }
.ev-repeat { background: var(--surface); color: var(--text-2); border: 1px dashed var(--border-input); border-left: 3px dashed var(--accent); }
.ev-notice { background: #FFF4D6; color: #6B4A00; border-left-color: #C89211; }
.ev-notice-draft { opacity: 0.7; border-left-style: dashed; }
.ev-notice-cancelled, .ev-cancelled { text-decoration: line-through; opacity: 0.6; }
.ev-meeting { background: var(--accent); color: #FFFFFF; border-left-color: var(--accent-dark); }

.cal-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0; margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.cal-legend li { display: flex; align-items: center; gap: 6px; }
.cal-legend .dot { width: 14px; height: 14px; border-radius: 4px; border-left-width: 3px; border-left-style: solid; }
.cal-legend .dot.ev-repeat { border-left-style: dashed; }

.cal-day-panel { position: sticky; top: 16px; padding: 20px; }
.cal-day-panel h2 { margin: 0 0 12px; font-size: 19px; }
.cal-day-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cal-item { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--r); text-decoration: none; border-left: 0 !important; }
.cal-item:hover { filter: brightness(0.97); }
.cal-item-bar { flex: none; width: 4px; border-radius: 2px; background: currentColor; opacity: 0.55; }
.cal-item-body { display: grid; gap: 1px; min-width: 0; }
.cal-item-body strong { font-size: 14px; }
.cal-item.ev-meeting .muted { color: var(--on-accent-muted); }
.cal-item.ev-repeat { border: 1px dashed var(--border-input) !important; }
.cal-day-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--divider); }
.cal-day-actions .button { margin-top: 0; }
.button-small-secondary { height: 40px !important; margin-left: 0 !important; font-size: 14px; padding: 0 14px !important; }

.cal-agenda { display: none; }
@media (max-width: 1000px) { .cal-layout { grid-template-columns: 1fr; } .cal-day-panel { position: static; } }
@media (max-width: 760px) {
    .cal-layout { display: none; }
    .cal-agenda { display: grid; gap: 18px; }
    .cal-agenda h3 { margin: 0 0 8px; font-size: 16px; }
    .cal-agenda-day.is-today h3 { color: var(--accent); }
    .cal-agenda .button { justify-self: start; margin-top: 0; }
    .month-name { min-width: 0; font-size: 18px; }
}

/* ---- Residents ----------------------------------------------------------------- */
.row-actions { display: flex; align-items: center; gap: 14px; }
.add-resident { margin-top: 18px; }
.add-resident > summary { list-style: none; cursor: pointer; margin-left: 0; display: inline-flex; }
.add-resident > summary::-webkit-details-marker { display: none; }
.add-resident[open] > summary { margin-bottom: 4px; }
.former-residents { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--divider); }
.former-residents summary { cursor: pointer; color: var(--muted); margin-bottom: 8px; }
table.directory td { vertical-align: middle; padding-top: 11px; padding-bottom: 11px; }
table.directory tr.same-unit td { border-top: 0; }
table.directory .nowrap { white-space: nowrap; }
.badge.role-owner { background: var(--accent-soft); color: var(--accent-dark); }
.badge.role-tenant { background: var(--info-bg); color: var(--info-fg); }
.badge { vertical-align: 1px; }
.input-phone { max-width: 260px; }
.unit-people { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--divider); display: grid; gap: 4px; }

/* ---- Language switch --------------------------------------------------------- */
.site-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 20px; }
.lang-switch { display: inline-flex; gap: 2px; margin: 0; }
.lang-switch button { background: none; border: 0; padding: 4px 8px; border-radius: 6px; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; }
.lang-switch button:hover { color: var(--text); background: var(--surface-alt); }
.lang-switch button.active { color: var(--accent-dark); font-weight: 600; background: var(--accent-soft); }
.auth-main .lang-switch { margin-top: 28px; justify-content: center; width: 100%; }

/* ---- Super admin: Stillingar ---------------------------------------------- */
.settings-key .code-line, .smtp-log { font: 13px/1.5 ui-monospace, Consolas, monospace; background: var(--neutral-bg); border-radius: 8px; padding: 10px 12px; overflow-x: auto; white-space: pre; margin: 8px 0; }
.smtp-log { max-height: 320px; overflow-y: auto; white-space: pre-wrap; word-break: break-all; }
.settings-key { border-left: 4px solid var(--warn-dot); margin-bottom: 20px; }
.test-result { margin-bottom: 20px; border-left: 4px solid var(--ok-dot); }
.test-result.is-bad { border-left-color: var(--bad); }
.test-result h2 { font-size: 18px; margin: 0 0 6px; }
.test-result.is-ok h2 { color: var(--ok-fg); }
.test-result.is-bad h2 { color: var(--bad); }
.test-error { font-weight: 600; }
.test-result summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.settings-test { margin: 8px 0 20px; padding-top: 16px; border-top: 1px solid var(--divider); max-width: 420px; }
.settings-reset { margin-top: 12px; font-size: 14px; }
.settings-links { display: flex; gap: 12px; flex-wrap: wrap; }
.settings-actions .button, .settings-actions .button-secondary, .settings-links .button, .settings-links .button-secondary { margin: 0; font-size: 15px; }
.settings-general { margin-bottom: 20px; }
.settings-general .settings-actions { margin-top: 16px; }
.settings-general fieldset { margin-bottom: 0; }
