/* Late-stage shared polish split from renderer-inline.css so the legacy stylesheet stays maintainable. */
/* ============================================================
     DESIGN POLISH LAYER  (appended last; refines base styles via
     the cascade). Keeps the navy (#1f4e78) identity and unifies
     cards, KPI tiles, tables, buttons, modals, browse cards, pills.
     Additive & reversible — delete this block to revert.
     ============================================================ */
  :root{ --pol-navy:var(--accent,#1f4e78); --pol-line:var(--border,#e6eaf0); --pol-ink:var(--text,#0f172a); --pol-muted:var(--muted,#64748b);
    --pol-shadow-sm:0 1px 2px rgba(15,23,42,.05);
    --pol-shadow:0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.05); }
  body{ -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; background:var(--app-bg,#f4f6f9); }
  h1{ color:var(--accent,#1f4e78); }

  /* Cards */
  .card{ background:var(--surface,#fff); border:1px solid var(--pol-line); border-radius:var(--radius-lg,10px); box-shadow:none; }

  /* KPI tiles (rent + mortgage dashboards) */
  .kpis{ gap:12px; }
  .kpi{ background:var(--surface,#fff); border:1px solid var(--pol-line); border-radius:var(--radius-lg,10px); min-height:var(--kpi-h,68px); padding:var(--card-pad,13px); box-shadow:none; }
  .kpi .val{ color:var(--accent,#1f4e78); font-size:var(--kpi-val,22px); font-weight:700; font-variant-numeric:tabular-nums; letter-spacing:0; }

  /* Buttons */
  .btn{ border-radius:8px; padding:8px 15px; transition:background-color .12s ease, border-color .12s ease, box-shadow .12s ease; }
  .btn-primary{ box-shadow:0 1px 2px rgba(31,78,120,.28); }
  .btn-primary:hover{ background:#1a4368; }
  .btn-secondary{ border-color:#d8dee6; color:#334155; }
  .btn-secondary:hover{ background:#f1f5f9; border-color:#c3ccd6; }
  .btn-danger, .btn-danger.left{ background:#fff; color:#b91c1c; border:1px solid #fecaca; border-radius:8px; padding:8px 15px; font-size:13px; font-weight:600; cursor:pointer; }
  .btn-danger:hover{ background:#fef2f2; border-color:#f87171; }

  /* Generic tables (id-scoped tables keep their own tuned styles) */
  th{ background:var(--surface-soft,#f8fafc); color:var(--pol-muted); font-weight:600; font-size:11px; text-transform:uppercase; letter-spacing:.04em; padding:9px 10px; border-bottom:1px solid var(--pol-line); }
  td{ height:var(--row-h,32px); padding:7px 10px; border-bottom:1px solid var(--border,#f1f5f9); color:var(--pol-ink); }
  tr:hover td{ background:var(--accent-soft,#f8fafc); }
  tr.total td{ border-top:2px solid var(--border-strong,#cbd5e1); background:var(--surface-soft,#f8fafc); }

  /* Modals */
  .modal, .form-modal, .picker-modal, .contact-view{ border-radius:14px; box-shadow:0 24px 60px -12px rgba(15,23,42,.35); }
  #tenant-view-modal > .contact-view{
    height:calc(100vh - 64px) !important;
    max-height:calc(100vh - 64px) !important;
    min-height:0 !important;
    border-radius:var(--radius-lg,10px) !important;
    box-shadow:0 18px 44px rgba(15,23,42,.18) !important;
  }
  .modal-head{ border-bottom:1px solid #eef2f7; background:linear-gradient(180deg,#fbfcfe,#f6f8fb); }
  .modal-head .title{ font-weight:700; color:var(--pol-ink); }
  .modal-head .meta{ color:var(--pol-muted); }

  /* Browse / picker cards */
  .browse-card{ border-radius:12px; box-shadow:var(--pol-shadow-sm); transition:border-color .12s ease, box-shadow .12s ease; }
  .browse-card:hover,
  .browse-card:focus-visible{ border-color:#c7d8ea; box-shadow:0 6px 18px -6px rgba(15,23,42,.16); outline:2px solid #93c5fd; outline-offset:2px; }

  /* Pills / badges / stat tiles */
  .pill{ border-radius:999px; }
  .badge{ border-radius:6px; }
  .pv-stat{ box-shadow:var(--pol-shadow-sm); }

  /* Sidebar — subtle refinement (keep the dark identity) */
  .sidebar .sb-btn{ border-radius:8px; min-height:var(--nav-item-h,30px); }

  /* Search inputs outside .form-row — unify radius */
  #picker-search, input[type="search"]{ border-radius:8px; }

  #wo-form-modal{ z-index:var(--z-modal-form,12030) !important; }

  /* ---- Work-order & recurring module forms: modern, clean (id-scoped so it
     wins over the module's runtime-injected .wo-field styles) ---- */
  #wo-rec-modal > .modal{ max-width:660px !important; }
  #wo-form-modal > .form-modal{ max-width:620px; }
  #wo-form-modal .modal-body, #wo-rec-modal .modal-body{ padding:18px 22px; }
  #wo-rec-modal #wo-rec-form{ border-top:1px solid #eef2f7; margin-top:10px; padding-top:6px; }
  #wo-form-modal .wo-field, #wo-rec-modal .wo-field{ margin-bottom:14px; }
  #wo-form-modal .wo-field > label, #wo-rec-modal .wo-field > label{ display:block; font-size:12px; font-weight:600; color:#334155; margin-bottom:5px; }
  #wo-form-modal .wo-field input, #wo-form-modal .wo-field select, #wo-form-modal .wo-field textarea,
  #wo-rec-modal .wo-field input, #wo-rec-modal .wo-field select, #wo-rec-modal .wo-field textarea{
    width:100%; box-sizing:border-box; padding:9px 12px; font-size:13px; font-family:inherit;
    border:1px solid #cbd5e1; border-radius:8px; background:#fff; color:#0f172a;
    transition:border-color .12s ease, box-shadow .12s ease; }
  #wo-form-modal .wo-field input:hover:not(:focus), #wo-form-modal .wo-field select:hover:not(:focus), #wo-form-modal .wo-field textarea:hover:not(:focus),
  #wo-rec-modal .wo-field input:hover:not(:focus), #wo-rec-modal .wo-field select:hover:not(:focus), #wo-rec-modal .wo-field textarea:hover:not(:focus){ border-color:#94a3b8; }
  #wo-form-modal .wo-field input:focus, #wo-form-modal .wo-field select:focus, #wo-form-modal .wo-field textarea:focus,
  #wo-rec-modal .wo-field input:focus, #wo-rec-modal .wo-field select:focus, #wo-rec-modal .wo-field textarea:focus{ outline:none; border-color:#1f4e78; box-shadow:0 0 0 3px rgba(31,78,120,.12); }
  #wo-form-modal .wo-field textarea, #wo-rec-modal .wo-field textarea{ min-height:72px; resize:vertical; }
  #wo-form-modal .wo-grid2, #wo-rec-modal .wo-grid2{ display:grid; grid-template-columns:1fr 1fr; gap:0 14px; }
  #wo-form-modal .wo-check, #wo-rec-modal .wo-check{ display:flex; align-items:center; gap:9px; font-size:13px; color:#334155; margin:4px 0; }
  #wo-form-modal .wo-check input[type=checkbox], #wo-rec-modal .wo-check input[type=checkbox]{ width:17px; height:17px; accent-color:#1f4e78; cursor:pointer; }
  #wo-rec-modal .wo-section-title, #wo-form-modal .wo-section-title{ font-size:11px; text-transform:uppercase; letter-spacing:.07em; color:#94a3b8; font-weight:700; margin:6px 0 10px; }

  /* System cohesion: module list rows match the card aesthetic */
  #wo-rec-modal .wo-rec-row, #nw-owners-modal .nw-owner-row{ border:1px solid #e6eaf0; border-radius:10px; box-shadow:0 1px 2px rgba(15,23,42,.05); }
  #wo-modal .wo-card{ box-shadow:0 1px 2px rgba(15,23,42,.05); }
