/* SEVIN 0.7: shared palette; loaded after legacy styles. */
:root {
  color-scheme: light;
  --page: #eef2ef;
  --card: #fff;
  --surface: #f3f7f4;
  --ink: #192d23;
  --secondary: #53695c;
  --stroke: #ccd9d0;
  --accent: #087344;
  --hover: #e2eee6;
  --navy: #111c18;
  --blue: var(--accent);
  --line: var(--stroke);
  --muted: var(--secondary);
  --soft: var(--surface);
  font-family: Tahoma, "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--ink);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0c1310;
  --card: #16221b;
  --surface: #1e2e24;
  --ink: #edf5ef;
  --secondary: #b0c5b7;
  --stroke: #3b5143;
  --accent: #127b4a;
  --hover: #2a4032;
}
body {
  background: var(--page);
  color: var(--ink);
  min-height: 100dvh;
  line-height: 1.7;
}
header {
  padding-block: 18px;
  border-bottom: 3px solid #159b60;
}
.brand h1 {
  font-size: 25px;
}
.brand img {
  width: 62px;
  height: 76px;
}
.brand {
  gap: 14px;
}
.badge {
  font-size: 12px;
}
main {
  max-width: 1280px;
}
.panel,
.login-card,
dialog,
.form-section,
.property,
.person-card,
.tool-card {
  background: var(--card);
  border-color: var(--stroke);
  color: var(--ink);
}
.panel {
  padding: 24px;
  border-radius: 20px;
  box-shadow: 0 8px 32px #001c0c08;
}
.form-section {
  padding: 20px;
  margin: 18px 0;
  border-radius: 14px;
}
.form-section.priority {
  background: var(--surface);
  border-right-color: var(--accent);
}
h2,
h3,
label,
.login-card h1 {
  color: var(--ink);
}
.page-head {
  gap: 18px;
}
h3 {
  font-size: 15px;
}
.fields {
  gap: 18px;
}
.fields small {
  display: block;
  color: var(--muted);
  font-weight: 400;
}
input,
select,
textarea,
button,
.button {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--stroke);
  font-family: inherit;
}
input,
select,
textarea {
  border-radius: 10px;
  min-height: 46px;
}
input:disabled {
  background: var(--surface);
  color: var(--muted);
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #159b6033;
}
.facts dd {
  line-height: 1.8;
}
button,
.button {
  min-height: 44px;
  padding: 10px 15px;
  border-radius: 11px;
}
button:hover,
.button:hover {
  background: var(--hover);
}
button.primary,
a.button.primary,
button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
button.primary:hover,
a.button.primary:hover,
button.active:hover {
  background: #075c37;
  color: #fff;
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #37ad76;
  outline-offset: 3px;
}
a {
  color: #087344;
}
:root[data-theme="dark"] a {
  color: #7cdda4;
}
.danger {
  background: #9b2d30;
  color: #fff;
}
.danger:hover {
  background: #7a2025 !important;
}
nav,
.online-bar,
.request-box,
.stat,
.filter-grid,
.facts > div {
  background: var(--surface);
  color: var(--ink);
}
nav {
  max-width: 1280px;
  padding-block: 12px;
  gap: 9px;
}
.online-bar {
  border-bottom: 1px solid var(--stroke);
}
.stats {
  gap: 16px;
}
.stat b {
  color: var(--ink);
}
.property,
.person-card {
  padding: 20px;
  border-radius: 16px;
  border-right: 4px solid var(--accent);
}
.property strong,
.person-card strong {
  display: block;
  font-size: 16px;
}
.meta-line {
  font-size: 13px;
  line-height: 2;
  margin-top: 8px;
}
.money-line,
.amount-preview,
#appStatus {
  color: #087344;
}
:root[data-theme="dark"] .money-line,
:root[data-theme="dark"] .amount-preview,
:root[data-theme="dark"] #appStatus {
  color: #85dba8;
}
.money-line {
  font-size: 16px;
  margin-top: 10px;
}
.actions {
  align-items: center;
}
.divar-badge {
  font-size: 12px;
  background: var(--surface);
  color: var(--ink);
  border-color: var(--stroke);
}
.divar-badge.due {
  border-color: #bb7b17;
  background: #fff2cf;
  color: #553600;
}
#officeIdentity,
#notice:not(:empty) {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--accent);
}
#connectionBanner:not(:empty),
.match-note {
  background: #fff2cf;
  color: #553600;
}
.error {
  color: #a92c30 !important;
}
:root[data-theme="dark"] .error {
  color: #ff9e9e !important;
}
.warn {
  color: #805500 !important;
}
:root[data-theme="dark"] .warn {
  color: #ffd38a !important;
}
p[role="status"] {
  color: var(--accent);
}
:root[data-theme="dark"] p[role="status"] {
  color: #85dba8;
}
.danger-soft {
  background: var(--card);
}
.cards.tile-view {
  grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
}
.tile-view > .property,
.tile-view > .person-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
}
.list-view {
  grid-template-columns: 1fr;
}
.view-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 12px 0;
}
.view-tools label {
  font-size: 12px;
}
.view-tools select {
  min-width: 150px;
}
.layout-toggle {
  margin-inline-start: auto;
}
.app-credit {
  font-size: 11px;
  text-align: center;
  color: var(--muted);
  padding: 18px;
}
.login-card > .app-credit {
  padding-bottom: 0;
}
.login-card {
  padding: 30px !important;
  border-radius: 24px;
}
.login-card > img {
  display: block;
  margin: 4px auto 20px;
  object-fit: contain;
}
.login-card > h1,
.login-card > p {
  text-align: center;
}
.login-card > .theme-toggle {
  display: block;
  margin: 0 auto 18px;
  font-size: 12px;
}
.login-card form {
  gap: 14px;
}
.login-page {
  background:
    radial-gradient(ellipse at top, #159b601b, transparent 65%), var(--page);
}
#togglePassword {
  font-size: 12px;
  justify-self: start;
  padding: 4px 12px;
  min-height: 36px;
}
.login-card img {
  width: 80px;
  height: 96px;
}
#locationDialog {
  width: min(720px, 96vw);
}
#locationMap {
  border: 1px solid var(--stroke);
  border-radius: 14px;
  direction: ltr;
  background: #e4e9e5;
  color: #172b3b;
}
.map-pin {
  width: 22px !important;
  height: 22px !important;
  background: #087344;
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #087344;
}
.leaflet-container a {
  color: #075c37 !important;
}
.location-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.field-help {
  font-size: 12px;
  color: var(--muted);
}
#extraCriteria .fields {
  margin: 12px 0;
}
.section-note {
  background: var(--surface);
  padding: 10px;
  border-radius: 10px;
}
@media (max-width: 640px) {
  .brand h1 {
    font-size: 21px;
  }
  .brand img {
    width: 48px;
    height: 60px;
  }
  .brand p {
    font-size: 10px;
  }
  .panel {
    padding: 16px;
  }
  .fields,
  .fields.three,
  .facts {
    grid-template-columns: 1fr;
  }
  .cards.tile-view {
    grid-template-columns: 1fr;
  }
  .property,
  .person-card {
    padding: 16px;
  }
  .list-view .property,
  .list-view .person-card {
    display: block;
  }
  .list-view .actions {
    margin-top: 12px;
  }
  .page-head h2 {
    font-size: 19px;
  }
  .form-section {
    padding: 14px;
  }
  .actions button {
    flex: 1;
  }
  .money-line {
    font-size: 15px;
  }
  .layout-toggle {
    margin-inline-start: 0;
  }
  nav {
    position: static;
  }
  .online-bar {
    gap: 6px;
  }
  .app-credit {
    padding: 12px;
  }
  .login-card {
    padding: 22px !important;
  }
  dialog {
    padding: 16px;
  }
  .mode-switch button {
    padding: 8px 12px;
  }
}
@media print {
  .app-credit,
  .theme-toggle,
  .view-tools {
    display: none !important;
  }
  :root {
    color-scheme: light;
  }
  body,
  .panel {
    color: #000 !important;
    background: white !important;
  }
}
/* Complete registration: expand optional details only when needed. */
form details.form-section > summary {
  cursor: pointer;
  font-weight: 700;
  min-height: 44px;
  display: list-item;
  padding: 6px 0;
}
form details.form-section[open] > summary {
  margin-bottom: 16px;
}
form details.form-section:not([open]) {
  padding-block: 10px;
}
