:root {
  --ink: #17213b;
  --muted: #68738d;
  --navy: #0b1739;
  --navy-2: #132451;
  --brand: #246bfd;
  --brand-soft: #e8efff;
  --teal: #16a98a;
  --orange: #ef8d22;
  --red: #d94a5a;
  --purple: #8155d9;
  --line: #e1e6ef;
  --surface: #ffffff;
  --canvas: #f5f7fb;
  --shadow: 0 12px 40px rgba(22, 34, 65, .09);
  --radius: 16px;
  --sidebar: 250px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--canvas); }
body { min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(420px, 1.12fr);
  background: var(--navy);
}
.login-hero {
  padding: clamp(40px, 7vw, 96px);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at 10% 10%, rgba(54, 214, 181, .25), transparent 36%),
    radial-gradient(circle at 80% 70%, rgba(36, 107, 253, .35), transparent 42%),
    var(--navy);
}
.logo { display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: -.02em; }
.logo-mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, #36d6b5, #246bfd); color: #fff; font-size: 1.35rem; }
.login-hero h1 { font-size: clamp(2.6rem, 5vw, 5.4rem); line-height: .95; letter-spacing: -.06em; max-width: 780px; margin: 48px 0 24px; }
.login-hero p { font-size: 1.05rem; color: #cbd5ee; max-width: 620px; line-height: 1.65; }
.hero-pills { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-pill { border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 9px 14px; color: #e8edff; font-size: .86rem; }
.login-panel { background: var(--canvas); display: grid; place-items: center; padding: 32px; }
.login-card { width: min(440px, 100%); background: #fff; padding: clamp(28px, 5vw, 48px); border-radius: 24px; box-shadow: 0 24px 80px rgba(0,0,0,.22); }
.login-card h2 { margin: 0 0 8px; font-size: 1.7rem; }
.login-card .subtitle { margin: 0 0 28px; color: var(--muted); line-height: 1.5; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0,1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--navy); color: #d9e2fb; padding: 22px 16px; display: flex; flex-direction: column; z-index: 30; }
.sidebar-header { display: flex; align-items: flex-start; gap: 10px; }
.sidebar .logo { flex: 1; padding: 0 8px 24px; color: #fff; }
.sidebar-close { display: none; width: 38px; height: 38px; flex: 0 0 38px; border: 1px solid rgba(255,255,255,.14); border-radius: 10px; background: rgba(255,255,255,.07); color: #fff; font-size: 1.45rem; line-height: 1; place-items: center; }
.sidebar-backdrop { display: none; }
.sidebar-nav { display: grid; gap: 6px; }
.nav-button { width: 100%; border: 0; background: transparent; color: #b7c2df; padding: 12px 13px; border-radius: 11px; display: flex; align-items: center; gap: 11px; text-align: left; font-weight: 650; }
.nav-button:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-button.active { background: linear-gradient(90deg, rgba(36,107,253,.3), rgba(54,214,181,.08)); color: #fff; box-shadow: inset 3px 0 #36d6b5; }
.nav-icon { width: 21px; text-align: center; font-size: 1.05rem; }
.nav-label { min-width: 0; flex: 1; }
.nav-notification-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #fff; color: var(--navy); display: grid; place-items: center; font-size: .68rem; font-weight: 850; font-variant-numeric: tabular-nums; }
.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); padding-top: 16px; }
.user-chip { display: grid; grid-template-columns: 38px minmax(0,1fr); gap: 10px; align-items: center; padding: 8px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #253968; color: #fff; font-weight: 800; }
.logout { width: 100%; margin-top: 8px; border: 1px solid rgba(255,255,255,.13); background: transparent; color: #cad4ee; border-radius: 10px; padding: 9px; }
.main { grid-column: 2; min-width: 0; }
.topbar { height: 72px; background: rgba(255,255,255,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; position: sticky; top: 0; z-index: 20; }
.topbar h1 { font-size: 1.15rem; margin: 0; }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 1.4rem; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.notification-hub { position: relative; }
.notification-bell { position: relative; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); display: grid; place-items: center; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.notification-bell:hover { border-color: #b9c5da; background: #f8faff; }
.notification-bell:active { transform: scale(.97); }
.notification-bell:focus-visible { outline: 3px solid rgba(36,107,253,.18); border-color: var(--brand); }
.notification-bell-icon { font-size: 1.12rem; line-height: 1; filter: grayscale(1); }
.notification-count { position: absolute; top: -5px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; border: 2px solid #fff; border-radius: 999px; background: var(--red); color: #fff; display: grid; place-items: center; font-size: .61rem; font-weight: 850; line-height: 1; font-variant-numeric: tabular-nums; }
.notification-popover { position: absolute; top: calc(100% + 10px); right: 0; width: min(390px, calc(100vw - 32px)); overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 22px 65px rgba(22,34,65,.2); }
.notification-popover[hidden] { display: none; }
.notification-popover-head { min-height: 62px; padding: 13px 15px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.notification-popover-head > div { display: grid; gap: 2px; }
.notification-popover-head strong { font-size: .9rem; }
.notification-popover-head span { color: var(--muted); font-size: .72rem; }
.notification-popover-head button { border: 0; padding: 5px; background: transparent; color: var(--brand); font-size: .72rem; font-weight: 750; }
.notification-push-shortcut { min-height: 43px; padding: 9px 15px; border-bottom: 1px solid var(--line); background: #fafbfe; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.notification-push-shortcut > button { flex: none; border: 0; padding: 5px; background: transparent; color: var(--brand); font-size: .72rem; font-weight: 780; }
.push-shortcut-status { min-width: 0; color: var(--muted); display: flex; align-items: center; gap: 7px; font-size: .7rem; line-height: 1.3; }
.push-shortcut-status > span { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #a7b0c2; }
.push-shortcut-status.active { color: #087f66; font-weight: 720; }
.push-shortcut-status.active > span { background: #14a887; box-shadow: 0 0 0 3px rgba(20,168,135,.12); }
.push-shortcut-status.warning { color: #8a5a08; }
.push-shortcut-status.warning > span { background: #d89520; }
.notification-preview-list { max-height: 360px; overflow-y: auto; }
.notification-preview-item { width: 100%; padding: 12px 15px; border: 0; border-bottom: 1px solid #edf0f5; background: #fff; color: var(--ink); display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 10px; text-align: left; }
.notification-preview-item:hover { background: #f8faff; }
.notification-preview-item.unread { background: #f4f7ff; }
.notification-preview-item > span:last-child { min-width: 0; display: grid; gap: 2px; }
.notification-preview-item strong, .notification-preview-item small, .notification-preview-item time { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notification-preview-item strong { font-size: .8rem; }
.notification-preview-item small, .notification-preview-item time { color: var(--muted); font-size: .7rem; }
.notification-preview-dot { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: transparent; }
.notification-preview-item.unread .notification-preview-dot { background: var(--brand); }
.notification-preview-empty { padding: 26px 15px; color: var(--muted); font-size: .8rem; text-align: center; }
.notification-popover-link { width: 100%; min-height: 43px; border: 0; background: #f8faff; color: var(--brand); font-size: .8rem; font-weight: 780; }
.notification-popover-link:hover { background: var(--brand-soft); }
.content { padding: 28px; max-width: 1800px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-head h2 { margin: 0 0 5px; font-size: 1.65rem; letter-spacing: -.03em; }
.page-head p { margin: 0; color: var(--muted); }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.btn { border: 1px solid transparent; border-radius: 10px; padding: 10px 14px; font-weight: 720; display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none; min-height: 40px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 7px 18px rgba(36,107,253,.2); }
.btn-primary:hover { background: #165ce8; }
.btn-secondary { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-secondary:hover { border-color: #b9c5da; background: #fbfcfe; }
.btn-danger { background: #fff0f2; color: var(--red); border-color: #ffd7dd; }
.btn-success { background: #e7f8f3; color: #087f66; border-color: #b9ecde; }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn-sm { min-height: 32px; padding: 6px 10px; font-size: .82rem; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.icon-btn { width: 36px; height: 36px; border: 1px solid var(--line); background: #fff; border-radius: 9px; display: grid; place-items: center; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
label { font-size: .82rem; font-weight: 720; color: #3b4660; }
input, select, textarea { width: 100%; border: 1px solid #ccd4e3; border-radius: 10px; background: #fff; padding: 10px 11px; color: var(--ink); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(36,107,253,.1); }
input[type="checkbox"] { width: auto; }
.password-input { position: relative; }
.password-input input { padding-right: 46px; }
.password-toggle { position: absolute; top: 50%; right: 5px; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); display: grid; place-items: center; transform: translateY(-50%); }
.password-toggle:hover { background: #f0f3f9; color: var(--ink); }
.password-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.password-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.password-icon-hide, .password-toggle[aria-pressed="true"] .password-icon-show { display: none; }
.password-toggle[aria-pressed="true"] .password-icon-hide { display: block; }
.checkbox { display: flex; align-items: center; gap: 8px; }
.help { color: var(--muted); font-size: .78rem; line-height: 1.4; }

.stats-grid { display: grid; grid-template-columns: repeat(6, minmax(120px,1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 15px; min-width: 0; }
.stat-label { color: var(--muted); font-size: .76rem; font-weight: 730; text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 1.55rem; font-weight: 820; margin-top: 5px; letter-spacing: -.04em; }
.stat-note { color: var(--muted); font-size: .75rem; margin-top: 4px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 2px 4px rgba(20,34,70,.02); }
.card-head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h3 { margin: 0; font-size: 1rem; }
.card-body { padding: 18px; }
.alert { border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; display: flex; align-items: flex-start; gap: 10px; font-size: .88rem; line-height: 1.5; }
.alert-warning { background: #fff7e8; border: 1px solid #f5dca9; color: #78500c; }
.alert-error { background: #fff0f2; border: 1px solid #ffd3da; color: #982638; }
.alert-info { background: #edf3ff; border: 1px solid #ccdcff; color: #244b99; }
.alert-overdue { background: #fff1dd; border: 1px solid #edbf78; color: #7a4100; box-shadow: inset 4px 0 0 #df7b00; }
.alert-notes { align-items: center; background: #f2efff; border: 1px solid #d8cefa; color: #493486; box-shadow: inset 4px 0 0 var(--purple); }
.alert-notes > div { flex: 1; }
.alert-note-count { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border-radius: 50%; background: var(--purple); color: #fff; font-weight: 820; }

.planner-filters { margin-bottom: 18px; }
.planner-filter-grid { display: grid; grid-template-columns: repeat(4, minmax(140px, 200px)) minmax(150px, 1fr) auto; gap: 14px; align-items: end; padding: 16px 18px; }
.planner-filter-summary { display: flex; align-items: baseline; gap: 6px; min-height: 40px; color: var(--muted); font-size: .82rem; }
.planner-filter-summary strong { color: var(--ink); font-size: 1rem; }

.notification-stats { grid-template-columns: repeat(4, minmax(140px, 1fr)); }
.notification-stats .stat:first-child { border-color: #c9d8fa; background: #f7f9ff; }
.notification-stats .stat:first-child .stat-value { color: var(--brand); }
.notification-filters { margin-bottom: 18px; }
.notification-filter-grid { display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); gap: 14px; align-items: end; padding: 16px 18px; }
.notification-filter-summary { min-height: 40px; display: flex; align-items: baseline; gap: 6px; color: var(--muted); font-size: .82rem; }
.notification-filter-summary strong { color: var(--ink); font-size: 1rem; }
.notification-list { display: grid; gap: 10px; }
.notification-item { position: relative; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 2px 4px rgba(20,34,70,.02); }
.notification-item.unread { border-color: #cbd9fa; background: #fbfcff; box-shadow: inset 3px 0 0 var(--brand), 0 4px 14px rgba(36,107,253,.06); }
.notification-item-marker { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: #edf3ff; color: var(--brand); font-size: .82rem; font-weight: 850; }
.notification-completed .notification-item-marker { background: #e7f8f3; color: #087f66; }
.notification-note .notification-item-marker { background: #f2efff; color: #563c9c; }
.notification-item-body { min-width: 0; }
.notification-item-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.notification-item-head > div { display: flex; align-items: center; gap: 7px; }
.notification-item-head time { color: var(--muted); font-size: .72rem; white-space: nowrap; }
.notification-type { color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; }
.notification-unread-label { padding: 2px 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: .6rem; font-weight: 820; text-transform: uppercase; }
.notification-item h3 { margin: 4px 0 2px; font-size: .98rem; }
.notification-item p { margin: 0; color: #3e4962; font-size: .84rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.notification-meta { display: flex; flex-wrap: wrap; gap: 5px 14px; margin-top: 7px; color: var(--muted); font-size: .72rem; }
.notification-meta strong { color: #46516a; }
.notification-empty { display: grid; gap: 5px; padding: 52px 20px; }
.notification-empty strong { color: var(--ink); }
.notification-pagination { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; color: var(--muted); font-size: .78rem; }
.notification-pagination > div { display: flex; gap: 8px; }

.planner-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px,.8fr); gap: 18px; align-items: start; }
.map-card { position: sticky; top: 90px; }
.route-map { width: 100%; min-height: 320px; background: linear-gradient(135deg, #f8fafc, #edf2f8); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.route-map-canvas { position: relative; width: 100%; height: 340px; overflow: hidden; background: #e7ebdf; isolation: isolate; cursor: grab; touch-action: none; }
.route-map-canvas:focus-visible { outline: 3px solid rgba(36,107,253,.35); outline-offset: -3px; }
.route-map-canvas.dragging { cursor: grabbing; }
.map-tile { position: absolute; z-index: 0; width: 256px; height: 256px; max-width: none; user-select: none; pointer-events: none; }
.route-map-overlay { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.map-controls { position: absolute; z-index: 3; top: 10px; left: 10px; display: grid; border: 1px solid #b9c3d2; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(20,34,70,.2); }
.map-controls button { width: 34px; height: 34px; padding: 0; border: 0; border-bottom: 1px solid #d4dae4; background: rgba(255,255,255,.96); color: var(--ink); font-size: 20px; font-weight: 750; line-height: 1; }
.map-controls button:last-child { border-bottom: 0; font-size: 16px; }
.map-controls button:hover { background: #f1f5fb; }
.map-attribution { position: absolute; z-index: 2; right: 0; bottom: 0; padding: 2px 5px; background: rgba(255,255,255,.82); color: #374151; font-size: 10px; line-height: 1.3; }
.map-attribution a { color: #2452b5; }
.map-empty { min-height: 320px; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 30px; }
.map-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 11px 12px; font-size: .76rem; background: #fff; border-top: 1px solid var(--line); }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; }

.board { display: grid; gap: 16px; min-width: 0; }
.lane { min-width: 0; max-width: 100%; background: #eef2f8; border: 1px solid #dce3ee; border-radius: 15px; padding: 12px; transition: .15s ease; }
.lane.drag-over { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(36,107,253,.1); background: #e9f0ff; }
.lane-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 3px 10px; }
.lane-title { display: flex; align-items: center; gap: 9px; font-weight: 820; }
.worker-dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; }
.lane-metrics { color: var(--muted); font-size: .75rem; }
.task-list { display: grid; gap: 9px; min-width: 0; min-height: 38px; }
.task-card { min-width: 0; max-width: 100%; background: #fff; border: 1px solid #dce3ee; border-left: 4px solid #9aa8c2; border-radius: 11px; padding: 12px; box-shadow: 0 3px 10px rgba(25,43,80,.04); transition: transform .15s ease, box-shadow .15s ease; }
.task-card-invalid { border-top-color: #efb8c0; border-right-color: #efb8c0; border-bottom-color: #efb8c0; background: #fffafb; box-shadow: 0 0 0 2px rgba(217,74,90,.08), 0 3px 10px rgba(25,43,80,.04); }
.task-card-carried { border-top-color: #efc27d; border-right-color: #efc27d; border-bottom-color: #efc27d; background: #fffaf1; }
.task-card[draggable="true"]:hover { transform: translateY(-1px); box-shadow: 0 7px 16px rgba(25,43,80,.08); }
.task-card.dragging { opacity: .5; }
.task-top { display: flex; min-width: 0; justify-content: space-between; gap: 10px; }
.task-title { font-weight: 800; min-width: 0; }
.task-badges { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 5px; }
.task-origin { display: grid; grid-template-columns: auto 1fr; gap: 1px 8px; margin-top: 10px; padding: 8px 10px; border: 1px solid #dce3ee; border-radius: 9px; background: #f8faff; color: var(--muted); }
.task-origin > span { font-size: .68rem; font-weight: 780; letter-spacing: .03em; text-transform: uppercase; }
.task-origin > strong { color: var(--ink); font-size: .82rem; text-align: right; }
.task-origin > small { grid-column: 1 / -1; font-size: .68rem; line-height: 1.35; }
.task-origin-carried { border-color: #e4aa52; background: #fff1d9; color: #7a4100; box-shadow: inset 3px 0 0 #df7b00; }
.task-origin-carried > strong { color: #7a4100; }
.task-origin-completed { border-color: #b9e7dc; background: #f0fbf7; color: #2d6f60; box-shadow: inset 3px 0 0 var(--teal); }
.task-origin-completed > strong { color: #18594b; }
.task-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; color: var(--muted); font-size: .78rem; margin-top: 7px; }
.apartment-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-top: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--line); }
.apartment-fact { display: grid; gap: 1px; min-width: 0; padding: 7px 8px; background: #f8faff; text-align: center; }
.apartment-fact strong { color: var(--ink); font-size: .88rem; font-variant-numeric: tabular-nums; }
.apartment-fact span { overflow: hidden; color: var(--muted); font-size: .62rem; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.apartment-fact-primary strong { color: var(--brand); font-size: 1.3rem; line-height: 1; }
.apartment-fact-primary span { color: var(--ink); font-weight: 760; }
.apartment-access { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.apartment-access > span { display: inline-flex; align-items: baseline; gap: 5px; padding: 6px 8px; border: 1px solid #d8e1ef; border-radius: 8px; background: #fff; }
.apartment-access small { color: var(--muted); font-size: .63rem; font-weight: 720; text-transform: uppercase; }
.apartment-access strong { color: var(--ink); font-size: .84rem; }
.task-times { font-weight: 780; color: var(--ink); }
.task-times-invalid { color: #a82e41; }
.task-window-alert { display: flex; flex-wrap: wrap; gap: 3px 8px; margin-top: 9px; padding: 7px 9px; border: 1px solid #f2c5cb; border-radius: 8px; background: #ffeef1; color: #8f2637; font-size: .75rem; line-height: 1.35; }
.task-window-alert span { color: #a82e41; }
.housekeeping-note { margin-top: 9px; padding: 8px 10px; border: 1px solid #d8e1ef; border-radius: 9px; background: #f8faff; }
.housekeeping-note > span { display: block; color: var(--muted); font-size: .63rem; font-weight: 760; letter-spacing: .05em; text-transform: uppercase; }
.housekeeping-note p { margin: 3px 0 0; color: var(--ink); font-size: .8rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.housekeeping-note-empty p { color: var(--muted); font-style: italic; }
.permanent-notes { display: grid; gap: 7px; margin-top: 10px; padding: 10px; border: 1px solid #efc27d; border-radius: 9px; background: #fffaf1; }
.permanent-notes-title { color: #82510b; font-size: .68rem; font-weight: 820; letter-spacing: .05em; text-transform: uppercase; }
.permanent-note { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 7px; align-items: start; }
.permanent-note > span { display: grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; background: #df7b00; color: #fff; font-size: .7rem; font-weight: 850; }
.permanent-note p { margin: 0; color: #5f3c09; font-size: .8rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.permanent-notes-empty { padding: 12px; border: 1px dashed #cbd4e4; border-radius: 9px; color: var(--muted); font-size: .82rem; text-align: center; }
.task-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.task-actions select { width: auto; min-width: 145px; padding: 6px 8px; font-size: .78rem; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; font-size: .69rem; font-weight: 820; letter-spacing: .02em; white-space: nowrap; }
.badge-unplanned { background: #f0f2f6; color: #67738a; }
.badge-assigned { background: #e8efff; color: #2452b5; }
.badge-progress { background: #fff4dd; color: #9b6200; }
.badge-completed { background: #e4f7f0; color: #087e64; }
.badge-cancelled, .badge-blocked { background: #ffe9ed; color: #a82e41; }
.badge-urgent { background: #ffe7eb; color: #c72c45; }
.badge-high { background: #fff0dc; color: #a95a00; }
.badge-invalid-window { background: #d94a5a; color: #fff; }
.badge-carried { background: #9a5000; color: #fff; }
.btn-note-unread { background: #f2efff; border-color: #cbbcf5; color: #563c9c; }
.note-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--purple); box-shadow: 0 0 0 3px rgba(129,85,217,.14); }
.source-pill { color: #6b7894; font-size: .68rem; border: 1px solid #dce3ee; border-radius: 999px; padding: 3px 7px; }
.empty { color: var(--muted); text-align: center; padding: 26px 12px; border: 1px dashed #cbd4e4; border-radius: 11px; background: rgba(255,255,255,.45); }

.table-wrap { overflow: auto; border-radius: 14px; }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; background: #fafbfd; position: sticky; top: 0; z-index: 1; }
td { font-size: .86rem; }
tr:hover td { background: #fbfcff; }
.table-sort { display: inline-flex; align-items: center; gap: 5px; border: 0; padding: 0; background: transparent; color: inherit; font: inherit; font-weight: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; white-space: nowrap; }
.table-sort span { color: #a4adbd; font-size: .62rem; }
.table-sort:hover, .table-sort.active { color: var(--brand); }
.table-sort.active span { color: var(--brand); }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--teal); }
.status-dot.off { background: #aab2c1; }
.cleanliness-stats { grid-template-columns: repeat(4, minmax(140px, 1fr)); }
.cleanliness-stats .stat:nth-child(2) { border-color: #b9e7dc; background: #f5fcfa; }
.cleanliness-stats .stat:nth-child(2) .stat-value { color: #087e64; }
.cleanliness-stats .stat:nth-child(3) { border-color: #f1c6cc; background: #fff8f9; }
.cleanliness-stats .stat:nth-child(3) .stat-value { color: #b52d42; }
.cleanliness-filters { margin-bottom: 16px; }
.cleanliness-table { min-width: 900px; }
.cleanliness-badge { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 5px 9px; font-size: .72rem; font-weight: 820; white-space: nowrap; }
.cleanliness-badge > span { width: 8px; height: 8px; border-radius: 50%; }
.cleanliness-clean { background: #e4f7f0; color: #087e64; }
.cleanliness-clean > span { background: var(--teal); }
.cleanliness-dirty { background: #ffe9ed; color: #a82e41; }
.cleanliness-dirty > span { background: var(--red); }
.cleanliness-unknown { background: #f0f2f6; color: #67738a; }
.cleanliness-unknown > span { background: #9ca6b8; }
.cleanliness-timeline { position: relative; display: grid; gap: 12px; }
.cleanliness-timeline::before { content: ""; position: absolute; top: 20px; bottom: 20px; left: 18px; width: 2px; background: var(--line); }
.cleanliness-event { position: relative; z-index: 1; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; align-items: start; }
.cleanliness-event-marker { width: 38px; height: 38px; display: grid; place-items: center; border: 4px solid #fff; border-radius: 50%; color: #fff; font-weight: 850; box-shadow: 0 0 0 1px var(--line); }
.event-clean .cleanliness-event-marker { background: var(--teal); }
.event-dirty .cleanliness-event-marker { background: var(--red); }
.cleanliness-event-body { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.cleanliness-event-body > span { color: var(--muted); font-size: .76rem; }
.cleanliness-event-head { display: flex; justify-content: space-between; gap: 12px; color: var(--ink); font-size: .78rem; font-weight: 820; text-transform: uppercase; letter-spacing: .035em; }
.cleanliness-event-head time { color: var(--muted); font-weight: 650; text-transform: none; letter-spacing: 0; }
.cleanliness-event-body > strong { font-size: .88rem; }
.kross-user-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.kross-user-toggle input { accent-color: var(--brand); }
.kross-user-toggle input:disabled { cursor: wait; }

.split { display: grid; grid-template-columns: minmax(300px,.65fr) minmax(0,1.35fr); gap: 18px; align-items: start; }
.settings-stack { display: grid; gap: 18px; }
.sticky { position: sticky; top: 90px; }
.block-grid { display: grid; grid-template-columns: repeat(3, minmax(220px,1fr)); gap: 14px; }
.block-card { padding: 16px; }
.block-card h3 { margin: 0; font-size: 1rem; }
.block-count { font-size: 1.9rem; font-weight: 830; margin: 12px 0 2px; }
.block-coord { color: var(--muted); font-size: .74rem; }

.cleaner-route { max-width: 760px; margin: 0 auto; }
.route-toolbar input { width: auto; min-height: 40px; }
.push-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.push-card > div { display: grid; gap: 2px; }
.push-card strong { font-size: .88rem; }
.push-card span { color: var(--muted); font-size: .76rem; line-height: 1.4; }
.push-card-active { border-color: #a9dfd5; background: #f2fbf8; }
.push-card-warning { border-color: #f1d49e; background: #fffaf0; }
.route-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mobile-task-list { display: grid; gap: 12px; }
.mobile-task { padding: 18px; border-left: 5px solid var(--brand); transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.mobile-task .number { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 9px; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.mobile-task-head { display: flex; align-items: flex-start; gap: 12px; }
.mobile-task-copy { min-width: 0; flex: 1; }
.mobile-task-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mobile-task h3 { min-width: 0; margin: 1px 0 6px; font-size: 1.05rem; line-height: 1.35; letter-spacing: -.015em; text-wrap: pretty; }
.mobile-task-address, .mobile-task-location { color: var(--muted); font-size: .8rem; line-height: 1.45; }
.mobile-task-location { margin-top: 1px; }
.mobile-task-schedule { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.mobile-task-label { display: block; margin-bottom: 3px; color: var(--muted); font-size: .68rem; font-weight: 760; letter-spacing: .07em; text-transform: uppercase; }
.mobile-task .big-time { font-size: 1.35rem; line-height: 1.2; font-weight: 850; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.mobile-task-meta { margin-top: 8px; }
.mobile-task-meta strong { color: var(--ink); }
.mobile-task-notes { flex-basis: 100%; padding-top: 3px; line-height: 1.45; }
.mobile-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 16px; }
.mobile-actions .btn { min-height: 44px; }
.mobile-task-completed { border-left-color: var(--teal) !important; }
.mobile-task-carried { border-top-color: #efc27d; border-right-color: #efc27d; border-bottom-color: #efc27d; background: #fffdf8; }
.mobile-task .task-origin { margin-top: 14px; padding: 11px 12px; }
.mobile-task.notification-target, .task-card.notification-target { outline: 3px solid rgba(36,107,253,.25); box-shadow: 0 0 0 6px rgba(36,107,253,.08), var(--shadow); animation: notification-pulse 1.1s ease 2; }
@keyframes notification-pulse { 50% { transform: translateY(-2px); } }

.note-cleaning-summary { display: grid; gap: 3px; margin-bottom: 18px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; background: #f8faff; }
.note-cleaning-summary span { color: var(--muted); font-size: .8rem; }
.note-compose { margin-bottom: 20px; }
.note-compose textarea { resize: vertical; min-height: 110px; }
.note-history-title { margin: 4px 0 10px; font-size: .95rem; }
.note-list, .note-notification-list { display: grid; gap: 9px; }
.note-item { padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.note-item-unread { border-left: 4px solid var(--purple); background: #faf8ff; }
.note-item-head { display: flex; justify-content: space-between; gap: 12px; font-size: .8rem; }
.note-item-head time { color: var(--muted); }
.note-item p, .note-notification p { margin: 7px 0 0; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.permanent-note-admin { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.permanent-note-admin p { flex: 1; margin: 0; }
.note-notification { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 14px; border: 1px solid #ddd4fa; border-radius: 11px; background: #faf8ff; }
.note-notification > div { min-width: 0; }
.note-notification span { display: block; margin-top: 2px; color: var(--muted); font-size: .76rem; }
.note-notification p { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: .84rem; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(8,18,42,.58); backdrop-filter: blur(4px); z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal { width: min(720px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: #fff; border-radius: 20px; box-shadow: 0 30px 100px rgba(0,0,0,.3); }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { margin: 0; font-size: 1.15rem; }
.modal-body { padding: 22px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; }
.close-modal { border: 0; background: #f0f3f8; width: 34px; height: 34px; border-radius: 50%; font-size: 1.2rem; }

.toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: grid; gap: 9px; width: min(390px, calc(100vw - 36px)); }
.toast { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 12px; padding: 13px 15px; box-shadow: var(--shadow); animation: toast-in .2s ease; }
.toast.error { border-left-color: var(--red); }
.toast.success { border-left-color: var(--teal); }
.toast-title { font-weight: 800; }
.toast-message { color: var(--muted); font-size: .82rem; margin-top: 3px; line-height: 1.4; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

.skeleton { position: relative; overflow: hidden; background: #edf1f7; color: transparent !important; border-radius: 7px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .65s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1250px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .cleanliness-stats { grid-template-columns: repeat(2, 1fr); }
  .planner-filter-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .notification-filter-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .planner-grid { grid-template-columns: 1fr; }
  .map-card { position: static; }
  .block-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  :root { --sidebar: 270px; }
  .app-shell { display: block; }
  .sidebar { transform: translateX(-105%); transition: transform .2s ease; box-shadow: 10px 0 40px rgba(0,0,0,.2); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: grid; }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 25; border: 0; padding: 0; background: rgba(8,18,42,.5); opacity: 0; pointer-events: none; touch-action: none; transition: opacity .2s ease; }
  .sidebar.open + .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0; }
  .mobile-menu { display: block; }
  .content { padding: 20px 16px 90px; }
  .topbar { height: 64px; padding: 0 16px; }
  .topbar-actions { gap: 10px; }
  .split { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .login-page { grid-template-columns: 1fr; background: var(--canvas); }
  .login-hero { display: none; }
  .login-panel { min-height: 100vh; padding: 18px; }
}
@media (max-width: 650px) {
  .page-head { display: grid; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .planner-filter-grid { grid-template-columns: 1fr; }
  .notification-filter-grid { grid-template-columns: 1fr; }
  .notification-filter-summary { min-height: auto; }
  .notification-filter-grid > .btn { width: 100%; }
  .notification-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .notification-item { grid-template-columns: 38px minmax(0, 1fr); padding: 14px; }
  .notification-item-marker { width: 38px; height: 38px; }
  .notification-item > .btn { grid-column: 2; justify-self: start; }
  .notification-item-head { align-items: flex-start; display: grid; gap: 3px; }
  .notification-item-head time { white-space: normal; }
  .notification-pagination { align-items: stretch; flex-direction: column; }
  .notification-pagination > div { display: grid; grid-template-columns: 1fr 1fr; }
  .planner-filter-summary { min-height: auto; }
  .planner-filter-grid > .btn { width: 100%; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .block-grid { grid-template-columns: 1fr; }
  .card-head { align-items: flex-start; }
  .task-top { display: grid; align-items: flex-start; gap: 7px; }
  .task-title { overflow: visible; line-height: 1.35; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }
  .task-badges { justify-content: flex-start; }
  .task-meta { align-items: flex-start; }
  .task-meta > * { min-width: 0; overflow-wrap: anywhere; }
  .task-actions > * { min-width: 0; max-width: 100%; }
  .task-actions select { width: 100%; flex: 1 1 100%; min-width: 0; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; }
  .cleaner-route { width: 100%; }
  .route-page-head { gap: 14px; margin-bottom: 18px; }
  .route-intro { display: none; }
  .route-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .route-toolbar input { width: 100%; min-width: 0; min-height: 44px; }
  .route-toolbar .btn { flex: none; min-height: 44px; white-space: nowrap; }
  .push-card { align-items: stretch; flex-direction: column; margin-bottom: 14px; }
  .alert-notes { align-items: flex-start; flex-wrap: wrap; }
  .alert-notes .btn { width: 100%; }
  .push-card .btn { width: 100%; min-height: 44px; }
  .route-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
  .route-stats .stat { min-width: 0; padding: 12px 10px 13px; border-radius: 12px; }
  .route-stats .stat-label { overflow: hidden; font-size: .72rem; letter-spacing: -.01em; text-transform: none; text-overflow: ellipsis; }
  .route-stats .stat-value { margin-top: 4px; font-size: 1.45rem; }
  .main-my-route .topbar > .small { display: none; }
  .topbar-date { display: none; }
  .mobile-task-list { gap: 12px; }
  .mobile-task { padding: 16px; border-left-width: 4px; border-radius: 14px; }
  .mobile-task-title { flex-wrap: wrap; gap: 5px 8px; }
  .mobile-task-title .badge { margin-top: 1px; }
  .mobile-task-schedule { margin-top: 14px; padding-top: 12px; }
  .mobile-actions { grid-template-columns: 1fr; gap: 8px; margin-top: 14px; }
  .note-notification { align-items: stretch; flex-direction: column; }
  .note-notification .btn { width: 100%; }
  .cleanliness-event-head { display: grid; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-task.notification-target, .task-card.notification-target, .toast, .skeleton::after { animation: none; }
  .sidebar, .notification-bell { transition: none; }
}

@media (max-width: 380px) {
  .content { padding-right: 12px; padding-left: 12px; }
  .topbar { padding-right: 12px; padding-left: 12px; }
  .topbar h1 { font-size: 1.02rem; }
  .route-stats { gap: 6px; }
  .route-stats .stat { padding-right: 7px; padding-left: 7px; }
  .route-stats .stat-label { font-size: .68rem; }
  .mobile-task { padding: 14px; }
  .mobile-task-head { gap: 10px; }
}
