/* List pages: the Sample Plan Register (and, with M9, the equipment register
   and bookings). A filter row over a wide table that scrolls sideways on a
   narrow screen, as the old registers did. */

.register-filters {
  display: grid;
  grid-template-columns: minmax(14rem, 2fr) repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: .6rem .75rem;
  align-items: end;
}
.register-toggles { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; min-height: 44px; }
.register-toggles .toggle-setting { margin: 0; }
.register-note { min-height: 1.2rem; }
.register-note.tone-warn { color: var(--warning-text); font-weight: 600; }
.register-note.tone-error { color: var(--danger); font-weight: 600; }
.register-warning { color: var(--warning-text); font-weight: 600; }

.table-wrap { overflow-x: auto; margin-top: .75rem; -webkit-overflow-scrolling: touch; }
.register-table { width: 100%; min-width: 62rem; border-collapse: collapse; font-size: .92rem; }
.register-table th {
  text-align: left;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .035em;
  color: var(--label);
  background: var(--header);
  padding: .55rem .6rem;
  white-space: nowrap;
}
.register-table td { padding: .55rem .6rem; border-top: 1px solid #e2e8f0; vertical-align: top; }
.register-row { cursor: pointer; }
.register-row:hover > td, .register-row:focus-within > td { background: #f1f5f9; }
.register-reference { font-weight: 800; color: var(--text); text-decoration: none; white-space: nowrap; }
.register-reference:hover { text-decoration: underline; }
.register-badges { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .3rem; }
.register-badges:empty { display: none; }
.register-nowrap { white-space: nowrap; }
.register-by { display: block; font-size: .8rem; }
.register-empty { margin-top: .75rem; }

.register-progress {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--label);
}
.register-progress.progress-part { border-color: var(--warning-border); background: var(--warning-bg); color: var(--warning-text); }
.register-progress.progress-done { border-color: #86efac; background: #f0fdf4; color: #166534; }
.register-progress.progress-nodays { border-style: dashed; color: var(--muted); }

@media (max-width: 760px) {
  .register-filters { grid-template-columns: 1fr 1fr; }
  .register-search { grid-column: 1 / -1; }
}

/* The Plans page (decided 2026-10-02): the register and the plans on this
   device in one list, chosen as Mine, On this device or All. Each plan is
   one of the old home page's cards: in the register's columns on a wide
   screen, stacked on a narrow one. A plan on this device is white, with an
   edge in the colour of its sync. */
.plans-scope-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  margin-bottom: .75rem;
}
.plans-freshness { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.plans-freshness .register-note { margin: 0; text-align: right; }

/* A choice of one, as joined buttons. */
.segmented { display: inline-flex; flex-wrap: wrap; gap: .25rem; padding: .25rem; border-radius: .95rem; background: #e2e8f0; }
.segment {
  min-height: 40px;
  padding: .45rem .8rem;
  gap: .45rem;
  border-radius: .7rem;
  background: transparent;
  color: var(--label);
}
.segment[aria-pressed="true"] { background: var(--header); color: var(--text); box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .12); }
.segment-count {
  min-width: 1.6rem;
  padding: .05rem .4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .75);
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
}

.plan-entries {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  margin-top: .85rem;
}
.plan-entry-head, .plan-entry {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.05fr) minmax(0, 1fr) minmax(0, 1.3fr) 2.5rem minmax(0, .85fr) minmax(0, 1fr);
  grid-template-areas: "plan site dates planned progress kit created last";
  column-gap: .75rem;
  align-items: start;
}
.has-company > .plan-entry-head, .has-company > .plan-entry {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.05fr) minmax(0, 1fr) minmax(0, 1.3fr) 2.5rem minmax(0, .85fr) minmax(0, 1fr);
  grid-template-areas: "plan company site dates planned progress kit created last";
}
.plan-entry-head {
  padding: .55rem .9rem;
  border-radius: .75rem;
  background: var(--header);
  color: var(--label);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .035em;
}
.plan-entry {
  position: relative;
  padding: .7rem .9rem;
  gap: 0 .75rem;
  font-size: .92rem;
}
.plan-entry.on-device { background: var(--card); box-shadow: inset 4px 0 0 #4ade80; }
.plan-entry.on-device.tone-pending { box-shadow: inset 4px 0 0 #818cf8; }
.plan-entry.on-device.tone-warn { box-shadow: inset 4px 0 0 #f59e0b; }
.plan-entry.on-device.tone-error { box-shadow: inset 4px 0 0 #ef4444; }
.plan-entry.is-unavailable { opacity: .6; }
.pe-plan { grid-area: plan; min-width: 0; }
.pe-company { grid-area: company; }
.pe-site { grid-area: site; }
.pe-dates { grid-area: dates; }
.pe-planned { grid-area: planned; }
.pe-progress { grid-area: progress; }
.pe-kit { grid-area: kit; }
.pe-created { grid-area: created; }
.pe-last { grid-area: last; }
.pe-where, .pe-more { display: contents; }
.pe-title { display: flex; align-items: center; gap: .4rem; }
.pe-reference { font-size: 1rem; font-weight: 800; overflow-wrap: anywhere; }
.pe-device { display: inline-flex; color: #16a34a; }
.pe-device .icon { width: 1.1rem; height: 1.1rem; }
.tone-pending .pe-device { color: #4f46e5; }
.tone-warn .pe-device { color: #b45309; }
.tone-error .pe-device { color: var(--danger); }
.pe-badges { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .3rem; }
.pe-badges:empty { display: none; }
.plan-entry .badge { margin-left: 0; }
.pe-by { display: block; font-size: .8rem; }
.plan-entry .register-progress { white-space: normal; }
/* Each cell's name: the heading says it on a wide screen. */
.pe-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 979px) {
  .plan-entry-head { display: none; }
  .plan-entry, .has-company > .plan-entry {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "plan progress" "badges badges" "where where" "more more";
    row-gap: .35rem;
  }
  .plan-entry .pe-plan { display: contents; }
  .pe-title { grid-area: plan; }
  .pe-badges { grid-area: badges; margin-top: 0; }
  .pe-progress { justify-self: end; }
  .pe-where { grid-area: where; display: flex; flex-wrap: wrap; gap: 0 .5rem; }
  .pe-where > span + span::before { content: "·"; margin-right: .5rem; color: var(--muted); }
  .pe-more { grid-area: more; display: flex; flex-wrap: wrap; gap: .1rem 1rem; color: var(--label); font-size: .85rem; }
  .pe-more .is-empty { display: none; }
  .pe-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; color: var(--muted); }
  .pe-by { display: inline; margin-left: .25rem; }
  .pe-by::before { content: "("; }
  .pe-by::after { content: ")"; }
}
@media (max-width: 520px) {
  .plans-card .page-heading { flex-direction: column; align-items: stretch; gap: .6rem; }
  .plans-card .page-heading .button-row > * { flex: 1 1 0; }
  .plans-freshness { margin-left: 0; width: 100%; justify-content: space-between; }
  .plans-freshness .register-note { text-align: left; }
  .segmented { width: 100%; }
  .segment { flex: 1 1 auto; padding: .45rem .5rem; }
}
