/* HMC Staff Hub: styles. The look follows the CRM and the booking portals (Montserrat, HMC teal, the dark header,
   rounded buttons); each portal's tile carries its business's colour: HMC teal, RITE4SITE lilac (#c7a0f0, not a darker
   purple), INSPEKTA red. */
:root {
  --teal: #02a0b0; --teal-d: #017f8c; --teal-l: #e5f6f7;
  --header: #333333; --ink: #111111; --muted: #5a5f63; --line: #dcdfe1; --bg: #f2f3f4; --card: #fff;
  --red: #b3261e; --red-l: #fdeceb; --amber-l: #fff3df; --amber: #8a5300;
  --inspekta: #b31800; --rite4site: #c7a0f0; --training: #02a0b0;
  --r: 10px; --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 14px -8px rgba(40, 60, 80, .35);
  color-scheme: light;
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 15px; line-height: 1.45; }
h1 { font-size: 1.45rem; line-height: 1.2; margin: 0 0 .4em; font-weight: 700; }
p { margin: 0 0 .6em; }
a { color: var(--teal-d); }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
:focus-visible { outline: 3px solid #0a66b0; outline-offset: 2px; }
[hidden] { display: none !important; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  background: var(--teal); color: #fff; border: 1px solid transparent; border-radius: 50px;
  padding: .5em 1.3em; min-height: 42px; font: inherit; font-size: 15px; font-weight: 600; text-decoration: none;
  box-shadow: 0 3px 11px rgba(0, 0, 0, .18); white-space: nowrap; cursor: pointer;
}
.btn:hover { background: var(--header); color: #fff; }
.btn.ghost { background: #fff; color: var(--teal-d); border-color: var(--teal); box-shadow: none; }
.btn.ghost:hover { background: var(--teal-l); }
.btn.wide { width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: #fff; text-decoration: underline; font-weight: 500; cursor: pointer; }

/* the top bar */
.topbar { background: var(--header); color: #fff; position: sticky; top: 0; z-index: 20; }
.topbar .bar { max-width: 1100px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 14px; min-height: 52px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; flex: none; }
.brand-logo { display: block; height: 28px; width: auto; }
.brand-name { border-left: 1px solid #6b6b6b; padding-left: 12px; font-weight: 600; letter-spacing: .02em; }
.me { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: .85rem; color: #d6d8da; min-width: 0; }
.me .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .linkbtn { white-space: nowrap; }

/* the page */
.page { max-width: 760px; margin: 0 auto; padding: 28px 16px 48px; }
.page.wide { max-width: 1100px; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 22px; }
.card.signin { max-width: 420px; margin: 24px auto 0; text-align: center; }
.signin-swirl { display: block; margin: 0 auto 10px; }
.note { background: var(--teal-l); border-radius: 8px; padding: 10px 12px; margin: 12px 0; text-align: left; }
.note.warn { background: var(--amber-l); color: #5f3a00; }
.note.small { font-size: .82rem; background: none; padding: 0; color: var(--muted); }
.back { margin: 0 0 12px; font-size: .9rem; }
.back a { text-decoration: none; font-weight: 600; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin: 16px 0 20px; }
.tile {
  display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 16px 16px 16px 14px; color: var(--ink); text-decoration: none; border-left: 5px solid var(--tc, var(--teal));
  transition: transform .08s ease, box-shadow .08s ease; min-height: 84px;
}
.tile:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0, 0, 0, .08), 0 8px 20px -10px rgba(40, 60, 80, .45); }
.tile .swirl { flex: none; width: 44px; height: 44px; }
.tile-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tile-name { font-weight: 700; font-size: 1.02rem; }
.tile-blurb { color: var(--muted); font-size: .86rem; }
.tile-go { flex: none; font-size: 1.6rem; line-height: 1; color: var(--tc, var(--teal)); }
.brand-training { --tc: var(--training); }
.brand-rite4site { --tc: var(--rite4site); }
.brand-inspekta { --tc: var(--inspekta); }
.brand-rite4site .tile-go { color: #9b6fd0; }
.admin-link { margin-top: 8px; }

/* other sites: plain grey, so they read as outside HMC */
h2.section { font-size: 1.05rem; margin: 26px 0 .2em; font-weight: 700; }
.tile.site { --tc: #8a9096; min-height: 72px; }
.site-mark {
  flex: none; width: 40px; height: 40px; border-radius: 50%; background: #eceeef; color: #4a4f53;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.05rem;
}
.site-mark.has-icon { background: #fff; border: 1px solid var(--line); }
.site-mark img { display: block; width: 28px; height: 28px; object-fit: contain; }
.tile.site .tile-go { font-size: 1.15rem; color: #6b7175; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 .2em; }
.section-head h2.section, .section-head p { margin: 0; }
#tiles > .section-head:first-child { margin-top: 6px; }
.tile .swirl.small { width: 40px; height: 40px; }
.section-head h2.section:focus { outline: none; }
.btn.small { min-height: 34px; padding: .3em 1.1em; font-size: .85rem; }
.linkbtn.dark { color: var(--teal-d); font-size: .9rem; }

/* Harry's quote: a slim band under the greeting, so the links stay near the top */
.quote-band { display: flex; align-items: flex-start; gap: 12px; margin: 10px 0 0; padding: 12px 16px; border: 1px solid #d3eef0; border-radius: var(--r); background: linear-gradient(100deg, var(--teal-l) 0%, #fff 80%); }
.quote-band.empty { align-items: center; justify-content: space-between; }
.quote-band.empty p { margin: 0; }
.quote-mark { flex: none; margin-top: -2px; font-family: Georgia, "Times New Roman", serif; font-size: 2.6rem; line-height: .9; color: var(--teal); }
.quote-body { flex: 1; min-width: 0; }
.quote-label { margin: 0; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--teal-d); }
.quote-band blockquote { margin: 2px 0 0; font-size: 1.02rem; font-weight: 600; line-height: 1.4; color: #1d2a30; }
.quote-band blockquote p { margin: 0; }
.quote-band figcaption { margin-top: 4px; font-size: .82rem; color: var(--muted); }
.quote-band figcaption::before { content: "\2014\00a0"; }
.news-edit { flex: none; font-size: .85rem; }
.quote-band .news-edit { align-self: center; }

/* below the links: the monthly topic and our values */
.about-block { margin: 30px 0 0; }
.about-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.about-head h2.section { margin: 0; }
.about-head .news-edit { margin-left: auto; }
.topic-card { padding: 18px 20px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); border-top: 4px solid var(--teal); }
.topic-card h3 { margin: 0 0 8px; font-size: 1.15rem; }
.news-body p, .news-body ul { margin: 0 0 .6em; font-size: .93rem; }
.news-body ul { padding-left: 1.2em; }
.news-body li { margin: .2em 0; }
.values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.value { padding: 16px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
.value-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; margin-bottom: 8px; border-radius: 50%; background: var(--teal-l); color: var(--teal-d); }
.value-icon svg { width: 20px; height: 20px; }
.value h3 { margin: 0 0 4px; font-size: .98rem; }
.value p { margin: 0; font-size: .88rem; color: var(--muted); }
.values-more { margin-top: 10px; }

/* hub admins changing the topic or the quotes */
.news-card { margin: 10px 0 0; padding: 16px 18px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
.news-label { margin: 0 0 4px; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--teal-d); }
.news-form .field { display: block; margin: 10px 0; }
.news-form .field span { display: block; margin-bottom: 4px; font-weight: 600; font-size: .85rem; }
.news-form input, .news-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font: inherit; font-size: .95rem; }
.news-form textarea { resize: vertical; line-height: 1.45; }
.news-form select { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: .95rem; background: #fff; }
.quote-row { margin: 10px 0; padding: 4px 12px 2px; border: 1px solid var(--line); border-radius: 8px; }
.quote-row-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.quote-row-head .field { margin-bottom: 4px; }
@media (max-width: 760px) {
  .values { grid-template-columns: minmax(0, 1fr); }
}

/* the tools above the tiles: search, grid or list, add a link, arrange */
.hub-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 4px; }
.hub-tools .find { flex: 1 1 220px; min-width: 0; min-height: 38px; border: 1px solid var(--line); border-radius: 50px; padding: 8px 14px; font: inherit; font-size: .9rem; background: #fff; }
.view-switch { display: inline-flex; border: 1px solid var(--teal); border-radius: 50px; overflow: hidden; background: #fff; }
.view-switch button { border: 0; background: none; color: var(--teal-d); font: inherit; font-size: .85rem; font-weight: 600; padding: .3em 1em; min-height: 34px; cursor: pointer; }
.view-switch button[aria-pressed="true"] { background: var(--teal); color: #fff; }
.intro { margin: 6px 0 0; }

/* list: one row each, smaller */
.tiles.list { grid-template-columns: minmax(0, 1fr); gap: 6px; }
.tiles.list > * { min-width: 0; }
.tiles.list .tile { min-height: 50px; padding: 7px 14px 7px 12px; gap: 12px; }
.tiles.list .tile .swirl { width: 30px; height: 30px; }
.tiles.list .site-mark { width: 30px; height: 30px; font-size: .9rem; }
.tiles.list .site-mark img { width: 20px; height: 20px; }
.tiles.list .tile-text { flex-direction: row; align-items: baseline; gap: 10px; }
.tiles.list .tile-name { white-space: nowrap; }
.tiles.list .tile-blurb { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 3 to 8 per row: just the icon and the name, with the colour along the top. Never narrower than 76px a tile, so a
   phone shows fewer per row than chosen */
.per-row { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--teal-d); }
.per-row select { min-height: 34px; border: 1px solid var(--teal); border-radius: 50px; padding: 4px 10px; background: #fff; color: var(--ink); font: inherit; }
.tiles.icons { grid-template-columns: repeat(auto-fill, minmax(max(76px, calc((100% - (var(--cols) - 1) * 10px) / var(--cols))), 1fr)); gap: 10px; }
.tiles.icons > * { min-width: 0; }
.tiles.icons .tile { flex-direction: column; justify-content: center; gap: 8px; min-height: 106px; padding: 14px 6px 10px; text-align: center; border-left: 0; border-top: 4px solid var(--tc, var(--teal)); }
.tiles.icons .tile.own { border-top-style: dashed; }
.tiles.icons .tile-text, .tiles.icons .tile.own .tile-text { flex: none; width: 100%; padding-right: 0; }
.tiles.icons .tile-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: break-word; hyphens: auto; font-size: .8rem; line-height: 1.25; }
.tiles.icons .tile-blurb, .tiles.icons .tile-go { display: none; }
.tiles.icons .tile .swirl { width: 40px; height: 40px; }
.tiles.icons .tile-edit { top: 6px; right: 6px; transform: none; width: 26px; height: 26px; font-size: .8rem; }

/* a person's own links: a dashed edge, and a button to change them */
.tile-wrap { position: relative; display: flex; min-width: 0; }
.tile-wrap > .tile { flex: 1; min-width: 0; }
.tile.own { border-left-style: dashed; }
.tile.own .tile-text { padding-right: 38px; }
.tile-edit { position: absolute; top: 50%; right: 40px; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: #4a4f53; font-size: .95rem; line-height: 1; cursor: pointer; }
.tile-edit:hover { background: var(--teal-l); border-color: var(--teal); }
.link-form { margin: 14px 0 4px; max-width: 560px; scroll-margin-top: 70px; }
.link-form h2.section { margin: 0 0 .2em; }
.link-form .field { display: block; margin: 10px 0; }
.link-form .field span { display: block; margin-bottom: 4px; font-weight: 600; font-size: .85rem; }
.link-form input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font: inherit; font-size: .95rem; }
.small-note { font-size: .85rem; }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.linkbtn.danger { color: var(--red); }

/* arranging the page: one column, a handle to drag and arrows to move */
.tiles.arranging { list-style: none; padding: 0; grid-template-columns: 1fr; max-width: 560px; gap: 8px; }
.arr-item { min-height: 58px; padding: 8px 10px 8px 4px; gap: 10px; user-select: none; -webkit-user-select: none; }
.arr-item:hover { transform: none; }
.arr-handle { flex: none; width: 36px; height: 42px; display: flex; align-items: center; justify-content: center; color: #6b7175; cursor: grab; touch-action: none; border-radius: 6px; }
.arr-handle:hover { background: #eceeef; }
.arr-item.dragging { position: relative; z-index: 2; outline: 2px solid var(--teal); box-shadow: 0 10px 26px -8px rgba(40, 60, 80, .5); }
.arr-item.dragging .arr-handle { cursor: grabbing; }
.arr-moves { flex: none; display: flex; gap: 6px; }
.arr-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-size: 1.05rem; cursor: pointer; }
.arr-btn:hover:not(:disabled) { background: var(--teal-l); border-color: var(--teal); }
.arr-btn:disabled { opacity: .3; cursor: default; }
.arr-bar { position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 0; margin-top: 6px; background: var(--bg); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* who sees which portal */
.toolbar { display: flex; align-items: center; gap: 12px; margin: 14px 0 10px; flex-wrap: wrap; }
.toolbar input { flex: 1 1 220px; max-width: 340px; border: 1px solid var(--line); border-radius: 50px; padding: 9px 14px; font: inherit; font-size: .9rem; background: #fff; }
.gridwrap { overflow-x: auto; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
.grid { border-collapse: collapse; width: 100%; font-size: .88rem; }
.grid th, .grid td { border-bottom: 1px solid var(--line); padding: 8px 10px; }
.grid thead th { position: sticky; top: 0; background: #fafbfb; vertical-align: bottom; }
.grid .pcol { text-align: center; min-width: 96px; font-weight: 600; font-size: .78rem; border-bottom: 3px solid var(--tc, var(--teal)); }
.grid .pcol img { display: block; margin: 0 auto 4px; }
.grid .pcol span { display: block; line-height: 1.2; }
.grid .pcol small { display: block; color: var(--muted); font-weight: 500; margin-top: 2px; }
.grid .pcol-person { text-align: left; min-width: 200px; }
.grid tbody th { text-align: left; font-weight: 500; position: sticky; left: 0; background: #fff; }
.grid .pname { display: block; font-weight: 600; }
.grid .pemail { display: block; color: var(--muted); font-size: .78rem; }
.grid td { text-align: center; }
.grid input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--teal); cursor: pointer; }
.grid input[type=checkbox]:disabled { cursor: not-allowed; }
.grid tbody tr:hover th, .grid tbody tr:hover td { background: #f6fbfb; }
.grid .pcol.site { --tc: #8a9096; min-width: 44px; width: 44px; padding: 8px 4px; }
/* the other sites' names run up the column, so many sites fit across */
.grid .pcol.site span { writing-mode: vertical-rl; transform: rotate(180deg); margin: 0 auto 6px; white-space: nowrap; text-align: left; }
.grid .pcol .site-mark.small { width: 22px; height: 22px; font-size: .72rem; margin: 0 auto 4px; }
.grid .pcol .site-mark.small.has-icon { border: 0; background: none; }
.grid .pcol .site-mark.small img { width: 20px; height: 20px; margin: 0; }
.grid .colgroups th { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); text-align: center; padding: 6px 10px 2px; border-bottom: 0; background: #fafbfb; position: static; }
.grid .first-site { border-left: 2px solid var(--line); }
.notes { color: var(--muted); font-size: .84rem; padding-left: 1.2em; margin: 14px 0 0; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--header); color: #fff; padding: 10px 16px; border-radius: 50px; font-size: .9rem; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); max-width: calc(100% - 32px); z-index: 30; }
.toast.bad { background: var(--red); }

@media (max-width: 560px) {
  .brand-logo { height: 24px; }
  .tiles { grid-template-columns: 1fr; }
  .page { padding-top: 20px; }
  .me .who { display: none; }
  .tiles.icons .tile { padding: 12px 4px 8px; }
  .tiles.icons .tile-name { font-size: .72rem; }
}
