/* Compact forms, read-only View sheet, linked first column, and the site footer.
   Loaded last so it refines the earlier stylesheets without editing them. */

/* ---------- Add / Update / View pop-ups ---------- */
.ffm-drawer.ffm-modal{width:min(800px,95vw)}
.ffm-drawer .drawer-head{padding:.65rem 1rem}
.ffm-drawer .drawer-head h5{font-size:1.02rem}
.ffm-drawer .drawer-body{padding:.7rem 1rem .5rem}
.ffm-drawer .drawer-foot{padding:.55rem 1rem}
.ffm-drawer .drawer-foot .btn{min-height:36px;padding:.35rem .9rem}

.ffm-drawer .form-section{padding:.65rem .85rem .6rem;margin-bottom:.55rem;border-radius:10px;box-shadow:none;border-color:#e3eaf2}
.ffm-drawer .form-section h6{font-size:.72rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:#5a6c80;margin:0 0 .45rem;padding-bottom:.3rem;border-bottom:1px solid #edf1f6}
.ffm-drawer .row.g-2,.ffm-drawer .row.g-3,.ffm-drawer .row.vf-grid{--bs-gutter-x:.7rem;--bs-gutter-y:.4rem}
.ffm-drawer .form-label{margin-bottom:.12rem!important;font-size:.78rem;font-weight:600;color:#3a4a5d}
.ffm-drawer .form-control,.ffm-drawer .form-select{min-height:34px;padding:.28rem .6rem;font-size:.9rem;border-radius:8px}
.ffm-drawer textarea.form-control{min-height:54px;line-height:1.35}
.ffm-drawer .form-text{margin-top:.1rem;font-size:.72rem;line-height:1.3}
.ffm-drawer .ffm-chips-select .chips-input{min-height:34px;padding:.15rem .4rem}
.ffm-drawer .ffm-subtable{padding:.35rem .55rem}
.ffm-drawer .mt-2.small,.ffm-drawer .text-muted-2.small.mt-2{margin-top:.35rem!important}

/* Read-only View sheet (replaces greyed-out inputs) */
.vf-grid{--bs-gutter-y:0}
.vf{padding:.28rem 0 .32rem;border-bottom:1px solid #f0f3f7}
.vf-label{font-size:.66rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:#6a7b8e;line-height:1.2}
.vf-value{font-size:.92rem;color:#17283c;line-height:1.35;overflow-wrap:anywhere;white-space:pre-wrap;margin-top:.05rem}
.vf-chip{display:inline-block;background:#eef3fa;color:#2f5f8f;border-radius:999px;padding:.02rem .55rem;font-size:.82rem;font-weight:600;margin:0 .15rem .1rem 0}

/* In-page forms (Settings, Security) */
.app-main .card .row.g-3{--bs-gutter-y:.55rem;--bs-gutter-x:.8rem}
.app-main .card .form-label{margin-bottom:.15rem!important}

/* Table: the record name opens the View sheet (Edit lives inside it) */
.ffm-table .cell-link{all:unset;cursor:pointer;color:var(--ffm-primary,#245d89);font-weight:600;border-bottom:1px dotted transparent}
.ffm-table .cell-link:hover{border-bottom-color:currentColor}
.ffm-table .cell-link:focus-visible{outline:3px solid #e3a83d;outline-offset:2px;border-radius:3px}

@media (max-width:768px){
  .ffm-drawer .form-control,.ffm-drawer .form-select{min-height:40px}
  .ffm-drawer .drawer-body{padding:.6rem .8rem}
}

/* ---------- Site footer (landing, create, open, dashboard, emergency) ---------- */
.ffm-site-footer,.app-footer{display:block!important;padding:0!important;background:linear-gradient(180deg,#10203a,#0b1627)!important;color:#c9d6e8;border-top:3px solid var(--ffm-accent,#16816e)!important;text-align:left!important;font-size:.78rem;line-height:1.5}
.ffm-foot{max-width:1240px;margin:0 auto;padding:.85rem 1.25rem .8rem;display:grid;grid-template-columns:1fr auto;gap:.45rem 1.5rem;align-items:center}
.ffm-foot a{color:#a9c8ea;text-decoration:none}
.ffm-foot a:hover{color:#fff;text-decoration:underline}
.ffm-foot-brand{display:flex;align-items:center;gap:.55rem;flex-wrap:wrap}
.ffm-foot-brand strong{color:#fff;font-size:.88rem;letter-spacing:.01em}
.ffm-foot-brand .ver{background:rgba(255,255,255,.1);border-radius:6px;padding:.02rem .45rem;font-weight:600;font-size:.72rem;color:#dbe7f5}
.ffm-foot-brand .rel{opacity:.7}
.ffm-foot-badges{display:flex;gap:.4rem;flex-wrap:wrap;justify-content:flex-end}
.ffm-foot-badges .pill{display:inline-flex;align-items:center;gap:.3rem;background:rgba(46,138,120,.18);color:#86dcc6;border:1px solid rgba(46,138,120,.35);border-radius:999px;padding:.08rem .6rem;font-weight:600;font-size:.7rem;letter-spacing:.02em;white-space:nowrap}
.ffm-foot-links{display:flex;gap:.2rem 1rem;flex-wrap:wrap}
.ffm-foot-copy{text-align:right;opacity:.75;font-size:.72rem}
.ffm-foot-links a{font-weight:500}
@media (max-width:700px){
  .ffm-foot{grid-template-columns:1fr;text-align:left;padding:.8rem 1rem calc(.8rem + env(safe-area-inset-bottom,0))}
  .ffm-foot-badges{justify-content:flex-start}
  .ffm-foot-copy{text-align:left}
}
@media print{.ffm-site-footer,.app-footer{display:none!important}}

/* The app shell reserved a fixed 44px for the old one-line footer; let the new footer size itself. */
.app-shell{grid-template-rows:60px auto 1fr auto}
@media (max-width:1024px){.app-shell{grid-template-rows:60px auto 1fr auto}}
.app-footer{overflow:visible!important;height:auto!important;min-height:0!important}
.app-footer .ffm-foot{padding:.55rem 1.2rem .5rem;grid-template-columns:auto 1fr auto;grid-template-areas:"brand links badges" "copy copy copy"}
.app-footer .ffm-foot-brand{grid-area:brand}.app-footer .ffm-foot-links{grid-area:links;justify-content:center}.app-footer .ffm-foot-badges{grid-area:badges}
.app-footer .ffm-foot-copy{grid-area:copy;text-align:center;border-top:1px solid rgba(255,255,255,.08);padding-top:.35rem;margin-top:.1rem}
@media (max-width:900px){
  .app-footer .ffm-foot{grid-template-columns:1fr;grid-template-areas:"brand" "links" "badges" "copy"}
  .app-footer .ffm-foot-links{justify-content:flex-start}.app-footer .ffm-foot-copy{text-align:left}
}

/* Footer link colours must beat the older light-theme footer link rules */
.ffm-site-footer .ffm-foot a,.app-footer .ffm-foot a{color:#a9c8ea!important;border-bottom:0!important;white-space:nowrap}
.ffm-site-footer .ffm-foot a:hover,.app-footer .ffm-foot a:hover{color:#fff!important;text-decoration:underline!important}
.ffm-site-footer .ffm-foot .ffm-powered,.app-footer .ffm-foot .ffm-powered{color:#d6e6f8!important;font-weight:700;border-bottom:1px dotted rgba(214,230,248,.6)!important}
