/* Property Hub — calm, mobile-first, large tap targets. */
:root {
  --green: #2f4a3c;
  --green-soft: #e8efe9;
  --ink: #1d2421;
  --muted: #6b7770;
  --line: #e2e6e3;
  --bg: #f6f8f6;
  --card: #ffffff;
  --amber: #b5791f;
  --amber-soft: #fbf1dd;
  --red: #a8362f;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(20, 40, 30, 0.08), 0 6px 18px rgba(20, 40, 30, 0.05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green); }
.hidden { display: none !important; }

/* Layout */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  background: var(--green); color: #fff;
}
.topbar h1 { font-size: 18px; margin: 0; font-weight: 600; letter-spacing: .2px; }
.topbar .spacer { flex: 1; }
.topbar a, .topbar button.link { color: #d7e4da; }
.wrap { max-width: 920px; margin: 0 auto; padding: 18px; }

/* Buttons */
.btn {
  appearance: none; border: 0; cursor: pointer;
  font: inherit; font-weight: 600;
  padding: 12px 18px; border-radius: 12px;
  background: var(--green); color: #fff;
  min-height: 46px;
}
.btn:active { transform: translateY(1px); }
.btn.secondary { background: #fff; color: var(--green); border: 1.5px solid var(--line); }
.btn.ghost { background: transparent; color: var(--muted); padding: 8px 10px; min-height: 0; }
.btn.danger { background: #fff; color: var(--red); border: 1.5px solid #eccac7; }
.btn.block { width: 100%; }
.btn.small { padding: 8px 12px; min-height: 0; font-size: 14px; border-radius: 10px; }
button.link { background: none; border: 0; cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }

/* Cards / grid */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; border: 1px solid var(--line);
}
.prop-card { display: block; text-decoration: none; color: inherit; transition: box-shadow .15s; }
.prop-card:hover { box-shadow: 0 2px 6px rgba(20,40,30,.12), 0 10px 26px rgba(20,40,30,.08); }
.prop-card h3 { margin: 0 0 4px; font-size: 18px; }
.prop-card .addr { color: var(--muted); font-size: 14px; margin: 0 0 12px; min-height: 18px; }
.badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: var(--green-soft); color: var(--green);
}
.badge.warn { background: var(--amber-soft); color: var(--amber); }

/* Add-property tile */
.tile-add {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 2px dashed var(--line); border-radius: var(--radius);
  color: var(--muted); background: transparent; min-height: 120px; font-weight: 600;
}

/* Sections (property page) */
.section { margin-bottom: 14px; }
.section > summary {
  list-style: none; cursor: pointer; padding: 16px 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow);
}
.section[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.section > summary::-webkit-details-marker { display: none; }
.section .sec-title { font-weight: 600; font-size: 16.5px; }
.section .sec-meta { color: var(--muted); font-size: 13px; }
.section .sec-body {
  background: var(--card); border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius); padding: 16px 18px;
}
.chev { margin-left: auto; color: var(--muted); transition: transform .15s; }
.section[open] .chev { transform: rotate(90deg); }
.lock { color: var(--amber); font-size: 13px; font-weight: 600; }

/* Entries */
.entry { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; background: #fff; }
.entry .row { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; align-items: center; }
.entry label { color: var(--muted); font-size: 13.5px; }
.entry input, .entry select, .entry textarea, .field input, .field select, .field textarea {
  width: 100%; font: inherit; padding: 10px 12px; border: 1.5px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--ink); min-height: 44px;
}
.entry textarea { min-height: 70px; resize: vertical; }
.entry .entry-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.entry .entry-head input { font-weight: 600; }
.expiry-flag { font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.expiry-flag.soon { background: var(--amber-soft); color: var(--amber); }
.expiry-flag.over { background: #f7dcd9; color: var(--red); }
.save-note { font-size: 12px; color: var(--muted); margin-left: auto; }

/* Files */
.files { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.file {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 10px; background: #fafbfa; font-size: 14px;
}
.file a { text-decoration: none; font-weight: 600; }
.file .x { color: var(--muted); }
.file-row { width: 100%; }
.file-label { flex: 1; min-width: 0; font: inherit; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 8px; min-height: 40px; }
.file-open { white-space: nowrap; font-size: 13px; }
.dropzone {
  border: 2px dashed var(--line); border-radius: 12px; padding: 14px; text-align: center;
  color: var(--muted); font-size: 14px; cursor: pointer; background: #fafbfa;
}
.dropzone.drag { border-color: var(--green); background: var(--green-soft); color: var(--green); }

/* To-do */
.todo { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.todo:last-child { border-bottom: 0; }
.todo input[type=checkbox] { width: 22px; height: 22px; }
.todo .txt { flex: 1; }
.todo.done .txt { text-decoration: line-through; color: var(--muted); }
.todo .due { font-size: 12.5px; color: var(--muted); }
.todo-add { display: flex; gap: 8px; margin-top: 10px; }
.todo-add input { flex: 1; }

/* Modal / dialog */
dialog {
  border: 0; border-radius: var(--radius); padding: 0; box-shadow: var(--shadow);
  width: min(440px, 92vw);
}
dialog::backdrop { background: rgba(20, 30, 25, .4); }
.dlg-body { padding: 22px; }
.dlg-body h2 { margin: 0 0 14px; font-size: 19px; }
.dlg-body label { display: block; font-size: 14px; color: var(--muted); margin: 12px 0 5px; }
.dlg-body input { width: 100%; padding: 12px; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; min-height: 46px; }
.dlg-actions { display: flex; gap: 10px; margin-top: 18px; }
.dlg-actions .btn { flex: 1; }
.err { color: var(--red); font-size: 14px; margin-top: 10px; min-height: 18px; }

/* Login */
.login-wrap { max-width: 380px; margin: 12vh auto; padding: 0 18px; text-align: center; }
.login-wrap .logo { font-size: 26px; font-weight: 700; color: var(--green); margin-bottom: 4px; }
.login-wrap p { color: var(--muted); margin-top: 0; }

.muted { color: var(--muted); }
.empty { color: var(--muted); font-size: 14px; padding: 8px 0; }
.section-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px;
  font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 50;
}
.toast.show { opacity: 1; }

@media (max-width: 520px) {
  .entry .row { grid-template-columns: 1fr; }
  .entry label { margin-top: 6px; }
}
