/* screens_admin.css — Direction A (Focus)
   Admin/station screen styles (home, companies, billing, reporting, notifications).
   Owned by Slice U3. Screen-specific selectors only; shared components live in
   components.css. Ported from the per-screen <style> blocks of admin-home.html and
   admin-companies.html in docs/techstation-mockup-v1/. */

/* ---------- shared admin bits ---------- */
.subhead {
  color: var(--muted);
  font-size: 15px;
  margin: -18px 0 28px;
}

.empty {
  color: var(--muted);
  font-size: 14.5px;
}

.backlink {
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}

.backlink:hover {
  color: var(--ink);
}

.pagehead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.pagehead h1.page {
  margin: 0;
}

.pagehead .headactions {
  display: flex;
  gap: 8px;
}

/* ---------- admin home: stat tiles ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 34px;
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

.stat .n {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1;
}

.stat .l {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 5px;
}

.stat.alert .n {
  color: var(--red);
}

/* ---------- attention / task-row item list ---------- */
.attention {
  display: grid;
  gap: 11px;
  margin-bottom: 36px;
}

.item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 16px 18px;
  transition: .16s;
}

.item .dotcol {
  width: 9px;
  height: 46px;
  border-radius: 6px;
  flex: none;
  background: #6f6f63;
}

.item.overdue .dotcol {
  background: var(--red);
}

.item.soon .dotcol {
  background: var(--warn);
}

.item.info .dotcol {
  background: #6f6f63;
}

.item .info {
  flex: 1;
  min-width: 0;
}

.item .info strong {
  font-size: 16px;
  display: block;
  letter-spacing: -.01em;
}

.item .info span {
  font-size: 13.5px;
  color: var(--muted);
}

.item .info .co-name {
  color: var(--ink);
  font-weight: 700;
}

.item .who {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin-right: 4px;
  text-align: right;
}

.item .who b {
  display: block;
  color: var(--ink);
}

/* The completion / nudge buttons (button_to renders a <form>; style the button). */
.item .act,
.notif .act {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 11px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: .15s;
  color: var(--ink);
}

.item .act:hover,
.notif .act:hover {
  border-color: #c9c7ba;
}

.item form,
.notif form {
  margin: 0;
}

.item.overdue .act {
  background: var(--clay);
  border-color: var(--clay);
  color: #fff;
}

.item.overdue .act:hover {
  background: var(--clay-deep);
}

.item .act.act-quiet {
  background: var(--paper);
  border-color: var(--line);
  color: var(--muted);
}

.item.done {
  opacity: .5;
}

/* Status badges beside an item's title. */
.badge {
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 10px;
  margin-left: 2px;
}

.badge.od {
  background: #f6dcd7;
  color: var(--red);
}

.badge.sn {
  background: #fbf0e2;
  color: var(--warn);
}

/* ---------- admin home: "run the dock" cards ---------- */
.settings {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.scard {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  cursor: pointer;
  transition: .16s;
  box-shadow: var(--shadow);
}

.scard:hover {
  transform: translateY(-2px);
  border-color: #c9c7ba;
}

.scard .ico {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--clay-soft);
  display: grid;
  place-items: center;
  flex: none;
}

.scard .ico svg {
  width: 20px;
  height: 20px;
  stroke: var(--clay);
  fill: none;
  stroke-width: 1.7;
}

.scard strong {
  font-size: 15px;
  display: block;
}

.scard > span:last-child > span {
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- companies: search + table ---------- */
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  margin-bottom: 18px;
}

.search svg {
  width: 17px;
  height: 17px;
  stroke: var(--muted);
  fill: none;
  stroke-width: 2;
  flex: none;
}

.search input {
  border: none;
  background: none;
  font: inherit;
  font-size: 14.5px;
  color: var(--ink);
  width: 100%;
  outline: none;
}

.ctable {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.chead,
.crow {
  display: grid;
  grid-template-columns: 2fr 1.3fr .8fr 1.4fr auto;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
}

.chead.prefs,
.crow.prefs {
  grid-template-columns: 2fr 1.3fr 1fr auto;
}

/* The companies list adds a dedicated Status column so the rooms cell never
   doubles as a status pill. */
.chead.companies,
.crow.companies {
  grid-template-columns: 2fr 1.3fr .8fr 1.4fr 1fr auto;
}

.crow .status {
  font-size: 12.5px;
  color: var(--muted);
}

.chead {
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}

.crow {
  border-bottom: 1px solid var(--line);
}

.crow:last-child {
  border-bottom: none;
}

.co {
  display: flex;
  align-items: center;
  gap: 12px;
}

.co .logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  flex: none;
}

.co strong {
  font-size: 14.5px;
}

.cvr {
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  color: var(--muted);
}

.crow .rooms {
  font-size: 12.5px;
  color: var(--muted);
}

.crow .rooms b {
  color: var(--ink);
  font-weight: 600;
}

.more {
  color: var(--muted);
  font-weight: 700;
  text-align: center;
  border-radius: 8px;
  padding: 4px 8px;
}

.more:hover {
  background: #eceadd;
}

.more.text {
  font-weight: 700;
  font-size: 14px;
}

/* ---------- company detail + hardtech toggle ---------- */
.detailcard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 22px;
}

