@charset "UTF-8";
/* =====================================================================
   Floied Access — interface styles

   Design notes
   ------------
   The vernacular here is the inspection tag: the punched manila card wired
   to every extinguisher and hood system, showing when a unit was last
   serviced and by whom. Service standing renders as that tag throughout.

   No webfonts. Crews open this on cell data from a roof or a kitchen line,
   so the type is a system stack that paints instantly; the personality
   comes from the tracking, weight and tabular figures instead.
   ===================================================================== */

:root {
  --ink:        #16191d;
  --steel:      #5a6672;
  --steel-soft: #8a949e;
  --paper:      #eceef0;
  --surface:    #ffffff;
  --line:       #d3d8dd;
  --line-soft:  #e6e9ec;

  --fire:       #c1272d;
  --fire-dark:  #9d1f24;
  --amber:      #b96f00;
  --green:      #2c7a52;
  --manila:     #e7dcc2;
  --manila-ink: #6b5a33;

  --radius:  4px;
  --radius-lg: 8px;
  --shadow: 0 1px 2px rgba(22,25,29,.08), 0 4px 14px rgba(22,25,29,.06);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo,
          Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
}

a { color: var(--fire-dark); }

:focus-visible {
  outline: 3px solid var(--fire);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- micro label: the recurring structural device ------------------- */
.lbl {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--steel);
}

.num { font-variant-numeric: tabular-nums; }

