/* Area A – master data: customers, properties, employees, checklist templates. Owned by the area (docs/AREAS.md) – prefix classes with the page name, use only tokens from theme.css. */

/* detail pages: form cards + side column, sticky action bar */
.md-detail .cols-2-1 { align-items: start; }
.md-section { margin-top: var(--gap); }
.md-actions { position: sticky; bottom: 0; z-index: 5; margin-top: var(--gap); padding: 12px 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; box-shadow: var(--shadow); }
.md-actions .detail-actions { flex: 1 1 auto; }
.md-meta { display: inline-flex; align-items: center; gap: 6px; } .md-meta .icon { width: 14px; height: 14px; stroke: var(--text-3); }
.md-flush { padding: 0; } .md-flush .md-empty { padding: 16px 18px; margin: 0; } .md-flush-top { padding-top: 0; }
.md-grow { flex: 1; min-width: 0; }
.md-list > li { display: flex; flex-direction: column; gap: 2px; padding: 10px 18px; border-bottom: 1px solid var(--border); }
.md-list > li:last-child { border-bottom: 0; } .md-list a { color: var(--text); }
.md-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px var(--surface); }
.md-emp { display: inline-flex; align-items: center; gap: 5px; margin-right: 8px; white-space: nowrap; }
.md-name { gap: 10px; align-items: center; }
.md-desc { max-width: 360px; }
.md-export { margin-left: auto; }
.md-hint { margin: 0; }
.md-note { padding: 0 18px 14px; margin: 0; }
.md-jobs td, .md-jobs th { white-space: nowrap; } .md-jobs td:nth-child(3) { white-space: normal; }

/* coordinates + access */
.md-coords .row .input { min-width: 0; flex: 1; }
.md-access .md-code, .md-access input[name="doorCode"], .md-access input[name="alarmCode"] { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
.md-access .xs .icon { width: 13px; height: 13px; vertical-align: -2px; }

/* areas grid + task grid */
.md-areas td, .md-tasks td { padding-top: 6px; padding-bottom: 6px; }
.md-areas .input.sm, .md-tasks .input.sm { width: 100%; min-width: 120px; }
.md-ord { width: 76px; } .md-ord .btn { width: 30px; height: 30px; }
.md-areas tr.md-off td { opacity: .6; }
.md-area-add, .md-task-add, .md-pref-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.md-area-add .input, .md-pref-add .input { flex: 1 1 160px; width: auto; }
.md-area-add .input[name="name"] { flex: 2 1 220px; }
.md-pref-add .sel { flex: 2 1 200px; }
.md-task-add [data-new] { flex: 1 1 260px; }
.md-min { width: 84px !important; min-width: 0 !important; text-align: right; }
.md-cb { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.md-tasks-sum { padding-top: 10px; padding-bottom: 12px; }
.md-checks { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }

/* reference photos */
.md-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.md-photos li { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.md-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-3); display: block; }
.md-photo-cap { display: flex; align-items: center; gap: 4px; font-size: var(--fs-sm); font-weight: 550; min-width: 0; } .md-photo-cap span { flex: 1; }

/* apply-template modal */
.md-apply { display: grid; gap: 12px; max-height: 52vh; overflow: auto; margin: 10px 0; padding-right: 4px; }
.md-apply fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px 10px; margin: 0; display: grid; gap: 6px; }
.md-apply legend { padding: 0 6px; font-size: var(--fs-sm); }
.md-apply-q { width: 100%; max-width: 360px; margin-top: 8px; }