.detailcard.empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.detailcard p {
  margin: 0;
}

.details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 28px;
  margin: 0;
}

.details > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.details dt {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.details dd {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.hardtech-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card);
  cursor: pointer;
  margin-bottom: 22px;
  font: inherit;
  color: var(--ink);
}

.hardtech-toggle .meta {
  flex: 1;
}

.hardtech-toggle .meta strong {
  display: block;
  font-size: 14.5px;
}

.hardtech-toggle .meta span {
  font-size: 12.5px;
  color: var(--muted);
}

.hardtech-toggle .switch {
  margin-left: auto;
}

/* ---------- admin forms ---------- */
.adminform {
  max-width: 560px;
  display: grid;
  gap: 16px;
}

.adminform .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.adminform label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.adminform input[type="text"],
.adminform input[type="email"],
.adminform input[type="number"],
.adminform input[type="date"],
.adminform select {
  font: inherit;
  font-size: 15px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  color: var(--ink);
  outline: none;
}

.adminform input:focus,
.adminform select:focus {
  border-color: var(--clay);
  box-shadow: 0 0 0 3px var(--clay-soft);
}

.adminform .btn,
.adminform input[type="submit"] {
  justify-self: start;
}

.formerrors {
  background: var(--clay-soft);
  border: 1px solid #f1c4ab;
  border-radius: 12px;
  padding: 12px 15px;
  color: var(--clay-deep);
  font-size: 14px;
}

.formerrors p {
  margin: 2px 0;
}

/* ---------- report / billing tables + date-range form ---------- */
.daterange {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.daterange .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.daterange label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.daterange input[type="date"] {
  font: inherit;
  font-size: 15px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  color: var(--ink);
}

.billsection {
  margin-bottom: 34px;
}

.reporttable {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.reporttable table {
  width: 100%;
  border-collapse: collapse;
}

.reporttable th {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.reporttable td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.reporttable tbody tr:last-child td {
  border-bottom: none;
}

.reporttable th.num,
.reporttable td.num {
  text-align: right;
}

.reporttable tfoot td {
  font-weight: 700;
  border-top: 2px solid var(--line);
  border-bottom: none;
  background: var(--paper);
}

.reporttable .flagnote {
  color: var(--warn);
  font-size: 12.5px;
}

/* ---------- notification centre filters ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.filters select,
.filters input[type="date"] {
  font: inherit;
  font-size: 14px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  color: var(--ink);
}

.filters .checkfield {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

/* ---------- notifications inbox ---------- */
.notifs {
  display: grid;
  gap: 11px;
}

.notif {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 16px 18px;
}

.notif .dotcol {
  width: 9px;
  height: 40px;
  border-radius: 6px;
  flex: none;
  background: #d8d6c9;
}

.notif.unread .dotcol {
  background: var(--clay);
}

.notif .info {
  flex: 1;
  min-width: 0;
}

.notif .info strong {
  font-size: 15.5px;
  display: block;
}

.notif .info span {
  font-size: 13px;
  color: var(--muted);
}

.notif .info span.body {
  display: block;
  color: var(--ink);
  margin: 2px 0 3px;
}

/* ---------- notification preferences edit ---------- */
.prefslist {
  display: grid;
  gap: 4px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px;
}

.prefrow {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border-radius: 11px;
  cursor: pointer;
  font-size: 14.5px;
}

.prefrow:hover {
  background: var(--paper);
}

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .settings {
    grid-template-columns: 1fr;
  }

  /* Stack the meta + action under the description so the owner/action column
     never overlaps the wrapping text on narrow screens. The dot stays in the
     first row beside the description; everything else flows to full-width rows
     below it. */
  .item {
    flex-wrap: wrap;
  }

  .item .info {
    flex: 1 1 calc(100% - 25px);
  }

  .item .who {
    flex-basis: 100%;
    margin-left: 25px;
    text-align: left;
    order: 4;
  }

  .item .act {
    width: 100%;
    text-align: center;
    order: 5;
  }

  .item .dotcol {
    height: auto;
    align-self: stretch;
  }

  .pagehead {
    flex-direction: column;
    align-items: flex-start;
  }

  .details {
    grid-template-columns: 1fr;
  }

  .chead {
    display: none;
  }

  .crow,
  .crow.prefs {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "co pill"
      "meta meta";
    row-gap: 8px;
    padding: 14px 16px;
  }

  .co {
    grid-area: co;
  }

  .crow .pill,
  .crow .status {
    grid-area: pill;
    justify-self: end;
  }

  .cvr {
    display: none;
  }

  .crow .rooms {
    grid-area: meta;
  }

  /* The companies list keeps its own cells: company name on top with the status
     pill beside it, the two count cells side by side below — no overlap. */
  .crow.companies {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "co status"
      "people allowed";
    row-gap: 8px;
  }

  .crow.companies .status {
    grid-area: status;
    justify-self: end;
  }

  .crow.companies .rooms.people {
    grid-area: people;
  }

  .crow.companies .rooms.allowed {
    grid-area: allowed;
    justify-self: end;
  }

  .more {
    display: none;
  }

  .reporttable {
    overflow-x: auto;
  }
}
