/* Section colours (1 Dec 2026): every page takes the colour of its menu section, so people know where they are.
   Colour carries meaning: the section (header band, key figures, card headings) and state (status chips, red
   for late). Set on <main class="content" data-sec="…"> from the menu section. */
.content { --sec: #1565c0; --sec-2: #3b82f6; --sec-ink: #0b3d82; --sec-soft: #eaf1fc; }
.content[data-sec="front-office"]   { --sec: #a21caf; --sec-2: #d946ef; --sec-ink: #701a75; --sec-soft: #fbeefd; }
.content[data-sec="portfolio"]      { --sec: #0e7490; --sec-2: #06b6d4; --sec-ink: #155e75; --sec-soft: #e6f7fa; }
.content[data-sec="leasing"]        { --sec: #4338ca; --sec-2: #6366f1; --sec-ink: #312e81; --sec-soft: #eef0fd; }
.content[data-sec="billing"]        { --sec: #1d4ed8; --sec-2: #3b82f6; --sec-ink: #1e3a8a; --sec-soft: #eaf1fd; }
.content[data-sec="facilities"]     { --sec: #0f766e; --sec-2: #14b8a6; --sec-ink: #134e4a; --sec-soft: #e7f6f3; }
.content[data-sec="payments"]       { --sec: #047857; --sec-2: #10b981; --sec-ink: #064e3b; --sec-soft: #e8f7ef; }
.content[data-sec="expenditure"]    { --sec: #c2410c; --sec-2: #f59e0b; --sec-ink: #7c2d12; --sec-soft: #fdf1e7; }
.content[data-sec="hr"]             { --sec: #be123c; --sec-2: #fb7185; --sec-ink: #881337; --sec-soft: #fdecef; }
.content[data-sec="reports"]        { --sec: #7e22ce; --sec-2: #a855f7; --sec-ink: #581c87; --sec-soft: #f5edfd; }
.content[data-sec="settings"],
.content[data-sec="administration"] { --sec: #334155; --sec-2: #64748b; --sec-ink: #1e293b; --sec-soft: #eef1f5; }

.crumbs .c-sec { color: var(--sec); }

/* the header band: title, status and actions on the section colour */
.content > .page-head {
  background: linear-gradient(120deg, var(--sec) 0%, var(--sec-2) 100%); color: #fff;
  padding: 20px 22px; border-radius: 18px; align-items: center;
  box-shadow: 0 18px 36px -24px color-mix(in srgb, var(--sec) 80%, #000);
}
.content > .page-head h1 { color: #fff; background: none; -webkit-background-clip: initial; background-clip: initial;
  -webkit-text-fill-color: #fff; }
.content > .page-head h1 .badge { -webkit-text-fill-color: initial; }
.content > .page-head .sub, .content > .page-head .muted, .content > .page-head > div:first-child { color: rgba(255, 255, 255, .88); }
.content > .page-head .sub b { color: #fff; }
.content > .page-head > div:first-child a { color: #fff; }
.content > .page-head .small.muted { color: rgba(255, 255, 255, .85); }
.content > .page-head .small.muted a { color: #fff; background: rgba(255, 255, 255, .18); }
.content > .page-head .small.muted a:hover { background: rgba(255, 255, 255, .28); }
.content > .page-head .actions .btn, .content > .page-head .actions summary.btn {
  background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .38); color: #fff; box-shadow: none; }
.content > .page-head .actions .btn:hover, .content > .page-head .actions summary.btn:hover {
  background: rgba(255, 255, 255, .28); }
.content > .page-head .actions .btn.primary { background: #fff; border-color: #fff; color: var(--sec-ink); font-weight: 700; }
.content > .page-head .actions .btn.primary:hover { background: #f1f5f9; }
.content > .page-head .actions .btn.danger { background: #fff; border-color: #fff; color: #dc2626; }
.content > .page-head .actions .btn.ghost { background: transparent; }
.content > .page-head details.menu[open] > summary { background: rgba(255, 255, 255, .3); border-color: #fff; }
.content > .page-head .menu-list a, .content > .page-head .menu-list button { color: #1e293b; }
.content > .page-head .menu-list a.danger { color: #dc2626; }
.content > .page-head .btn svg { color: currentColor; }

/* key figures in the section's tint */
.content .kpi { background: var(--sec-soft); border-color: color-mix(in srgb, var(--sec) 14%, transparent); box-shadow: none; }
.content .kpi .label { color: var(--sec-ink); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; font-size: 11px; }
.content .kpi .value { color: #0f172a; }
.content .kpi.alert, .content .kpi.bad { background: #fdecec; border-color: #f8c9c9; }
.content .kpi.alert .label, .content .kpi.bad .label { color: #b42318; }
.content .kpi.bad .value { color: #b42318; }
.content .kpi.warn { background: #fdf3e2; border-color: #f6d9a8; }
.content .kpi.warn .label, .content .kpi.warn .value { color: #a35a00; }
.content .kpi.ok { background: #e8f6ee; border-color: #bfe6cf; }
.content .kpi.ok .label { color: #15803d; }

/* card headings carry a small section mark */
.content .card > h2:first-child { color: #0f172a; }
.content .card > h2:first-child::before { content: ""; display: block; flex: none; width: 10px; height: 10px; border-radius: 3px;
  background: linear-gradient(135deg, var(--sec), var(--sec-2)); margin-right: 2px; order: -1; }
.content .card > h2:first-child { justify-content: flex-start; }
.content .card > h2:first-child > span:last-child:not(:first-child), .content .card > h2:first-child > .actions { margin-left: auto; }

/* list tabs follow the section */
.list-tabs a.on { background: var(--sec); border-color: var(--sec); }
.list-tabs a:hover { border-color: var(--sec-2); color: var(--sec); }

/* the record page: grouped fields */
.rec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.rec-grid .card { margin-bottom: 0; }
.rec-grid .card.wide { grid-column: 1 / -1; }
.rec-card h2 { display: flex; align-items: center; gap: 10px; font-size: 15px; margin: 0 0 12px; }
.content .rec-card > h2:first-child::before { display: none; }
.rec-card h2 .ri { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--sec), var(--sec-2)); color: #fff; }
.rec-card h2 .ri svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round;
  stroke-linejoin: round; }
.rec-card dl.facts { grid-template-columns: minmax(110px, 40%) 1fr; gap: 0; }
.rec-card dl.facts dt, .rec-card dl.facts dd { padding: 8px 0; border-bottom: 1px dashed #e7ebf2; }
.rec-card dl.facts dt:nth-last-of-type(1), .rec-card dl.facts dd:last-of-type { border-bottom: 0; }
.rec-card dl.facts dd { font-weight: 500; color: #0f172a; }
.yn { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: 12.5px;
  font-weight: 600; }
.yn::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.yn.yes { background: #e8f6ee; color: #15803d; }
.yn.no { background: #f1f5f9; color: #64748b; }
.rec-meta { color: #94a3b8; font-size: 12.5px; margin: 14px 2px 0; }
.rec-head-status { margin-left: 8px; }
@media (max-width: 900px) { .rec-grid { grid-template-columns: 1fr; } }

/* the list's search button follows the section */
.content .toolbar .btn.primary { background: var(--sec); border-color: var(--sec); }
.content .toolbar .btn.primary:hover { background: var(--sec-ink); }


/* modern forms (2 Dec 2026): soft filled inputs, focus in the section colour, titled parts, one-tap choices */
.content .input, .content select.input, .content textarea.input {
  background: #f5f7fb; border: 1px solid #e3e8f0; border-radius: 12px; min-height: 44px; padding: 10px 14px;
  font-size: 14.5px; color: #0f172a; transition: border-color .15s, box-shadow .15s, background .15s; }
.content textarea.input { min-height: 96px; line-height: 1.5; }
.content .input:hover { border-color: #cfd7e3; background: #f2f5fa; }
.content .input:focus, .content select.input:focus, .content textarea.input:focus {
  background: #fff; border-color: var(--sec); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sec) 16%, transparent); outline: 0; }
.content .input::placeholder { color: #94a3b8; }
.content .field label { font-size: 12.5px; font-weight: 650; color: #334155; margin-bottom: 6px; letter-spacing: .01em; }
.content .field .help { font-size: 12px; color: #64748b; margin-top: 5px; }
.content .field .err { color: #b42318; font-size: 12.5px; margin-top: 5px; font-weight: 600; }
.content .form-grid { gap: 16px 20px; }
.form-card { padding: 22px 24px 0; }
.form-card .form-sec { border-top: 0; margin-top: 0; padding: 0 0 22px; }
.form-card .form-sec + .form-sec, .form-card .form-sec + details.form-sec { border-top: 1px solid #edf1f6; padding-top: 22px; }
.form-card .form-sec > h2, .form-card .form-sec.fold > summary { display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 700; color: #0f172a; margin: 0 0 16px; }
.form-card .form-sec > h2::before { display: none; }
.form-card .fi { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: var(--sec-soft); color: var(--sec); }
.form-card .fi svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round;
  stroke-linejoin: round; }
.form-card > .form-grid { padding-bottom: 22px; }
/* one-tap choices */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; cursor: pointer; }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pill span { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px; border-radius: 999px;
  background: #f5f7fb; border: 1px solid #e3e8f0; font-size: 13.5px; font-weight: 600; color: #334155;
  transition: background .15s, border-color .15s, color .15s; }
.pill:hover span { border-color: var(--sec-2); color: var(--sec); }
.pill input:checked + span { background: var(--sec); border-color: var(--sec); color: #fff;
  box-shadow: 0 6px 14px -8px var(--sec); }
.pill input:focus-visible + span { box-shadow: 0 0 0 4px color-mix(in srgb, var(--sec) 22%, transparent); }
.form-grid .pills-field { grid-column: 1 / -1; }
/* the save bar stays in view at the bottom of the screen */
.form-bar { position: sticky; bottom: 0; z-index: 15; display: flex; gap: 10px; align-items: center;
  margin: 0 -24px; padding: 14px 24px calc(14px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid #edf1f6; border-radius: 0 0 var(--radius, 16px) var(--radius, 16px); }
.form-bar .btn.primary { background: var(--sec); border-color: var(--sec); min-height: 42px; padding: 0 22px; }
.form-bar .btn.primary:hover { background: var(--sec-ink); }
@media (max-width: 640px) { .form-card { padding: 16px 16px 0; } .form-bar { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .form-bar .btn { flex: 1 1 auto; justify-content: center; } }