/* --- app bar -------------------------------------------------------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ink);
  color: #fff;
  border-bottom: 3px solid var(--fire);
}
.bar-in {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: .02em;
  margin-right: auto;
}
.brand img { height: 30px; width: auto; display: block; background: #fff; border-radius: 3px; padding: 2px; }
.brand span { font-size: 15px; }
.brand small {
  display: block;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--steel-soft);
  font-weight: 600;
}

.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: #dfe4e9;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 9px 11px;
  border-radius: var(--radius);
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}
.nav a:hover, .nav a:focus { background: rgba(255,255,255,.12); color: #fff; }
.nav a[aria-current="page"] { background: var(--fire); color: #fff; }
.nav .who {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--steel-soft);
  padding-left: 10px;
  border-left: 1px solid rgba(255,255,255,.18);
}
.nav .who b { color: #fff; display: block; font-size: 12px; letter-spacing: .02em; }

/* --- shell ---------------------------------------------------------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 20px 16px 64px; }
.wrap-narrow { max-width: 560px; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.page-head h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.page-head p { margin: 4px 0 0; color: var(--steel); font-size: 14px; }

/* --- cards / panels ------------------------------------------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.panel + .panel { margin-top: 16px; }
.panel-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.panel-head h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--steel);
}
.panel-body { padding: 18px; }

/* --- inspection tag: the signature element -------------------------- */
/* A punched manila tag, as wired to an extinguisher.                   */
.tag {
  --tag-bg: var(--manila);
  --tag-fg: var(--manila-ink);
  --tag-edge: #cbbb92;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 18px;
  background: var(--tag-bg);
  color: var(--tag-fg);
  border: 1px solid var(--tag-edge);
  border-left: none;
  border-radius: 0 3px 3px 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  clip-path: polygon(9px 0, 100% 0, 100% 100%, 9px 100%, 0 50%);
}
/* the punch hole */
.tag::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--tag-edge);
}
.tag.is-current   { --tag-bg:#e3f0e8; --tag-fg:#1f5c3c; --tag-edge:#b6d6c3; }
.tag.is-soon      { --tag-bg:#fbeed6; --tag-fg:#8a5200; --tag-edge:#e6cd9b; }
.tag.is-overdue   { --tag-bg:#f9e0e1; --tag-fg:#96181e; --tag-edge:#e4b3b5; }
.tag.is-inactive  { --tag-bg:#e8eaec; --tag-fg:#5a6672; --tag-edge:#cfd4d9; }
.tag.is-unscheduled { --tag-bg:var(--manila); --tag-fg:var(--manila-ink); --tag-edge:#cbbb92; }

/* --- filter bar ----------------------------------------------------- */
.filters { padding: 14px; display: grid; gap: 10px; }
.filters .row-search { display: flex; gap: 8px; }
.filters .row-search input { flex: 1; }
.filters .row-selects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
.filter-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px dashed var(--line);
  margin-top: 2px;
}
.count { font-size: 13px; color: var(--steel); }
.count b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* --- form controls -------------------------------------------------- */
label.field { display: block; }
label.field > .lbl { margin-bottom: 5px; }

input[type=text], input[type=search], input[type=email], input[type=password],
input[type=date], input[type=time], input[type=number], input[type=tel],
select, textarea {
  width: 100%;
  font-family: inherit;
  font-size: 16px;               /* 16px stops iOS zooming on focus */
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  min-height: 46px;              /* comfortable with gloves on */
  -webkit-appearance: none;
  appearance: none;
}
select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%235a6672' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 11px;
  padding-right: 34px;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus {
  border-color: var(--fire);
  box-shadow: 0 0 0 3px rgba(193,39,45,.14);
  outline: none;
}
input[readonly] { background: var(--paper); color: var(--steel); }
.hint { font-size: 12px; color: var(--steel); margin-top: 5px; }

/* --- buttons -------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 46px;
  padding: 11px 18px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--fire);
  border: 1px solid var(--fire);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--fire-dark); border-color: var(--fire-dark); }
.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--paper); border-color: var(--steel-soft); }
.btn-dark { background: var(--ink); border-color: var(--ink); }
.btn-dark:hover { background: #000; border-color: #000; }
.btn-sm { min-height: 38px; padding: 8px 12px; font-size: 12px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* --- alerts --------------------------------------------------------- */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid;
  font-size: 14px;
  margin-bottom: 16px;
}
.alert-error   { background:#fbeaea; border-color:#e8bcbe; color:#8f1a20; }
.alert-success { background:#e6f2eb; border-color:#b7d9c6; color:#1f5c3c; }
.alert-info    { background:#e9eef4; border-color:#c3d1e0; color:#2b4058; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

/* --- record list ---------------------------------------------------- */
.list { border-top: 1px solid var(--line-soft); }

.list-head {
  display: none;
  padding: 9px 18px;
  background: #f7f8f9;
  border-bottom: 1px solid var(--line);
}
.list-head a, .list-head span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--steel);
  text-decoration: none;
}
.list-head a:hover { color: var(--fire-dark); }
.list-head a .dir { color: var(--fire); }

.rec {
  display: block;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
  color: inherit;
}
.rec:last-child { border-bottom: none; }
.rec:hover { background: #f7f8f9; }
.rec:focus-visible { outline-offset: -3px; }

.rec-name { font-weight: 700; font-size: 15.5px; line-height: 1.3; }
.rec-no {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--steel);
  letter-spacing: .02em;
}
.rec-cell { min-width: 0; }
.rec-cell .v { font-size: 14px; overflow-wrap: anywhere; }
.rec-cell .lbl { margin-bottom: 1px; }

/* Mobile: stacked record cards */
.rec-grid { display: grid; gap: 10px; }
.rec-sub {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

/* Desktop: aligned columns */
@media (min-width: 900px) {
  .list-head { display: block; }
  .list-head .cols, .rec .rec-grid {
    display: grid;
    grid-template-columns: minmax(0,2.3fr) minmax(0,1.3fr) minmax(0,1.1fr) minmax(0,.9fr) minmax(0,1.15fr);
    gap: 14px;
    align-items: center;
  }
  .rec .rec-sub { display: contents; }
  .rec-cell .lbl { display: none; }
}

/* --- pagination ----------------------------------------------------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 16px;
}
.pager a, .pager span {
  min-width: 42px;
  min-height: 42px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.pager a:hover { background: var(--paper); }
.pager .is-current {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  font-weight: 700;
}
.pager .gap { border: none; background: none; color: var(--steel-soft); min-width: 20px; }

/* --- detail view ---------------------------------------------------- */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px 22px;
}
.dl .lbl { margin-bottom: 3px; }
.dl .v { font-size: 15px; overflow-wrap: anywhere; }
.dl .v a { text-decoration: none; font-weight: 600; }
.dl .v a:hover { text-decoration: underline; }

.notes {
  white-space: pre-wrap;
  font-size: 14.5px;
  line-height: 1.6;
  background: #fbfaf6;
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--manila);
  border-radius: var(--radius);
  padding: 12px 14px;
  overflow-wrap: anywhere;
}

.summary-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: #f7f8f9;
  border-bottom: 1px solid var(--line-soft);
}

/* --- single form ---------------------------------------------------- */
.form-section + .form-section {
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}
.form-section > h3 {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fire-dark);
}
.grid2 { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 720px) {
  .grid2 { grid-template-columns: 1fr 1fr; }
  .grid2 .span2 { grid-column: 1 / -1; }
}

.form-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding: 12px 18px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: 0 -4px 14px rgba(22,25,29,.06);
}
@media (max-width: 719px) {
  .form-bar .btn { flex: 1 1 100%; }
}

/* --- tables (admin) ------------------------------------------------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left;
  font-size: 11px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--steel);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f7f8f9;
  white-space: nowrap;
}
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: var(--paper);
  color: var(--steel);
  border: 1px solid var(--line);
}
.pill.on  { background:#e3f0e8; color:#1f5c3c; border-color:#b6d6c3; }
.pill.off { background:#f9e0e1; color:#96181e; border-color:#e4b3b5; }

/* --- empty state ---------------------------------------------------- */
.empty { padding: 48px 20px; text-align: center; }
.empty h3 { margin: 0 0 6px; font-size: 17px; }
.empty p { margin: 0 0 18px; color: var(--steel); font-size: 14px; }

/* --- auth screens --------------------------------------------------- */
.auth { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-brand { text-align: center; margin-bottom: 20px; }
.auth-brand img { max-width: 150px; height: auto; }
.auth-brand .lbl { margin-top: 10px; letter-spacing: .16em; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 14px; }
.auth-foot a { color: var(--fire-dark); }

.stack { display: grid; gap: 14px; }

.muted { color: var(--steel); font-size: 13px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

@media print {
  .bar, .form-bar, .pager, .filters, .actions { display: none !important; }
  body { background: #fff; }
  .panel { box-shadow: none; border-color: #999; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
