/*
 * Wendt Team Portal: one stylesheet for every portal page (views in app/Modules/TeamPortal/resources/views).
 * Brand from wendtpartners.com: dark green #4b721d, lime #b0bc22, greys #5d5d5d / #4f4f4f / #323232, light #f8f8f8;
 * Libre Franklin (body) and Montserrat (headings), self-hosted under fonts/ (SIL Open Font License, see the OFL files).
 * Layout per Stephanie's spec §5: a left panel with primary navigation only, a main area with a top bar (page title on
 * the left, the user menu on the right). Below 768px the panel slides in behind the menu button.
 */

@font-face {
  font-family: "Libre Franklin";
  src: url("fonts/libre-franklin-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("fonts/montserrat-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --green: #4b721d;
  --green-dark: #3a5916;
  --green-tint: #eef3e6;
  --lime: #b0bc22;
  --lime-tint: #f4f6d9;
  --lime-ink: #4d5300;
  --ink: #323232;
  --ink-2: #4f4f4f;
  --muted: #5d5d5d;
  --line: #e2e2e2;
  --line-strong: #cfcfcf;
  --bg: #f8f8f8;
  --card: #fff;
  --bad: #b42318;
  --bad-tint: #fdecea;
  --focus: #4b721d;
  --panel-w: 248px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(50, 50, 50, .06), 0 1px 3px rgba(50, 50, 50, .04);
  --font-body: "Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font: 15px/1.55 var(--font-body);
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--font-head); color: var(--ink); line-height: 1.25; }
h1 { font-size: 20px; font-weight: 700; margin: 0; }
h2 { font-size: 16px; font-weight: 700; margin: 0 0 12px; }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
p { margin: 0 0 12px; }
a { color: var(--green); }
a:hover { color: var(--green-dark); }

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

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--green); color: #fff;
  padding: 8px 14px; border-radius: 6px; text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 12px; color: #fff; }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: var(--panel-w) minmax(0, 1fr); min-height: 100vh; }

.panel {
  background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.panel-brand { display: block; padding: 22px 20px 18px; border-bottom: 1px solid var(--line); text-decoration: none; }
.panel-brand img { display: block; width: 168px; height: auto; }
.panel-brand span {
  display: block; margin-top: 10px; font: 600 11px/1 var(--font-head); letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}

.nav { padding: 14px 12px 24px; }
.nav-group { margin-top: 18px; }
.nav-group:first-child { margin-top: 0; }
.nav-label {
  padding: 0 12px 6px; font: 600 11px/1.2 var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin: 1px 0; border-radius: 8px;
  color: var(--ink-2); text-decoration: none; font-weight: 500; border-left: 3px solid transparent;
}
.nav a svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav a:hover { background: var(--bg); color: var(--ink); }
.nav a[aria-current="page"] {
  background: var(--green-tint); color: var(--green-dark); font-weight: 600; border-left-color: var(--green);
}

/* "Quick links" (every role): one item that folds open; the links open in a new tab (the small arrow-out icon) */
.nav-quick { margin-top: 10px; }
.nav-disclosure {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; margin: 1px 0; border: 0;
  border-left: 3px solid transparent; border-radius: 8px; background: none; color: var(--ink-2); font: 500 15px/1.55 var(--font-body);
  text-align: left; cursor: pointer;
}
.nav-disclosure:hover { background: var(--bg); color: var(--ink); }
.nav-disclosure[aria-expanded="true"] { color: var(--ink); }
.nav-disclosure svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-disclosure .nav-text { flex: 1; min-width: 0; }
.nav-disclosure .chev { width: 16px; height: 16px; color: var(--muted); transition: transform .15s ease; }
.nav-disclosure[aria-expanded="true"] .chev { transform: rotate(180deg); }
.nav .quick-list { margin: 2px 0 4px 21px; padding-left: 8px; border-left: 1px solid var(--line); }
.nav .quick-list[hidden] { display: none; }
.nav .quick-list a { padding: 7px 10px; font-size: 14px; gap: 8px; }
.nav .quick-list a .nav-text { flex: 1; min-width: 0; }
.nav .quick-list a svg.ext { width: 14px; height: 14px; color: var(--muted); stroke-width: 2; }
.nav .quick-list a:hover svg.ext { color: var(--green); }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; min-height: 64px;
  padding: 10px 28px; background: #fff; border-bottom: 1px solid var(--line);
}
.topbar h1 { margin-right: auto; overflow-wrap: anywhere; }
.menu-button {
  display: none; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none;
  border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--ink); cursor: pointer;
}
.menu-button svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }

.content { padding: 28px; max-width: 1120px; width: 100%; }

/* user menu (top right): name, role, Sign out */
.usermenu { position: relative; }
.usermenu summary {
  list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 8px 4px 4px;
  border-radius: 999px; border: 1px solid transparent;
}
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover, .usermenu[open] summary { background: var(--bg); border-color: var(--line); }
.avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--green); color: #fff; font: 600 13px/1 var(--font-head); flex: none;
}
.usermenu .who { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.usermenu .who strong { font-weight: 600; font-size: 14px; }
.usermenu .who small { color: var(--muted); font-size: 12px; }
.usermenu .chev { width: 16px; height: 16px; stroke: var(--muted); fill: none; stroke-width: 2; }
.usermenu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); width: 260px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 8px 24px rgba(50, 50, 50, .14); padding: 8px; z-index: 30;
}
.usermenu-panel .me { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.usermenu-panel .me strong { display: block; }
.usermenu-panel .me span { display: block; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.usermenu-panel button {
  width: 100%; text-align: left; padding: 9px 10px; border: 0; border-radius: 6px; background: none; color: var(--ink);
  font: inherit; cursor: pointer;
}
.usermenu-panel button:hover { background: var(--bg); }

.scrim { display: none; }

/* ---------------------------------------------------------------- building blocks */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 22px; margin-bottom: 20px; min-width: 0;
}
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.card > :last-child { margin-bottom: 0; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.grid-2 > .card { margin-bottom: 0; }
.stack > * + * { margin-top: 20px; }

.welcome { margin-bottom: 20px; }
.welcome h2 { font-size: 22px; margin: 0 0 4px; }
.welcome p { color: var(--muted); margin: 0; }

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

.muted { color: var(--muted); }
.small { font-size: 13px; }
.empty { color: var(--muted); padding: 6px 0; margin: 0; }

.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 8px; margin-bottom: 20px; border: 1px solid; }
.flash.ok { background: var(--green-tint); border-color: #c9d9b3; color: #2d4511; }
.flash.err { background: var(--bad-tint); border-color: #f3c2bd; color: #7a1a12; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px;
  border-radius: 8px; border: 1px solid var(--green); background: var(--green); color: #fff; font: 600 14px/1.2 var(--font-body);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
.btn.light { background: #fff; color: var(--green-dark); border-color: var(--line-strong); }
.btn.light:hover { background: var(--green-tint); border-color: var(--green); color: var(--green-dark); }
.btn.bad { background: #fff; color: var(--bad); border-color: #e7a59e; }
.btn.bad:hover { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.small { min-height: 32px; padding: 5px 12px; font-size: 13px; }
.btn .count {
  display: inline-flex; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; align-items: center;
  justify-content: center; background: var(--lime); color: var(--ink); font-size: 12px;
}
.btn.light .count { background: var(--green); color: #fff; }

/* tags */
.tag {
  display: inline-block; font: 600 12px/1.2 var(--font-body); padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  background: #ededed; color: var(--ink-2); border: 1px solid transparent;
}
.tag.st-pending { background: #ededed; color: #444; }
.tag.st-approved { background: #e3edd6; color: #2f4a12; }
.tag.st-declined { background: var(--bad-tint); color: #8f1d14; }
.tag.ev-vacation { background: #e4eef8; color: #1c4673; }
.tag.ev-sick-day { background: #fcecdc; color: #7a3f06; }
.tag.ev-personal-day { background: #eee7f7; color: #4f327a; }
.tag.ev-holiday, .tag.company-holiday { background: var(--lime-tint); color: var(--lime-ink); border-color: #d9de8f; }
.tag.muted-tag { background: #f1f1f1; color: var(--muted); }
.tag.role { background: var(--green-tint); color: var(--green-dark); }

/* tables: rows stack into cards on a phone (each cell carries data-label) */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table thead th {
  font: 600 12px/1.2 var(--font-head); letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
  border-bottom-color: var(--line-strong); padding-top: 6px;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fbfbfb; }
.table td.nowrap { white-space: nowrap; }
.table .strong { font-weight: 600; }
.table a.strong { color: var(--ink); text-decoration: none; }
.table a.strong:hover { color: var(--green); text-decoration: underline; }
.table .row-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

/* details of one request */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { font: 600 12px/1.2 var(--font-head); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts .wide { grid-column: 1 / -1; }
.prewrap { white-space: pre-wrap; }
.request-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.request-head h2 { margin: 0; font-size: 18px; }

/* Who's out */
.out-list { list-style: none; margin: 0; padding: 0; }
.out-list li { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.out-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.out-list li:first-child { padding-top: 0; }
.datechip {
  flex: none; width: 52px; text-align: center; border-radius: 8px; background: var(--green-tint); color: var(--green-dark);
  padding: 6px 0 7px; line-height: 1;
}
.datechip .m { display: block; font: 600 11px/1 var(--font-head); letter-spacing: .08em; text-transform: uppercase; }
.datechip .d { display: block; font: 700 20px/1 var(--font-head); margin-top: 4px; }
.out-list li.holiday .datechip { background: var(--lime); color: var(--ink); }
.out-body { min-width: 0; flex: 1; }
.out-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.out-line strong { font-weight: 600; }
.out-dates { color: var(--muted); font-size: 14px; margin-top: 2px; }

/* forms */
.form { max-width: 720px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.form-grid .wide { grid-column: 1 / -1; }
.field { margin-bottom: 18px; min-width: 0; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.field .optional { font-weight: 400; color: var(--muted); }
.help { color: var(--muted); font-size: 13px; margin-top: 6px; }
input[type="text"], input[type="password"], input[type="date"], input:not([type]), select, textarea {
  display: block; width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: #fff; color: var(--ink); font: inherit;
}
select { appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d5d5d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; }
textarea { min-height: 110px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #b5b5b5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(75, 114, 29, .25); }
[aria-invalid="true"] { border-color: var(--bad) !important; }
.error { color: var(--bad); font-size: 13px; margin-top: 6px; font-weight: 500; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 6px; }
.notice { padding: 12px 14px; border-radius: 8px; background: var(--bad-tint); color: #7a1a12; border: 1px solid #f3c2bd; margin-bottom: 18px; }
.who-line { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.who-line .who strong { display: block; }
.who-line .who span { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- sign-in page */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 16px;
  background: linear-gradient(180deg, #fff 0, var(--bg) 100%); }
.auth-card {
  width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 10px 30px rgba(50, 50, 50, .08); padding: 36px 32px 30px; text-align: center; border-top: 4px solid var(--green);
}
.auth-card img { width: 220px; max-width: 100%; height: auto; margin: 0 auto 20px; display: block; }
.auth-card h1 { font-size: 22px; margin-bottom: 8px; }
.auth-card .lead { color: var(--muted); margin-bottom: 24px; }
.auth-card .flash { text-align: left; }
.auth-foot { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* Google's "Sign in with Google" button look (light theme): white, the G mark, dark text, Google's border */
.google-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px; height: 46px; padding: 0 22px;
  min-width: 260px; background: #fff; color: #1f1f1f; border: 1px solid #747775; border-radius: 6px; text-decoration: none;
  font: 600 15px/1 var(--font-body); box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}
.google-btn:hover { background: #f8faf6; color: #1f1f1f; border-color: var(--green); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.google-btn svg { width: 20px; height: 20px; flex: none; }
.auth-hint { margin: 10px 0 0; color: var(--muted); font-size: 13px; }

/* the super admin's password form: a small link under the Google button that opens the form */
.super-admin { margin-top: 22px; text-align: left; }
.super-admin > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--green);
  font-size: 13px; font-weight: 600; padding: 4px 2px; border-radius: 4px; margin: 0 auto;
}
.super-admin > summary::-webkit-details-marker { display: none; }
.super-admin > summary::before {
  content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s ease; margin-right: 2px;
}
.super-admin[open] > summary::before { transform: rotate(45deg); }
.super-admin { display: flex; flex-direction: column; }
.super-admin > summary { align-self: center; }
.super-form { margin-top: 14px; padding: 18px 18px 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.super-form .field { margin-bottom: 14px; }
.super-form .btn { margin-bottom: 12px; }
.btn.block { display: flex; width: 100%; }

/* ---------------------------------------------------------------- tablet and phone */
@media (max-width: 1024px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 768px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .panel {
    position: fixed; left: 0; top: 0; bottom: 0; width: min(84vw, 300px); z-index: 50; height: auto;
    transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; visibility: hidden;
  }
  .nav-open .panel { transform: none; visibility: visible; box-shadow: 0 0 40px rgba(0, 0, 0, .2); }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(30, 30, 30, .35); z-index: 40; }
  .menu-button { display: inline-flex; }
  .topbar { padding: 10px 16px; min-height: 60px; }
  .topbar h1 { font-size: 17px; }
  .usermenu .who, .usermenu .chev { display: none; }
  .usermenu summary { padding: 2px; }
  .usermenu-panel { width: min(260px, calc(100vw - 32px)); }
  .content { padding: 18px 16px; }
  .card { padding: 16px; }
  .form-grid, .facts { grid-template-columns: minmax(0, 1fr); }
  .actions .btn { flex: 1 1 auto; }

  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .table tbody tr:last-child { border-bottom: 0; }
  .table td { border: 0; padding: 3px 0; display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; overflow-wrap: anywhere; }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; }
  .table td[data-label=""] { grid-template-columns: minmax(0, 1fr); }
  .table td[data-label=""]::before { display: none; }
  .table td.nowrap { white-space: normal; }
  .table tbody tr:hover td { background: none; }
  .table .row-actions { justify-content: flex-start; margin-top: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .panel { transition: none; }
}

.out-line a.strong { font-weight: 600; color: var(--ink); text-decoration: none; }
.out-line a.strong:hover { color: var(--green); text-decoration: underline; }

@media (max-width: 768px) {
  .table td > .tag, .table td > .strong { justify-self: start; }
}

/* People: the role picker inline in the table */
.role-form { display: flex; align-items: center; gap: 8px; }
.role-form select.compact { min-height: 34px; padding: 5px 32px 5px 10px; width: auto; min-width: 150px; font-size: 14px; }
.tag.role-super_admin, .tag.role-admin { background: var(--green); color: #fff; }

/* the notice that a Slack DM was skipped (no Slack account) */
.notice.muted-notice { background: var(--lime-tint); color: var(--lime-ink); border-color: #d9de8f; }

/* Quick links admin page: the list (position, link, roles, actions) and the form (URL, position, roles) */
input[type="url"], input[type="number"] {
  display: block; width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: #fff; color: var(--ink); font: inherit;
}
input.narrow { max-width: 120px; }
fieldset.checks { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
fieldset.checks legend { font-weight: 600; margin-bottom: 8px; padding: 0; color: var(--ink); }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--green); flex: none; }
.table.quick-links th.num, .table.quick-links td.num { width: 44px; color: var(--muted); font-weight: 600; }
.link-cell { display: flex; flex-direction: column; min-width: 0; }
.link-cell .url { font-size: 13px; color: var(--muted); text-decoration: none; overflow-wrap: anywhere; }
.link-cell .url:hover { color: var(--green); text-decoration: underline; }
.row-actions form.move { display: inline-flex; gap: 4px; }
.table.quick-links th.nowrap, .table.quick-links td[data-label="Visible to"] { white-space: nowrap; }
.table.quick-links .row-actions { flex-wrap: nowrap; }
.btn.icon { padding: 5px 8px; }
.btn.icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn[disabled] { opacity: .4; cursor: default; pointer-events: none; }
@media (max-width: 768px) {
  .check-grid { grid-template-columns: minmax(0, 1fr); }
  .table.quick-links td.num { width: 100%; }
  .table.quick-links .row-actions { flex-wrap: wrap; }
  .table.quick-links td[data-label="Visible to"] { white-space: normal; }
}

/* the super admin's "Ops & automation" section: the pages open in the ops panel */
.nav-ops { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.nav-ops .nav-label { color: var(--green-dark); }
.nav-ops a .nav-text { flex: 1; min-width: 0; }
.nav-ops a svg { width: 18px; height: 18px; }

/* long values (ids, URLs) wrap instead of widening the page (OOO calendar page, 2026-11-04) */
.content code { overflow-wrap: anywhere; word-break: break-all; }

/* ---------------------------------------------------------------- Reports (app/Modules/Reports: the shared components)
 * header (title, data as of, CSV), filter bar, KPI tiles (value with n / d), data table (sortable, sticky header, scrolls
 * sideways on a phone instead of stacking), empty state, per-row "as of" with the Stale tag, the index list. */
.nav a .nav-text { flex: 1; min-width: 0; }

.report-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 20px; }
.report-head-text { min-width: 0; flex: 1 1 420px; }
.report-head h2 { font-size: 20px; margin: 0 0 4px; }
.report-head p { margin: 0; max-width: 720px; }
.report-head-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.report-asof { font-size: 13px; color: var(--muted); }
.report-asof strong { color: var(--ink); font-weight: 600; }
.report-head .btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

input[type="month"] {
  display: block; width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: #fff; color: var(--ink); font: inherit;
}
.report-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; padding: 16px 18px; }
.report-filters .field { margin: 0; flex: 1 1 170px; max-width: 260px; }
.report-filters .field label { font-size: 13px; margin-bottom: 4px; }
.report-filters select, .report-filters input { min-height: 38px; padding-top: 7px; padding-bottom: 7px; }
.report-filter-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.kpi-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi-tile {
  background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px; min-width: 0;
}
.kpi-tile.tone-good { border-top-color: var(--green); }
.kpi-tile.tone-warn { border-top-color: var(--lime); }
.kpi-tile.tone-bad { border-top-color: var(--bad); }
.kpi-label { font: 600 12px/1.3 var(--font-head); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.kpi-value { font: 700 28px/1.1 var(--font-head); color: var(--ink); margin-top: 8px; font-variant-numeric: tabular-nums; }
.kpi-nd { margin-top: 4px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.kpi-nd .kpi-n, .kpi-nd .kpi-d { color: var(--ink-2); font-weight: 600; }

.table-scroll { overflow: auto; max-height: min(72vh, 760px); border: 1px solid var(--line); border-radius: 8px; -webkit-overflow-scrolling: touch; }
.table-scroll:focus-visible { outline-offset: 0; }
.data-table { width: 100%; min-width: 640px; border-collapse: separate; border-spacing: 0; }
.data-table th, .data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table thead th {
  position: sticky; top: 0; z-index: 1; background: #fafafa; white-space: nowrap;
  font: 600 12px/1.2 var(--font-head); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); border-bottom-color: var(--line-strong);
}
.data-table th.num, .data-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table td.nowrap { white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #fbfbfb; }
.data-table .strong { font-weight: 600; }
.data-table a.strong { color: var(--ink); text-decoration: none; }
.data-table a.strong:hover { color: var(--green); text-decoration: underline; }
.data-table a.sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; text-decoration: none; }
.data-table a.sort:hover, .data-table th.sorted, .data-table th.sorted a.sort { color: var(--green-dark); }
.data-table a.sort svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .55; }
.data-table th.sorted a.sort svg { opacity: 1; }

.report-empty { text-align: center; padding: 28px 12px; }
.report-empty svg { display: block; width: 40px; height: 40px; margin: 0 auto 10px; stroke: var(--line-strong); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.report-empty .strong { font-weight: 600; margin-bottom: 4px; }
.report-empty .small { margin: 0; }

.asof { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.tag.stale { background: #fcecdc; color: #7a3f06; }

.report-list { list-style: none; margin: 0; padding: 0; }
.report-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.report-list li:first-child { padding-top: 0; }
.report-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.report-list-text { min-width: 0; flex: 1 1 320px; }
.report-list-text a.strong { font-weight: 600; font-size: 16px; color: var(--ink); text-decoration: none; }
.report-list-text a.strong:hover { color: var(--green); text-decoration: underline; }
.report-list-text p { margin: 2px 0 0; }
.report-list-meta { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }

/* Delivery KPI (app/Modules/Reports/resources/views/delivery-kpi*): status and flag tags, worklist groups, cohort cells,
 * side lists. Light only, like the rest of the portal; tags carry text, colour is never the only cue. */
.tag.failed, .tag.cls-bad { background: var(--bad-tint); color: #8f1d14; }
.tag.cls-warn { background: var(--lime-tint); color: var(--lime-ink); border-color: #d9de8f; }
.tag.flag-hold { background: #e4eef8; color: #1c4673; }
.tag.flag-done { background: #eee7f7; color: #4f327a; }
.kpi-scope { margin: -6px 0 16px; }
.kpi-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.kpi-flags:empty { display: none; }
.data-table td .tag + .tag { margin-top: 2px; }
.data-table tr.group-client th, .data-table tr.group-eng th { text-align: left; position: static; text-transform: none; letter-spacing: 0; white-space: normal; }
.data-table tr.group-client th { background: var(--green-tint); color: var(--green-dark); font: 700 14px/1.3 var(--font-head); padding-top: 12px; border-bottom-color: #d6e2c5; }
.data-table tr.group-eng th { background: #fafafa; color: var(--ink-2); font: 600 13px/1.3 var(--font-body); }
.data-table tbody tr.group-client:hover th, .data-table tbody tr.group-eng:hover th { background-clip: padding-box; }
.data-table tbody th[scope="row"] { font-weight: 600; text-align: left; }
.data-table tbody tr:last-child th { border-bottom: 0; }
.kpi-sub { font-size: 16px; margin: 22px 0 4px; }
.card > .kpi-sub:first-of-type { margin-top: 0; }
.kpi-sub + p { margin: 0 0 10px; }
.table-scroll + .table-scroll { margin-top: 12px; }
.cohort-cell { min-width: 200px; font-variant-numeric: tabular-nums; }
.cohort-rate { font-size: 14px; }
.cohort-rate strong { font: 700 18px/1.2 var(--font-head); color: var(--ink); margin-right: 4px; }
.cohort-nd { color: var(--ink-2); font-weight: 600; }
.cohort-parts { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi-unverified { margin: 12px 0 0; }
.kpi-lists { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.kpi-lists .card .data-table { min-width: 560px; }

@media (max-width: 768px) {
  .report-filters .field { flex-basis: 100%; max-width: none; }
  .report-filter-actions { width: 100%; }
  .kpi-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-value { font-size: 24px; }
  .report-list-meta { align-items: flex-start; text-align: left; }
  .kpi-scope { margin-top: 0; }
}
