:root {
  color-scheme: light;
  --ink: #20332c;
  --ink-soft: #53655d;
  --muted: #77857e;
  --line: #e3e9e4;
  --paper: #f5f7f4;
  --white: #fff;
  --green: #24614d;
  --green-dark: #143c32;
  --green-soft: #e9f2ed;
  --gold: #bb995c;
  --red: #b84b40;
  --red-soft: #fbefed;
  --amber: #916b27;
  --amber-soft: #fbf4e5;
  --blue: #496e83;
  --blue-soft: #edf3f6;
  --radius: 16px;
  --shadow: 0 12px 32px rgba(26, 54, 43, .07);
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--paper); overflow-wrap: anywhere; }
button, input, select, textarea { font: inherit; color: inherit; }
button { touch-action: manipulation; }
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #caad70; outline-offset: 2px;
}

.auth-screen {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2rem 1.1rem; background:
    radial-gradient(ellipse at 80% 10%, rgba(185, 209, 192, .42), transparent 32rem),
    linear-gradient(145deg, #f6f8f4, #edf3ee);
}
.auth-brand { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.5rem; }
.auth-brand > div, .brand-copy { display: grid; gap: .12rem; }
.auth-brand strong, .brand-copy strong { font: 800 1.08rem/1.15 "Manrope", sans-serif; letter-spacing: -.035em; }
.auth-brand div > span, .brand-copy small { color: var(--muted); font-size: .78rem; }
.brand-mark {
  display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border-radius: 14px;
  color: #fff; background: var(--green); font: 800 1.08rem "Manrope", sans-serif;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22);
}
.auth-card {
  width: min(100%, 440px); padding: clamp(1.35rem, 6vw, 2.4rem); border: 1px solid rgba(206, 218, 208, .9);
  border-radius: 22px; background: rgba(255,255,255,.92); box-shadow: 0 22px 70px rgba(27, 61, 45, .12);
}
.auth-card h1, .page-heading h1, .welcome-row h1 { margin: .2rem 0 .55rem; font: 800 clamp(1.65rem, 4vw, 2.25rem)/1.15 "Manrope", sans-serif; letter-spacing: -.055em; }
.auth-footer, .fine-print { color: var(--muted); font-size: .78rem; line-height: 1.5; text-align: center; }
.auth-footer { max-width: 340px; margin: 1.25rem 0 0; }
.auth-forgot-note { margin-top: 1rem; text-align: center; }
.auth-forgot-note .text-button { font-size: .78rem; color: var(--muted); }
.auth-forgot-note .text-button:hover { color: var(--green); text-decoration: underline; }
.auth-forgot-help { margin-top: .6rem; font-size: .78rem; text-align: left; padding: .75rem; border-radius: 8px; background: #f2f6f3; border: 1px solid #dce5df; color: #3d5649; }
.fine-print { margin: 1.3rem 0 0; }
.eyebrow { margin: 0 0 .48rem; color: var(--green); font-size: .67rem; font-weight: 700; letter-spacing: .12em; }
.muted { color: var(--muted); font-size: .9rem; line-height: 1.55; }
.auth-card > .muted { margin: .3rem 0 1.5rem; }

.app-frame { min-height: 100vh; display: grid; grid-template-columns: 246px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; display: flex; flex-direction: column; min-width: 0; height: 100vh; padding: 1.55rem 1rem 1.1rem;
  color: #eaf1ec; background: var(--green-dark);
}
.brand { display: flex; align-items: center; gap: .7rem; min-height: 48px; margin: 0 .35rem 2.2rem; color: inherit; text-decoration: none; }
.brand-mark { color: var(--green-dark); background: #dce9d9; }
.brand-copy strong { color: #fff; font-size: .98rem; }
.brand-copy small { color: #aabdb2; font-size: .67rem; }
.side-label { margin: 0 .7rem .7rem; color: #8ba89a; font-size: .62rem; font-weight: 700; letter-spacing: .13em; }
.navigation { display: grid; gap: .34rem; }
.nav-item {
  display: flex; align-items: center; gap: .75rem; min-width: 0; width: 100%; min-height: 46px; padding: .55rem .7rem;
  border: 0; border-radius: 10px; background: transparent; color: #c6d4ca; text-align: left; cursor: pointer;
  font-size: .86rem; font-weight: 500;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-item.is-active { color: #fff; background: #285645; box-shadow: inset 3px 0 #d4bc84; }
.nav-icon { display: grid; place-items: center; width: 23px; flex: 0 0 23px; color: #a9c2b3; font-size: 1.1rem; }
.nav-item.is-active .nav-icon { color: #e4d2a9; }
.nav-count { display: inline-grid; place-items: center; margin-left: auto; min-width: 21px; height: 21px; padding: 0 .35rem; border-radius: 99px; color: #fff; background: #a24b40; font-size: .68rem; font-weight: 700; }
.sidebar-bottom { margin-top: auto; }
.independent-note { display: flex; gap: .55rem; align-items: flex-start; margin: 0 .45rem 1rem; padding: .75rem; border: 1px solid rgba(255,255,255,.11); border-radius: 11px; color: #9db3a5; font-size: .66rem; line-height: 1.6; }
.independent-note strong { color: #d9e4dc; font-size: .69rem; }
.note-dot, .status-dot { width: 7px; height: 7px; flex: 0 0 7px; margin-top: .34rem; border-radius: 50%; background: #9cc6a5; box-shadow: 0 0 0 3px rgba(156,198,165,.13); }
.profile { display: flex; align-items: center; gap: .6rem; min-width: 0; padding: .7rem .25rem 0; border-top: 1px solid rgba(255,255,255,.13); }
.avatar { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; color: #fff; background: #426b58; font-weight: 700; }
.profile-copy { display: grid; gap: .12rem; min-width: 0; color: #f2f4f1; font-size: .75rem; }
.profile-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy small { color: #9db3a5; font-size: .65rem; }
.icon-button { display: inline-grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 10px; color: inherit; background: transparent; cursor: pointer; font-size: 1.35rem; }
.icon-button:hover { background: rgba(128, 151, 136, .14); }
.profile .icon-button { margin-left: auto; color: #c4d2c9; }

.main-column { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 82px; padding: .8rem clamp(1rem, 3vw, 2.5rem); border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.94); backdrop-filter: blur(10px);
}
.topbar .eyebrow { margin-bottom: .33rem; font-size: .58rem; }
.topbar-title { display: flex; align-items: center; gap: .52rem; font: 700 .84rem "Manrope", sans-serif; }
.topbar-title .status-dot { margin: 0; width: 6px; height: 6px; flex-basis: 6px; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .55rem; }
.today-label { margin-right: .35rem; color: var(--muted); font-size: .76rem; white-space: nowrap; }
.content { width: 100%; max-width: 1420px; margin: 0 auto; padding: clamp(1rem, 3vw, 2.25rem) clamp(1rem, 3vw, 2.5rem) 2.5rem; flex: 1; min-width: 0; }
.app-footer { padding: .9rem 1rem calc(.9rem + env(safe-area-inset-bottom)); color: #8b9890; font-size: .7rem; text-align: center; }
.app-footer span { padding: 0 .25rem; color: #bcc6bf; }

.welcome-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 108px; margin: 0 0 1.05rem; }
.welcome-row h1 { margin-bottom: .35rem; font-size: clamp(1.55rem, 3vw, 2rem); }
.welcome-row .muted { margin: 0; }
.welcome-art { position: relative; display: grid; place-items: center; width: 86px; height: 76px; flex: 0 0 86px; border-radius: 25px 25px 28px 28px; color: #7a9d82; background: #e9f0e7; overflow: hidden; }
.welcome-art span { z-index: 1; margin-top: -14px; font-size: 1.8rem; color: #a8864f; }
.welcome-art i, .welcome-art b { position: absolute; bottom: -10px; width: 65px; height: 38px; border-radius: 50%; background: #cddfcf; transform: rotate(-20deg); }
.welcome-art b { right: -24px; bottom: -15px; width: 56px; height: 40px; background: #dbe8d8; transform: rotate(25deg); }

.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr)); gap: .8rem; margin-bottom: 1.15rem; }
.summary-card { display: flex; align-items: flex-start; justify-content: space-between; gap: .7rem; min-width: 0; min-height: 124px; padding: 1rem 1.05rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.summary-card p { margin: 0; color: var(--muted); font-size: .76rem; font-weight: 600; }
.summary-card strong { display: block; margin: .5rem 0 .15rem; font: 800 1.8rem/1 "Manrope", sans-serif; letter-spacing: -.05em; }
.summary-card small { color: var(--muted); font-size: .68rem; }
.metric-icon { display: grid; place-items: center; flex: 0 0 37px; width: 37px; height: 37px; border-radius: 12px; color: var(--green); background: var(--green-soft); font-size: 1.04rem; }
.metric-warn .metric-icon { color: var(--amber); background: var(--amber-soft); }
.metric-alert .metric-icon { color: var(--red); background: var(--red-soft); }
.metric-calm .metric-icon { color: var(--blue); background: var(--blue-soft); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .85fr); gap: 1rem; margin-bottom: 1rem; }
.panel { min-width: 0; padding: 1.15rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: .6rem; min-width: 0; margin-bottom: .8rem; }
.panel-heading .eyebrow { margin-bottom: .25rem; font-size: .59rem; }
.panel-heading h2 { margin: 0; font: 700 1.03rem "Manrope", sans-serif; letter-spacing: -.03em; }
.text-button { display: inline-flex; align-items: center; gap: .35rem; min-height: 40px; padding: .3rem; border: 0; color: var(--green); background: transparent; cursor: pointer; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.text-button:hover { color: var(--green-dark); }
.compact-list { display: grid; }
.compact-row { display: flex; align-items: center; gap: .75rem; min-width: 0; padding: .72rem .1rem; border-top: 1px solid #edf0ed; }
.compact-date { display: grid; place-items: center; flex: 0 0 43px; min-height: 44px; padding: .25rem; border-radius: 10px; color: var(--green); background: var(--green-soft); text-align: center; font-size: .61rem; line-height: 1.2; }
.compact-date strong { font-size: .95rem; }
.compact-copy { min-width: 0; flex: 1; }
.compact-copy strong, .compact-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-copy strong { font-size: .79rem; }
.compact-copy small { margin-top: .2rem; color: var(--muted); font-size: .69rem; }
.compact-empty { padding: 1rem .1rem; color: var(--muted); font-size: .81rem; }
.compact-priority { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #bdc8c0; }
.compact-priority.high, .compact-priority.urgent { background: var(--red); }
.area-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.area-chip { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .7rem; border: 1px solid #e4ebe5; border-radius: 99px; color: #4d6759; background: #f8faf8; font-size: .73rem; }
.area-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #91ae96; }

.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 0 1.2rem; }
.page-heading h1 { margin-bottom: .3rem; font-size: clamp(1.55rem, 3vw, 2rem); }
.page-heading .muted { margin: 0; max-width: 650px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 42px; min-width: 44px; padding: .55rem .9rem;
  border: 1px solid transparent; border-radius: 10px; cursor: pointer; text-decoration: none; font-size: .77rem; font-weight: 700;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button-primary { color: #fff; background: var(--green); }
.button-primary:hover { background: var(--green-dark); }
.button-outline { border-color: #dce5de; color: var(--green); background: #fff; }
.button-outline:hover { border-color: #a9c0ae; background: #f7faf7; }
.button-danger { border-color: #f1cfcc; color: var(--red); background: var(--red-soft); }
.button-danger:hover { border-color: var(--red); background: #fce8e6; }
.button-wide { width: 100%; min-height: 48px; margin-top: .2rem; }
.toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .7rem; margin: 0 0 1rem; }
.filter-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem; padding: .25rem; border: 1px solid var(--line); border-radius: 11px; background: #eef2ee; }
.filter-tab { min-height: 36px; padding: .45rem .7rem; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; font-size: .72rem; font-weight: 600; }
.filter-tab.is-active { color: var(--green-dark); background: #fff; box-shadow: 0 1px 3px rgba(22,52,37,.09); }
.select-compact { min-height: 42px; max-width: 100%; padding: .4rem 2rem .4rem .7rem; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: .74rem; }

.task-list, .incident-list, .entity-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 390px), 1fr)); gap: .75rem; min-width: 0; }
.task-card, .incident-card, .entity-card {
  min-width: 0; padding: 1rem 1.05rem; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 3px 9px rgba(27,54,43,.025);
}
.task-card.is-overdue { border-color: #efcfcb; }
.task-card.is-done, .incident-card.is-resolved, .entity-card.is-inactive { opacity: .68; }
.card-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; }
.card-title { margin: .05rem 0 .25rem; font: 700 .93rem/1.35 "Manrope", sans-serif; letter-spacing: -.02em; }
.card-subtitle { margin: 0; color: var(--muted); font-size: .72rem; line-height: 1.5; }
.card-description { margin: .7rem 0 0; color: #58685f; font-size: .77rem; line-height: 1.55; white-space: pre-line; }
.overdue-note { color: #a84238; font-weight: 700; }
.completion-note { margin-top: .65rem; }
.account-note { margin-top: .7rem; }
.task-date { flex: 0 0 auto; padding: .36rem .55rem; border-radius: 8px; color: #596d61; background: #f1f5f1; font-size: .69rem; font-weight: 700; white-space: nowrap; }
.badges { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .7rem; }
.badges-tight { margin-top: 0; margin-bottom: .35rem; }
.badge { display: inline-flex; align-items: center; min-height: 23px; padding: .2rem .48rem; border-radius: 99px; color: #596c60; background: #f0f4f0; font-size: .62rem; font-weight: 700; }
.badge-green { color: #27604b; background: #e8f2eb; }
.badge-red { color: #a84238; background: #faedeb; }
.badge-amber { color: #815f20; background: #fbf3e3; }
.badge-blue { color: #456b81; background: #ebf2f6; }
.checklist { display: grid; gap: .24rem; margin: .85rem 0 .1rem; padding: .65rem .7rem; border-radius: 10px; background: #f8faf8; }
.checklist-heading { margin: 0 0 .18rem; color: #6d7e73; font-size: .64rem; font-weight: 700; }
.check-item { display: flex; align-items: flex-start; gap: .48rem; padding: .24rem .05rem; color: #46574e; font-size: .72rem; line-height: 1.4; cursor: pointer; }
.check-item input { width: 17px; height: 17px; flex: 0 0 17px; margin: 0; accent-color: var(--green); }
.check-item.is-done span { color: #849188; text-decoration: line-through; }
.schedule-note { margin-top: .55rem; }
.task-photos { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .75rem; }
.task-photos a { display: block; width: clamp(68px, 18vw, 104px); aspect-ratio: 1; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #f1f5f1; }
.task-photos img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .8rem; padding-top: .75rem; border-top: 1px solid #edf0ed; }
.card-actions .button { min-height: 36px; padding: .4rem .65rem; font-size: .69rem; }
.card-action-spacer { flex: 1 1 auto; }
.inline-control { display: grid; gap: .22rem; margin-top: .65rem; }
.inline-control label { color: var(--muted); font-size: .64rem; font-weight: 700; }
.inline-control select, .inline-control textarea { width: 100%; min-height: 37px; padding: .42rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: .72rem; }
.inline-control textarea { min-height: 62px; resize: vertical; }
.empty-state { grid-column: 1 / -1; padding: 2.3rem 1rem; border: 1px dashed #d6e0d8; border-radius: 15px; color: var(--muted); background: rgba(255,255,255,.6); text-align: center; }
.empty-state strong { display: block; margin-bottom: .35rem; color: var(--ink); font: 700 .92rem "Manrope", sans-serif; }
.empty-state p { max-width: 380px; margin: 0 auto; font-size: .76rem; line-height: 1.55; }
.entity-card { display: flex; flex-direction: column; }
.entity-card .card-actions { margin-top: auto; padding-top: .85rem; }
.entity-symbol { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: .65rem; border-radius: 12px; color: var(--green); background: var(--green-soft); font-size: 1.05rem; }
.notice { margin: 0 0 1rem; padding: .8rem 1rem; border: 1px solid #e9d8aa; border-radius: 11px; color: #725922; background: var(--amber-soft); font-size: .76rem; line-height: 1.5; }

.form-stack { display: grid; gap: .85rem; }
.field { display: grid; gap: .38rem; min-width: 0; }
.field label { color: #354940; font-size: .74rem; font-weight: 700; }
.field input, .field select, .field textarea {
  width: 100%; min-width: 0; min-height: 43px; padding: .62rem .72rem; border: 1px solid #d8e1da; border-radius: 9px;
  background: #fff; font-size: .8rem; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: #81a890; outline: 0; box-shadow: 0 0 0 3px rgba(78,129,94,.12); }
.field textarea { min-height: 76px; resize: vertical; line-height: 1.45; }
.field-help, .optional { color: var(--muted); font-size: .66rem; font-weight: 400; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.incident-admin-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-error { min-height: 1.05rem; margin: 0; color: #a84238; font-size: .72rem; font-weight: 600; }
.form-error:empty { min-height: 0; }
.dialog {
  width: min(100% - 1.25rem, 560px); max-width: 560px; max-height: min(92dvh, 850px); padding: 0; border: 1px solid #dfe7e0;
  border-radius: 18px; background: #fff; color: var(--ink); box-shadow: 0 24px 90px rgba(12, 40, 28, .24);
}
.dialog::backdrop { background: rgba(15, 36, 28, .52); backdrop-filter: blur(3px); }
.dialog-form { display: grid; gap: .85rem; max-height: inherit; overflow-y: auto; padding: clamp(1rem, 4vw, 1.5rem); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .2rem; }
.dialog-heading .eyebrow { margin-bottom: .22rem; font-size: .6rem; }
.dialog-heading h2 { margin: 0; font: 700 1.15rem "Manrope", sans-serif; letter-spacing: -.04em; }
.dialog-heading .icon-button { flex: 0 0 40px; width: 40px; height: 40px; font-size: 1.6rem; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .5rem; margin-top: .1rem; padding-top: .8rem; border-top: 1px solid #edf0ed; }
.toast {
  position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 20;
  max-width: min(420px, calc(100vw - 2rem)); padding: .82rem 1rem; border-radius: 11px; color: #fff; background: #203e31;
  box-shadow: 0 10px 35px rgba(17,40,29,.24); font-size: .78rem; line-height: 1.45;
}
.toast.is-error { background: #84392f; }

@media (max-width: 1050px) {
  .app-frame { grid-template-columns: 218px minmax(0, 1fr); }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .app-frame { display: flex; flex-direction: column; }
  .sidebar { position: sticky; top: 0; z-index: 10; height: auto; padding: .6rem .75rem .3rem; box-shadow: 0 4px 14px rgba(20,60,50,.12); }
  .brand { min-height: 36px; margin: 0 .25rem .45rem; }
  .brand .brand-mark { flex-basis: 32px; width: 32px; height: 32px; border-radius: 10px; font-size: .88rem; }
  .brand-copy { gap: 0; }
  .brand-copy strong { font-size: .84rem; }
  .brand-copy small { font-size: .6rem; }
  .side-label, .sidebar-bottom { display: none; }
  .navigation { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 112px), 1fr)); gap: .25rem; padding-bottom: .15rem; }
  .nav-item { flex: none; width: 100%; min-width: 0; min-height: 42px; justify-content: center; gap: .35rem; padding: .4rem .5rem; font-size: .68rem; white-space: nowrap; }
  .nav-item.is-active { box-shadow: inset 0 -2px #d4bc84; }
  .nav-icon { width: auto; flex: 0 0 auto; font-size: .95rem; }
  .nav-count { min-width: 17px; height: 17px; margin-left: 0; padding: 0 .22rem; font-size: .58rem; }
  .topbar { position: relative; min-height: auto; padding: .75rem 1rem; }
  .topbar .eyebrow { font-size: .53rem; }
  .topbar-title { font-size: .72rem; }
  .today-label { display: none; }
  .topbar-actions { gap: .35rem; }
  .topbar-actions .button { min-height: 38px; padding: .42rem .55rem; font-size: .65rem; }
  .content { padding: 1.1rem .9rem 1.5rem; }
  .welcome-row { min-height: 90px; }
  .welcome-art { width: 64px; height: 59px; flex-basis: 64px; border-radius: 19px; }
  .welcome-art span { font-size: 1.45rem; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
  .summary-card { min-height: 105px; padding: .75rem; }
  .summary-card strong { font-size: 1.5rem; }
  .summary-card p { font-size: .67rem; }
  .summary-card small { font-size: .61rem; }
  .metric-icon { width: 30px; height: 30px; flex-basis: 30px; border-radius: 9px; font-size: .85rem; }
  .panel { padding: .9rem; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading > .button { align-self: stretch; }
  .task-list, .incident-list, .entity-grid { grid-template-columns: minmax(0, 1fr); }
  .toolbar { align-items: stretch; flex-direction: column; }
  .filter-tabs { width: max-content; max-width: 100%; overflow-x: auto; }
  .filter-tab { flex: 0 0 auto; }
  .select-compact { width: 100%; }
  .form-row { grid-template-columns: minmax(0, 1fr); gap: .65rem; }
}
@media (max-width: 390px) {
  .sidebar { padding-right: .45rem; padding-left: .45rem; }
  .nav-item { gap: .28rem; padding-right: .45rem; padding-left: .45rem; }
  .topbar { gap: .5rem; padding-right: .7rem; padding-left: .7rem; }
  .topbar-title { max-width: 125px; font-size: .65rem; }
  .topbar-actions .button { font-size: .6rem; }
  .content { padding-right: .65rem; padding-left: .65rem; }
  .task-card, .incident-card, .entity-card { padding: .85rem; }
  .card-topline { gap: .5rem; }
  .task-date { max-width: 105px; white-space: normal; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

.skip-link {
  position: fixed; z-index: 100; top: .5rem; left: .5rem; padding: .7rem 1rem; border-radius: 9px;
  color: #fff; background: var(--green-dark); transform: translateY(-160%); transition: transform .15s ease;
}
.skip-link:focus { transform: translateY(0); }
.auth-screen {
  background:
    radial-gradient(ellipse at 76% 15%, rgba(211, 225, 211, .72), transparent 34rem),
    radial-gradient(ellipse at 15% 85%, rgba(225, 232, 221, .68), transparent 34rem),
    #f4f6f2;
}
.auth-brand { margin-bottom: 1.8rem; }
.auth-brand .brand-mark svg, .brand .brand-mark svg {
  width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.auth-card { border-radius: 24px; box-shadow: 0 28px 80px rgba(26, 54, 43, .13); }
.auth-card h1 { font-size: clamp(1.8rem, 5vw, 2.35rem); }
.app-frame { background: #f3f5f2; }
.sidebar {
  background: linear-gradient(180deg, #172f27 0%, #143c32 56%, #17372e 100%);
  box-shadow: 5px 0 22px rgba(19, 48, 37, .06);
}
.brand { min-height: 52px; }
.brand-mark { box-shadow: inset 0 0 0 1px rgba(255,255,255,.34), 0 5px 14px rgba(0,0,0,.12); }
.topbar {
  min-height: 78px; border-color: #e5eae5; background: rgba(255,255,255,.96);
  box-shadow: 0 2px 10px rgba(33, 50, 39, .025);
}
.topbar .eyebrow { color: #75867b; letter-spacing: .13em; }
.topbar-title { font-size: .9rem; }
.today-chip {
  display: inline-flex; align-items: center; gap: .48rem; min-height: 38px; padding: .35rem .72rem;
  border: 1px solid #e5ebe5; border-radius: 999px; background: #f8faf7;
}
.today-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: #6b9b74; }
.today-label { margin: 0; color: #607066; font-size: .74rem; font-weight: 650; }
.logout-button { min-width: 40px; }
.content { max-width: 1540px; padding-top: clamp(1.5rem, 3.4vw, 2.8rem); }
.welcome-row {
  position: relative; min-height: 128px; padding: .5rem 0 1.2rem; overflow: hidden;
}
.welcome-row h1 { font-size: clamp(1.8rem, 3.4vw, 2.55rem); }
.welcome-row .eyebrow { letter-spacing: .15em; }
.welcome-art { width: 100px; height: 88px; flex-basis: 100px; border: 1px solid #dfe8df; }
.summary-grid { gap: .95rem; }
.summary-card {
  position: relative; min-height: 132px; padding: 1.15rem 1.2rem; border-color: #e6ebe6;
  border-radius: 17px; box-shadow: 0 5px 16px rgba(35, 54, 42, .035); transition: transform .16s ease, box-shadow .16s ease;
}
.summary-card::before { position: absolute; top: 0; left: 1.2rem; right: 1.2rem; height: 2px; content: ""; border-radius: 0 0 2px 2px; background: #b7cbbb; }
.metric-warn::before { background: #dfc582; }
.metric-alert::before { background: #dfa39b; }
.metric-calm::before { background: #9ebac7; }
.summary-card:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(35, 54, 42, .075); }
.summary-card p { font-size: .78rem; }
.summary-card strong { font-size: 2rem; }
.metric-icon { width: 42px; height: 42px; flex-basis: 42px; border-radius: 14px; }
.dashboard-grid { gap: 1rem; }
.panel {
  padding: 1.3rem; border-color: #e5ebe5; border-radius: 17px;
  box-shadow: 0 5px 18px rgba(35, 54, 42, .035);
}
.panel-heading { margin-bottom: 1rem; }
.panel-heading h2 { font-size: 1.08rem; }
.compact-row { padding: .8rem .15rem; }
.compact-copy strong { font-size: .82rem; }
.area-chip { padding: .55rem .78rem; border-color: #e5ebe5; background: #fbfcfa; }
.page-heading { margin-bottom: 1.45rem; }
.page-heading h1 { font-size: clamp(1.8rem, 3.4vw, 2.45rem); }
.page-heading .eyebrow { letter-spacing: .14em; }
.button { min-height: 44px; border-radius: 11px; font-size: .78rem; }
.button-primary { box-shadow: 0 3px 8px rgba(36, 97, 77, .14); }
.button-outline { border-color: #dfe7e0; }
.toolbar { margin-bottom: 1.1rem; }
.task-list, .incident-list, .entity-grid { gap: .9rem; }
.task-card, .incident-card, .entity-card {
  padding: 1.15rem; border-color: #e5ebe5; border-radius: 16px;
  box-shadow: 0 4px 13px rgba(35, 54, 42, .035);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.task-card:hover, .incident-card:hover, .entity-card:hover {
  transform: translateY(-2px); border-color: #d5e0d6; box-shadow: 0 10px 24px rgba(35, 54, 42, .07);
}
.task-card.is-overdue { border-left: 3px solid #c75c50; }
.task-card.is-done, .incident-card.is-resolved, .entity-card.is-inactive { opacity: .78; }
.card-title { font-size: .98rem; }
.card-subtitle { font-size: .75rem; }
.badge { min-height: 25px; padding-inline: .55rem; font-size: .65rem; }
.checklist { padding: .8rem; border: 1px solid #edf1ed; }
.check-item { min-height: 32px; align-items: center; font-size: .76rem; }
.check-item input { width: 19px; height: 19px; flex-basis: 19px; }
.card-actions { gap: .5rem; }
.card-actions .button { min-height: 39px; font-size: .72rem; }
.empty-state { padding: 2.7rem 1rem; border-color: #d7e1d8; background: #fbfcfa; }
.notice { padding: .9rem 1rem; font-size: .8rem; }
.app-footer { padding-top: 1.1rem; }

@media (max-width: 760px) {
  .sidebar { padding: .62rem .85rem .45rem; background: linear-gradient(110deg, #172f27, #1d493a); }
  .brand { min-height: 39px; margin: 0 .15rem .5rem; }
  .navigation {
    position: fixed; z-index: 15; right: 0; bottom: 0; left: 0;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: .15rem; padding: .4rem .35rem calc(.4rem + env(safe-area-inset-bottom));
    border-top: 1px solid #e4e9e4; background: rgba(255,255,255,.97); box-shadow: 0 -8px 25px rgba(24, 47, 36, .09);
    backdrop-filter: blur(14px);
  }
  .nav-item {
    position: relative; display: flex; flex-direction: column; justify-content: center; gap: .14rem; min-height: 53px;
    padding: .32rem .1rem; border-radius: 10px; color: #718078; font-size: .59rem; font-weight: 650;
  }
  .nav-item:hover { color: var(--green-dark); background: #f5f8f5; }
  .nav-item.is-active { color: var(--green-dark); background: #edf4ee; box-shadow: none; }
  .nav-icon { color: inherit; font-size: 1.06rem; }
  .nav-count { position: absolute; margin: -1.55rem 0 0 1.25rem; min-width: 16px; height: 16px; font-size: .54rem; }
  .topbar { align-items: flex-start; padding: .75rem .9rem; }
  .topbar-actions { align-items: center; }
  .today-chip { display: none; }
  .logout-button { min-width: 40px; padding-inline: .55rem; }
  .content { padding: 1.35rem .9rem calc(6.8rem + env(safe-area-inset-bottom)); }
  .welcome-row { min-height: 100px; padding-top: .15rem; }
  .welcome-art { width: 72px; height: 64px; flex-basis: 72px; }
  .summary-card { min-height: 110px; padding: .85rem; }
  .summary-card::before { left: .85rem; right: .85rem; }
  .summary-card strong { font-size: 1.65rem; }
  .panel { padding: 1rem; }
  .task-card, .incident-card, .entity-card { padding: 1rem; }
  .task-card:hover, .incident-card:hover, .entity-card:hover, .summary-card:hover { transform: none; }
}
@media (max-width: 390px) {
  .navigation { padding-right: .2rem; padding-left: .2rem; }
  .nav-item { font-size: .55rem; }
  .topbar-actions .button { min-height: 40px; }
  .logout-label { display: none; }
  .content { padding-right: .7rem; padding-left: .7rem; }
  .summary-grid { gap: .45rem; }
  .summary-card { padding: .7rem; }
  .summary-card::before { left: .7rem; right: .7rem; }
  .metric-icon { width: 28px; height: 28px; flex-basis: 28px; font-size: .8rem; }
  .card-topline { flex-direction: column; }
  .task-date { max-width: none; align-self: flex-start; }
}

/* R1 Field Usability & Operational Filters */
.checklist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .25rem;
}
.check-all-btn {
  font-size: .68rem;
  font-weight: 700;
  color: var(--green);
  background: none;
  border: 0;
  padding: .2rem .45rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s ease;
}
.check-all-btn:hover {
  background: #e8f0e9;
}
.my-today-toggle {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
}
.toggle-star {
  color: #c49942;
  font-size: .92rem;
  line-height: 1;
}
.my-today-toggle.button-primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green-dark);
}
.my-today-toggle.button-primary .toggle-star {
  color: #ffe680;
}
.my-today-toggle.button-primary .badge {
  background: rgba(255, 255, 255, .25);
  color: #fff;
}

/* Community Reports View */
.field-inline {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .78rem;
  font-weight: 600;
  color: #354940;
}
.field-inline label {
  white-space: nowrap;
}
.field-inline input[type="date"],
.field-inline select {
  min-height: 40px;
  padding: .35rem .6rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: .75rem;
}
.report-actions {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}
.report-sheet {
  margin-top: 1.2rem;
  padding: clamp(1.2rem, 3vw, 1.8rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 4px 16px rgba(27, 54, 43, .04);
}
.report-header {
  margin-bottom: 1.4rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
}
.report-brand-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.2rem;
  flex-wrap: wrap;
}
.report-brand-row h2 {
  margin: .2rem 0 0;
  font: 800 1.35rem/1.2 "Manrope", sans-serif;
  letter-spacing: -.03em;
  color: var(--ink);
}
.report-meta-box {
  text-align: right;
  font-size: .78rem;
  color: #4a5c53;
}
.report-meta-box p {
  margin: .15rem 0;
}
.report-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .8rem;
  margin-bottom: 1.8rem;
}
.report-kpi {
  padding: .9rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfb;
}
.report-kpi p {
  margin: 0;
  font-size: .72rem;
  color: var(--muted);
  font-weight: 600;
}
.report-kpi strong {
  display: block;
  margin: .35rem 0 .15rem;
  font: 800 1.55rem/1.1 "Manrope", sans-serif;
  letter-spacing: -.04em;
  color: var(--ink);
}
.report-kpi small {
  font-size: .68rem;
  color: var(--muted);
}
.report-section {
  margin-top: 1.6rem;
}
.report-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .65rem;
}
.report-section-header h3 {
  margin: 0;
  font: 700 1.05rem "Manrope", sans-serif;
  letter-spacing: -.02em;
  color: var(--ink);
}
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .77rem;
}
.report-table th,
.report-table td {
  padding: .6rem .75rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.report-table th {
  background: #f4f7f4;
  font-weight: 700;
  color: #2e4337;
  font-size: .71rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.report-table tbody tr:hover {
  background: #fbfdfb;
}
.report-empty {
  padding: 1.8rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: .8rem;
  border: 1px dashed var(--line);
  border-radius: 10px;
  margin: .4rem 0;
}
.cell-nowrap {
  white-space: nowrap;
}

@media (max-width: 760px) {
  .report-meta-box {
    text-align: left;
    margin-top: .4rem;
  }
  .report-actions {
    width: 100%;
  }
  .report-actions .button {
    flex: 1 1 auto;
  }
  .report-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .field-inline {
    width: 100%;
    justify-content: space-between;
  }
  .field-inline input,
  .field-inline select {
    flex: 1 1 auto;
    max-width: 65%;
  }
  .report-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Print Stylesheet for Community Reports */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 8.5pt !important;
  }
  .skip-link,
  .sidebar,
  .topbar,
  .app-footer,
  .toolbar,
  .report-actions,
  .button,
  .dialog,
  #toast,
  .card-actions,
  [hidden] {
    display: none !important;
  }
  .app-frame,
  .main-column,
  .content {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    background: transparent !important;
  }
  #view-reports {
    display: block !important;
  }
  .report-controls-header,
  .report-toolbar {
    display: none !important;
  }
  .report-sheet {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
  }
  .report-header {
    border-bottom: 2px solid #24614d !important;
    padding-bottom: .6rem !important;
    margin-bottom: .8rem !important;
  }
  .report-brand-row h2 {
    font-size: 1.4rem !important;
    color: #143c32 !important;
    margin: 0 0 .2rem !important;
  }
  .report-kpis {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: .5rem !important;
    margin-bottom: 1rem !important;
  }
  .report-kpi {
    border: 1px solid #ccc !important;
    border-radius: 6px !important;
    padding: .4rem .6rem !important;
    background: #f8faf8 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .report-kpi strong {
    font-size: 1.25rem !important;
  }
  .report-section {
    margin-top: 1rem !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .report-section-header h3 {
    font-size: 1rem !important;
    margin: 0 0 .3rem !important;
  }
  .report-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 7.5pt !important;
    display: table !important;
  }
  .report-table th,
  .report-table td {
    border: 1px solid #ccc !important;
    padding: 4px 6px !important;
    text-align: left !important;
    vertical-align: top !important;
  }
  .report-table th {
    background: #edf2ee !important;
    color: #111 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .report-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .report-empty {
    border: 1px dashed #ccc !important;
    padding: 1rem !important;
  }
}