/* employees: month column, limit meter, availability, languages, hours overview */
.md-month { display: grid; gap: 4px; min-width: 180px; }
.md-meter { position: relative; height: 12px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.md-meter.sm { height: 7px; border-radius: 4px; max-width: 220px; }
.md-meter span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; }
.md-meter .md-meter-proj { background: color-mix(in srgb, var(--primary) 28%, transparent); }
.md-meter .md-meter-val { background: var(--primary); }
.md-meter.lvl-warn .md-meter-val { background: var(--warning); } .md-meter.lvl-warn .md-meter-proj { background: color-mix(in srgb, var(--warning) 30%, transparent); }
.md-meter.lvl-over .md-meter-val { background: var(--danger); } .md-meter.lvl-over .md-meter-proj { background: color-mix(in srgb, var(--danger) 30%, transparent); }
.md-meter-mark { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--text-3); opacity: .55; }
.md-meter-mark.full { background: var(--text); opacity: .8; }
.md-lvl { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 650; } .md-lvl .icon { width: 13px; height: 13px; }
.md-lvl.lvl-warn { color: var(--warning); } .md-lvl.lvl-over { color: var(--danger); }
.md-limit { display: grid; gap: 8px; }
.md-limit-legend { display: flex; flex-wrap: wrap; gap: 14px; }
.md-limit-legend span { display: inline-flex; align-items: center; gap: 6px; }
.md-limit-legend .sw { width: 12px; height: 8px; border-radius: 3px; display: inline-block; }
.md-limit-legend .sw.val, .md-limit-legend .sw.wk { background: var(--primary); }
.md-limit-legend .sw.proj, .md-limit-legend .sw.pl { background: color-mix(in srgb, var(--primary) 28%, transparent); }
.md-limit-legend .sw.mark { width: 2px; height: 12px; background: var(--text-3); }
.md-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.md-kpi { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.md-kpi > span { font-size: var(--fs-xs); color: var(--text-3); font-weight: 600; } .md-kpi b { font-size: var(--fs-lg); font-variant-numeric: tabular-nums; } .md-kpi small { font-size: var(--fs-xs); color: var(--text-3); }
.md-monthnav { gap: 4px; } .md-monthnav b { min-width: 120px; text-align: center; font-size: var(--fs-sm); }
.md-bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; height: 96px; align-items: end; padding-bottom: 16px; position: relative; }
.md-bar { position: relative; height: 80px; border-radius: 4px; background: var(--surface-2); }
.md-bar.we { background: var(--surface-3); }
.md-bar span { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 4px; }
.md-bar .pl { background: color-mix(in srgb, var(--primary) 26%, transparent); } .md-bar .wk { background: var(--primary); left: 22%; right: 22%; }
.md-bar i { position: absolute; top: 100%; left: 0; right: 0; text-align: center; font-style: normal; font-size: 9.5px; color: var(--text-3); margin-top: 2px; }
.md-bar.today { box-shadow: 0 0 0 2px var(--accent); }
@media (max-width: 640px) { .md-bar i { display: none; } .md-bar:nth-child(5n + 1) i { display: block; } }
.md-avail { display: grid; gap: 8px; }
.md-avail-row { display: grid; grid-template-columns: 34px 492px minmax(80px, 1fr); gap: 10px; align-items: center; }
.md-avail-row > b { font-size: var(--fs-sm); color: var(--text-2); } .md-avail-row.we > b { color: var(--text-3); }
.md-avail-slots { display: flex; flex-wrap: wrap; gap: 6px 14px; } .md-avail-slots .row { gap: 4px; } .md-avail-slots .input { width: 112px; }
.md-day { position: relative; height: 12px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.md-day span { position: absolute; top: 0; bottom: 0; background: var(--primary); border-radius: 6px; }
.md-avail-scale { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-3); }
.md-avail-scale-row .md-avail-slots { visibility: hidden; height: 0; }
@media (max-width: 900px) {
  .md-avail-row { grid-template-columns: 34px 1fr; } .md-avail-row .md-day { grid-column: 2; }
  .md-avail-scale-row { display: none; }
}
.md-langs .chip { height: 30px; } .md-langs .chip[disabled] { cursor: default; }
.md-color { width: 64px; padding: 4px; height: var(--input-h); cursor: pointer; }
.md-abs-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 6px; }
.md-abs-sum > div { display: flex; flex-direction: column; align-items: center; padding: 8px; border-radius: var(--radius-sm); background: var(--surface-2); }
.md-abs-sum b { font-size: var(--fs-lg); }
.md-pref li .row { gap: 10px; }

@media (max-width: 720px) {
  .md-actions { position: static; }
  .md-actions .detail-actions { justify-content: flex-start; }
  .md-ord { width: 64px; }
  .md-area-add .btn, .md-task-add .btn { flex: 1 1 100%; justify-content: center; }
}

/* mockup 2: initials avatars in titles and lists, photo strip on top of the property detail */
.md-avatar { --av: var(--primary); width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; font-size: 18px;
  background: color-mix(in srgb, var(--av) 16%, var(--surface)); color: color-mix(in srgb, var(--av) 80%, var(--text)); }
.md-avatar.sm { width: 34px; height: 34px; font-size: 12px; }
.md-head > div:first-child { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; }
.md-head > div:first-child > .crumbs { grid-column: 1 / -1; }
.md-head > div:first-child > .md-avatar { grid-row: span 2; }
.md-head > div:first-child > .sub { grid-column: 2; }
.md-namecell { display: flex; align-items: center; gap: 10px; min-width: 0; } .md-namecell a { color: var(--text); }
.md-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: var(--gap); }
.md-strip a { position: relative; display: block; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); background: var(--surface-3); }
.md-strip img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.md-strip span { position: absolute; left: 8px; bottom: 8px; padding: 2px 9px; border-radius: var(--radius-pill); background: rgba(16, 32, 31, .72); color: #fff; font-size: 11.5px; font-weight: 600; }
@media (max-width: 640px) { .md-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } .md-strip a:nth-child(n + 3) { display: none; } }
.md-detail .cols-2-1 > * { min-width: 0; }
@media (max-width: 1100px) { .md-detail .cols-2-1 { grid-template-columns: minmax(0, 1fr); } }
