/* =====================================================================
   MAD Rescue staff shell — sidebar layout + refined dark theme.
   Loaded last on every staff page (base_staff.html), so it wins over the
   older approval/app styles without touching the public site.
   ===================================================================== */

body.staff-shell {
  --ms-bg: #0b0e12;
  --ms-surface: #12161c;
  --ms-surface-2: #181d25;
  --ms-surface-3: #1f2530;
  --ms-border: #232a35;
  --ms-border-strong: #2f3744;
  --ms-text: #e7ebf0;
  --ms-text-2: #b4bcc8;
  --ms-muted: #7f8a99;
  --ms-accent: #3ccf85;
  --ms-accent-2: #2bb070;
  --ms-accent-soft: rgba(60, 207, 133, 0.12);
  --ms-accent-ink: #052414;
  --ms-warn: #f2b84b;
  --ms-danger: #f0616d;
  --ms-radius: 12px;
  --ms-radius-sm: 8px;
  --ms-sidebar: 252px;
  --ms-font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  margin: 0;
  min-height: 100vh;
  background: var(--ms-bg) !important;
  color: var(--ms-text);
  font-family: var(--ms-font);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;
  font-feature-settings: "cv11", "ss01";
}

/* ---------------------------------------------------------------- layout */
body.staff-shell .ms-app {
  background: linear-gradient(to right, var(--ms-surface) var(--ms-sidebar), transparent var(--ms-sidebar));
  display: grid;
  grid-template-columns: var(--ms-sidebar) minmax(0, 1fr);
  min-height: 100vh;
}
body.staff-shell .ms-nav-toggle,
body.staff-shell .ms-scrim { display: none; }

body.staff-shell .ms-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ms-surface);
  border-right: 1px solid var(--ms-border);
  padding: 18px 12px 12px;
  overflow-y: auto;
}

body.staff-shell .ms-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 18px;
  color: var(--ms-text);
  text-decoration: none;
}
body.staff-shell .ms-brand img { height: 34px; width: auto; }
body.staff-shell .ms-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
body.staff-shell .ms-brand-text strong { font-size: 14px; font-weight: 650; letter-spacing: -0.01em; }
body.staff-shell .ms-brand-text small { font-size: 11.5px; color: var(--ms-muted); }

body.staff-shell .ms-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
body.staff-shell .ms-nav-label {
  margin: 16px 10px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ms-muted);
}
body.staff-shell .ms-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--ms-radius-sm);
  color: var(--ms-text-2);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.12s ease, color 0.12s ease;
}
body.staff-shell .ms-nav-item:hover { background: var(--ms-surface-2); color: var(--ms-text); }
body.staff-shell .ms-nav-item.is-active {
  background: var(--ms-accent-soft);
  color: var(--ms-text);
  box-shadow: inset 2px 0 0 var(--ms-accent);
}
body.staff-shell .ms-nav-item.is-active .ms-ico { color: var(--ms-accent); }
body.staff-shell .ms-nav-item span:not(.ms-badge) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

body.staff-shell .ms-ico {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.staff-shell .ms-badge {
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--ms-surface-3);
  color: var(--ms-text);
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
body.staff-shell .ms-nav-item.is-active .ms-badge { background: var(--ms-accent); color: var(--ms-accent-ink); }

body.staff-shell .ms-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius);
  background: var(--ms-surface-2);
}
body.staff-shell .ms-avatar {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ms-accent), #1f8f5a);
  color: var(--ms-accent-ink);
  font-weight: 700;
  font-size: 13px;
  display: grid;
  place-items: center;
  text-transform: uppercase;
}
body.staff-shell .ms-user-meta { flex: 1; min-width: 0; }
body.staff-shell .ms-user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.staff-shell .ms-user-timer { font-size: 11px; color: var(--ms-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
body.staff-shell .ms-logout {
  width: 32px;
  height: 32px;
  border-radius: var(--ms-radius-sm);
  display: grid;
  place-items: center;
  color: var(--ms-muted);
}
body.staff-shell .ms-logout:hover { background: var(--ms-surface-3); color: var(--ms-text); }

/* ---------------------------------------------------------------- main */
body.staff-shell .ms-main { min-width: 0; display: flex; flex-direction: column; }

body.staff-shell .ms-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 32px;
  background: rgba(11, 14, 18, 0.82);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--ms-border);
}
body.staff-shell .ms-menu-btn,
body.staff-shell .ms-topbar-logo { display: none; }

body.staff-shell .ms-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px !important;
  color: var(--ms-muted);
}
body.staff-shell .ms-crumbs a { color: var(--ms-muted); text-decoration: none; }
body.staff-shell .ms-crumbs a:hover { color: var(--ms-text); }
body.staff-shell .ms-crumbs [aria-current] { color: var(--ms-text); font-weight: 500; }
body.staff-shell .ms-crumb-sep { color: var(--ms-border-strong); }

body.staff-shell .ms-content { flex: 1; padding: 28px 32px 40px; }

/* The old centred "app card" becomes the page surface. */
body.staff-shell .wrap { display: block; min-height: 0; padding: 0; }
body.staff-shell .shell { width: 100%; max-width: 1240px !important; margin: 0 auto; }
body.staff-shell .card {
  min-height: 0 !important;
  max-width: none !important;
  width: 100%;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0;
  box-shadow: none !important;
  overflow: visible;
}
body.staff-shell .card-inner { padding: 0 !important; }
body.staff-shell .footer {
  margin-top: 40px;
  text-align: center;
  font-size: 12px;
  color: var(--ms-muted);
  opacity: 1;
}

/* ---------------------------------------------------------------- type */
body.staff-shell h1 {
  margin: 0 0 20px;
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--ms-text);
}
body.staff-shell h2 { font-size: 18px; font-weight: 620; letter-spacing: -0.01em; color: var(--ms-text); }
body.staff-shell h3 { font-size: 15px; font-weight: 600; color: var(--ms-text); }
body.staff-shell .muted { color: var(--ms-muted) !important; }
body.staff-shell a { color: inherit; }
body.staff-shell .card-inner a:not(.btn):not([class*="tile"]):not([class*="ms-"]):not([class*="sp-"]):not([class*="ov-"]) {
  color: var(--ms-accent);
  text-decoration: none;
}
body.staff-shell .card-inner a:not(.btn):not([class*="tile"]):not([class*="ms-"]):not([class*="sp-"]):not([class*="ov-"]):hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
body.staff-shell .ms-page-title { font-size: 13px; font-weight: 500; color: var(--ms-text); }

/* ---------------------------------------------------------------- inner cards (sub-panels used across pages) */
body.staff-shell .card .card,
body.staff-shell .sp-card,
body.staff-shell .panel {
  background: var(--ms-surface) !important;
  border: 1px solid var(--ms-border) !important;
  border-radius: var(--ms-radius) !important;
  box-shadow: none !important;
}

/* ---------------------------------------------------------------- buttons */
body.staff-shell .btn,
body.staff-shell button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--ms-radius-sm);
  border: 1px solid var(--ms-border-strong);
  background: var(--ms-surface-2);
  color: var(--ms-text);
  font: 500 13.5px/1 var(--ms-font);
  box-shadow: none;
  text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.06s ease;
}
body.staff-shell .btn:hover { background: var(--ms-surface-3); border-color: #3a4352; transform: none; }
body.staff-shell .btn:active { transform: translateY(1px); }
body.staff-shell .btn-primary,
body.staff-shell .btn-success {
  background: var(--ms-accent) !important;
  border-color: var(--ms-accent) !important;
  color: var(--ms-accent-ink) !important;
  font-weight: 600;
}
body.staff-shell .btn-primary:hover,
body.staff-shell .btn-success:hover { background: #4fdc95 !important; }
body.staff-shell .btn-danger {
  background: transparent !important;
  border-color: rgba(240, 97, 109, 0.5) !important;
  color: #ff8a93 !important;
}
body.staff-shell .btn-danger:hover { background: rgba(240, 97, 109, 0.1) !important; }
body.staff-shell .btn-secondary { background: var(--ms-surface-2) !important; color: var(--ms-text) !important; }

/* ---------------------------------------------------------------- forms */
body.staff-shell input[type="text"],
body.staff-shell input[type="email"],
body.staff-shell input[type="number"],
body.staff-shell input[type="search"],
body.staff-shell input[type="date"],
body.staff-shell input[type="tel"],
body.staff-shell input[type="url"],
body.staff-shell input[type="password"],
body.staff-shell select,
body.staff-shell textarea {
  background: var(--ms-bg);
  border: 1px solid var(--ms-border-strong);
  border-radius: var(--ms-radius-sm);
  color: var(--ms-text);
  font-family: var(--ms-font);
}
body.staff-shell input:focus-visible,
body.staff-shell select:focus-visible,
body.staff-shell textarea:focus-visible,
body.staff-shell .btn:focus-visible,
body.staff-shell .ms-nav-item:focus-visible {
  outline: 2px solid var(--ms-accent);
  outline-offset: 1px;
}

/* ---------------------------------------------------------------- tables */
body.staff-shell table.sp-table,
body.staff-shell table.table {
  background: var(--ms-surface);
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius);
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}
body.staff-shell table.sp-table th,
body.staff-shell table.table th {
  background: var(--ms-surface-2);
  color: var(--ms-muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--ms-border);
}
body.staff-shell table.sp-table td,
body.staff-shell table.table td { border-bottom: 1px solid var(--ms-border); }
body.staff-shell table.sp-table tr:last-child td,
body.staff-shell table.table tr:last-child td { border-bottom: 0; }
body.staff-shell table.sp-table tbody tr:hover td,
body.staff-shell table.table tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }

/* ---------------------------------------------------------------- messages */
body.staff-shell .sp-msg {
  border-radius: var(--ms-radius-sm);
  border: 1px solid var(--ms-border-strong);
  background: var(--ms-surface-2);
}

/* ---------------------------------------------------------------- overview page */
body.staff-shell .ov-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
body.staff-shell .ov-head h1 { margin: 0; }
body.staff-shell .ov-sub { margin: 4px 0 0; color: var(--ms-muted); }
body.staff-shell .ov-date { color: var(--ms-muted); font-size: 13px; }

body.staff-shell .ov-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}
body.staff-shell .ov-stat {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  background: var(--ms-surface);
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius);
  color: var(--ms-text);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
body.staff-shell .ov-stat:hover { border-color: var(--ms-border-strong); background: var(--ms-surface-2); }
body.staff-shell .ov-stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--ms-text-2); font-weight: 500; }
body.staff-shell .ov-stat-ico {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--ms-surface-3);
  color: var(--ms-text-2);
}
body.staff-shell .ov-stat.is-hot .ov-stat-ico { background: var(--ms-accent-soft); color: var(--ms-accent); }
body.staff-shell .ov-stat-num { font-size: 30px; font-weight: 650; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
body.staff-shell .ov-stat-label { color: var(--ms-muted); font-size: 13px; margin-top: 4px; }
body.staff-shell .ov-stat-go { color: var(--ms-muted); transition: transform 0.15s ease, color 0.15s ease; }
body.staff-shell .ov-stat:hover .ov-stat-go { transform: translateX(3px); color: var(--ms-text); }

body.staff-shell .ov-section-title {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ms-muted);
}
body.staff-shell .ov-apps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
body.staff-shell .ov-app {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--ms-surface);
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius);
  color: var(--ms-text);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
body.staff-shell .ov-app:hover { border-color: var(--ms-border-strong); background: var(--ms-surface-2); }
body.staff-shell .ov-app .ov-stat-ico { width: 32px; height: 32px; }
body.staff-shell .ov-app-title { flex: 1; font-weight: 500; }
body.staff-shell .ov-app-meta { color: var(--ms-muted); font-size: 12.5px; }
body.staff-shell .ov-empty {
  padding: 28px;
  border: 1px dashed var(--ms-border-strong);
  border-radius: var(--ms-radius);
  color: var(--ms-muted);
  text-align: center;
}

/* ---------------------------------------------------------------- small screens */
@media (max-width: 900px) {
  body.staff-shell .ms-app { grid-template-columns: minmax(0, 1fr); }
  body.staff-shell .ms-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(84vw, 300px);
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  }
  body.staff-shell .ms-nav-toggle:checked ~ .ms-sidebar { transform: none; }
  body.staff-shell .ms-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  body.staff-shell .ms-nav-toggle:checked ~ .ms-scrim { opacity: 1; pointer-events: auto; }
  body.staff-shell .ms-menu-btn {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin-left: -6px;
    border-radius: var(--ms-radius-sm);
    color: var(--ms-text);
    cursor: pointer;
  }
  body.staff-shell .ms-menu-btn:hover { background: var(--ms-surface-2); }
  body.staff-shell .ms-topbar { padding: 0 16px; }
  body.staff-shell .ms-topbar-logo { display: block; height: 28px; margin-left: auto; }
  body.staff-shell .ms-crumbs { min-width: 0; overflow: hidden; white-space: nowrap; }
  body.staff-shell .ms-content { padding: 20px 16px 32px; }
  body.staff-shell h1 { font-size: 22px; }
  body.staff-shell .ms-app { background: none; }
  body.staff-shell .ov-stats { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 24px; }
  body.staff-shell .ov-stat { padding: 14px; gap: 10px; }
  body.staff-shell .ov-stat-num { font-size: 24px; }
  body.staff-shell .ov-stat-label { font-size: 12px; }
  body.staff-shell .ov-stat-go { display: none; }
  body.staff-shell .ov-head { margin-bottom: 18px; }
  body.staff-shell .ov-date { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  body.staff-shell * { transition: none !important; }
}

/* ---------------------------------------------------------------- section tiles (Request System, Settings, Reports...) */
body.staff-shell .tiles {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin: 0;
}
body.staff-shell .tile {
  position: relative;
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-height: 0 !important;
  padding: 18px !important;
  background: var(--ms-surface) !important;
  border: 1px solid var(--ms-border) !important;
  border-radius: var(--ms-radius) !important;
  box-shadow: none !important;
  color: var(--ms-text) !important;
  text-align: left !important;
  text-decoration: none;
  transform: none !important;
  transition: border-color 0.15s ease, background 0.15s ease;
}
body.staff-shell .tile::before { display: none !important; }
body.staff-shell .tile:hover { border-color: var(--ms-border-strong) !important; background: var(--ms-surface-2) !important; }
body.staff-shell .tile-icon {
  width: 36px !important;
  height: 36px !important;
  margin: 0 !important;
  border-radius: 9px !important;
  display: grid !important;
  place-items: center;
  background: var(--ms-surface-3) !important;
  color: var(--ms-accent);
  font-size: 18px !important;
  box-shadow: none !important;
}
body.staff-shell .tile-title { font-size: 15px !important; font-weight: 600 !important; color: var(--ms-text) !important; margin: 0 !important; }
body.staff-shell .tile-sub { font-size: 13px !important; color: var(--ms-muted) !important; margin: 0 !important; line-height: 1.45; }
body.staff-shell .tile-count {
  position: absolute;
  top: 18px;
  right: 18px;
  min-width: 24px;
  height: 22px;
  padding: 0 8px !important;
  border-radius: 999px !important;
  background: var(--ms-accent) !important;
  color: var(--ms-accent-ink) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
}
body.staff-shell .tile-add { border-style: dashed !important; }
body.staff-shell .tile-add .tile-icon { background: transparent !important; color: var(--ms-muted); }

/* ---------------------------------------------------------------- status pills */
body.staff-shell .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--ms-surface-3);
  color: var(--ms-text-2);
  border: 1px solid transparent;
}
body.staff-shell .pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
body.staff-shell .pill-submitted  { background: rgba(242, 184, 75, 0.12); color: #f5c76b; border-color: rgba(242, 184, 75, 0.25); }
body.staff-shell .pill-approved,
body.staff-shell .pill-assigned   { background: rgba(96, 165, 250, 0.12); color: #8cbcff; border-color: rgba(96, 165, 250, 0.25); }
body.staff-shell .pill-processing { background: rgba(167, 139, 250, 0.13); color: #bba8ff; border-color: rgba(167, 139, 250, 0.28); }
body.staff-shell .pill-completed  { background: var(--ms-accent-soft); color: var(--ms-accent); border-color: rgba(60, 207, 133, 0.28); }
body.staff-shell .pill-rejected,
body.staff-shell .pill-canceled   { background: rgba(240, 97, 109, 0.12); color: #ff8a93; border-color: rgba(240, 97, 109, 0.25); }
body.staff-shell .pill-draft,
body.staff-shell .pill-none,
body.staff-shell .pill-internal   { background: var(--ms-surface-3); color: var(--ms-muted); border-color: var(--ms-border-strong); }

/* ---------------------------------------------------------------- ticket pages */
body.staff-shell .tk-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
body.staff-shell .tk-head h1 { margin: 2px 0 4px; }
body.staff-shell .tk-head > .pill { margin-top: 6px; height: 28px; padding: 0 12px; font-size: 13px; }
body.staff-shell .tk-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--ms-accent); text-transform: uppercase; }
body.staff-shell .tk-sub { color: var(--ms-muted); }

body.staff-shell .tk-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  grid-template-areas: "main side";
  gap: 20px;
  align-items: start;
}
body.staff-shell .tk-main { grid-area: main; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
body.staff-shell .tk-side { grid-area: side; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 76px; }

body.staff-shell .tk-card,
body.staff-shell .approval-card,
body.staff-shell .ph-card {
  margin: 0 !important;
  padding: 18px 20px !important;
  background: var(--ms-surface) !important;
  border: 1px solid var(--ms-border) !important;
  border-radius: var(--ms-radius) !important;
  box-shadow: none !important;
  color: var(--ms-text);
}
body.staff-shell .tk-card > h3 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ms-muted);
}
body.staff-shell .tk-alert { border-color: rgba(240, 97, 109, 0.4) !important; background: rgba(240, 97, 109, 0.06) !important; }
body.staff-shell .tk-alert > h3 { color: #ff8a93; }
body.staff-shell .tk-prose { color: var(--ms-text); line-height: 1.6; }
body.staff-shell .tk-prose p { margin: 0 0 8px; }
body.staff-shell .tk-small { display: block; font-size: 12.5px; color: var(--ms-muted); }
body.staff-shell a.tk-small { color: var(--ms-accent); }
body.staff-shell td.tk-small, body.staff-shell th.tk-small { display: table-cell; }  /* .tk-small is a block for text lines; a table cell must stay a cell */
body.staff-shell .tk-money { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }

body.staff-shell .tk-dl { margin: 0; display: grid; grid-template-columns: 1fr; gap: 0; }
body.staff-shell .tk-dl dt { font-size: 12px; color: var(--ms-muted); margin-top: 12px; }
body.staff-shell .tk-dl dt:first-child,
body.staff-shell .tk-dl > div:first-child dt { margin-top: 0; }
body.staff-shell .tk-dl dd { margin: 2px 0 0; color: var(--ms-text); overflow-wrap: anywhere; }
body.staff-shell .tk-dl-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px 20px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--ms-border);
}
body.staff-shell .tk-dl-grid dt { margin-top: 0; }
body.staff-shell .tk-list { margin: 0; padding-left: 18px; }

body.staff-shell .tk-decide { border-color: var(--ms-border-strong) !important; }
body.staff-shell .tk-actions { display: flex; flex-direction: column; gap: 8px; margin: 0 !important; }
body.staff-shell .tk-actions form { margin: 0; }
body.staff-shell .tk-wide { width: 100%; }
body.staff-shell .tk-reject summary { list-style: none; cursor: pointer; }
body.staff-shell .tk-reject summary::-webkit-details-marker { display: none; }
body.staff-shell .tk-reject[open] summary { margin-bottom: 10px; }
body.staff-shell .tk-reject label,
body.staff-shell #reject-reason-box label { display: block; font-size: 12.5px; color: var(--ms-muted); margin-bottom: 6px; }
body.staff-shell .tk-reject textarea,
body.staff-shell #reject-reason-box textarea { width: 100%; margin-bottom: 8px; padding: 10px; }
body.staff-shell #reject-reason-box { margin-bottom: 10px; }

body.staff-shell .tk-files { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
body.staff-shell .tk-files a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--ms-border-strong);
  border-radius: var(--ms-radius-sm);
  background: var(--ms-surface-2);
  color: var(--ms-text) !important;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.staff-shell .tk-files a::before { content: "📄"; filter: grayscale(1); opacity: 0.7; }
body.staff-shell .tk-files a:hover { border-color: var(--ms-accent); text-decoration: none !important; }

body.staff-shell .tk-thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
body.staff-shell .tk-comment { padding: 12px 14px; border-radius: var(--ms-radius-sm); background: var(--ms-surface-2); border: 1px solid var(--ms-border); }
body.staff-shell .tk-comment.is-internal { border-left: 3px solid var(--ms-warn); }
body.staff-shell .tk-comment-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ms-muted); margin-bottom: 4px; }
body.staff-shell .tk-comment-meta strong { color: var(--ms-text); font-size: 13px; }
body.staff-shell .tk-comment .tk-prose p:last-child { margin-bottom: 0; }
body.staff-shell .tk-comment-form textarea { width: 100%; padding: 10px 12px; min-height: 80px; }
body.staff-shell .tk-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
body.staff-shell .tk-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ms-text-2); }

body.staff-shell .tk-timeline { list-style: none; margin: 0; padding: 0 0 0 24px; position: relative; }
body.staff-shell .tk-timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 1px; background: var(--ms-border-strong); }
body.staff-shell .tk-timeline li { position: relative; padding: 0 0 14px; }
body.staff-shell .tk-timeline li:last-child { padding-bottom: 0; }
body.staff-shell .tk-timeline li::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 5px;
  width: 13px;
  height: 13px;
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--ms-surface);
  border: 2px solid var(--ms-accent);
}
body.staff-shell .tk-tl-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
body.staff-shell .tk-tl-head strong { font-weight: 600; font-size: 13.5px; }
body.staff-shell .tk-tl-head span { font-size: 12.5px; color: var(--ms-muted); }
body.staff-shell .tk-tl-note { font-size: 13px; color: var(--ms-text-2); margin-top: 2px; }

/* shared panels pulled into ticket pages */
body.staff-shell .approval-label { color: var(--ms-muted) !important; font-size: 12px !important; }
body.staff-shell .approval-meta-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 20px; }
body.staff-shell .ph-card .ph-totals > div { background: var(--ms-surface-2) !important; border: 1px solid var(--ms-border); }
body.staff-shell .ph-card .ph-table th,
body.staff-shell .ph-table th {
  background: var(--ms-surface-2) !important;
  color: var(--ms-muted) !important;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
body.staff-shell .ph-warn { border-radius: var(--ms-radius-sm) !important; }

@media (max-width: 1100px) {
  body.staff-shell .tk-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "side" "main"; }
  body.staff-shell .tk-side { position: static; }
}
@media (max-width: 900px) {
  body.staff-shell .tk-head { flex-direction: column; gap: 8px; }
  body.staff-shell .tk-head > .pill { margin-top: 0; }
}

/* queue cards (approvals / processing) */
body.staff-shell .approval-card-container { gap: 10px !important; }
body.staff-shell a.approval-card,
body.staff-shell .approval-card-container .approval-card { transition: border-color 0.15s ease, background 0.15s ease; }
body.staff-shell .approval-card-container .approval-card:hover { border-color: var(--ms-border-strong) !important; background: var(--ms-surface-2) !important; transform: none !important; }
body.staff-shell .approval-category-badge {
  height: 24px; padding: 0 10px !important; border-radius: 999px !important; display: inline-flex; align-items: center;
  background: var(--ms-surface-3) !important; color: var(--ms-text-2) !important; font-size: 12px !important; font-weight: 500 !important;
}

body.staff-shell input[type="checkbox"],
body.staff-shell input[type="radio"] { accent-color: var(--ms-accent); }
body.staff-shell .ms-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
body.staff-shell .ms-chips li {
  padding: 6px 12px; border-radius: 999px; background: var(--ms-surface); border: 1px solid var(--ms-border);
  font-size: 13px; color: var(--ms-text-2);
}
body.staff-shell .pill-completed::before,
body.staff-shell .pill-rejected::before { display: inline-block; }

/* ---------------------------------------------------------------- reports */
body.staff-shell .rp {
  --surface-1: var(--ms-surface);
  --text-primary: var(--ms-text);
  --text-secondary: var(--ms-text-2);
  --text-muted: var(--ms-muted);
  --grid: rgba(231, 235, 240, 0.08);
}
body.staff-shell .rp-card,
body.staff-shell .rp-stat { border: 1px solid var(--ms-border); }
body.staff-shell .rp-card { border-radius: var(--ms-radius) !important; padding: 18px 20px 14px !important; }
body.staff-shell .rp-stat { border-radius: var(--ms-radius) !important; padding: 14px 16px !important; }
body.staff-shell .rp-stat-value { letter-spacing: -0.02em; }
body.staff-shell .rp-filters select,
body.staff-shell .rp-filters input { background: var(--ms-bg) !important; border-color: var(--ms-border-strong) !important; }
body.staff-shell .rp-btn { background: var(--ms-accent) !important; border-color: var(--ms-accent) !important; color: var(--ms-accent-ink) !important; }
body.staff-shell .rp-table th { color: var(--ms-muted) !important; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; }
body.staff-shell .rp-table td { border-color: var(--ms-border) !important; }

/* ---------------------------------------------------------------- money management */
body.staff-shell .mm-balance-summary {
  padding: 20px 22px;
  background: var(--ms-surface);
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius);
  margin-bottom: 8px;
}
body.staff-shell .mm-stat-label { font-size: 12.5px; color: var(--ms-muted); font-weight: 500; }
body.staff-shell .mm-stat-value { font-size: 34px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 2px 0 4px; }
body.staff-shell .mm-adjust-form,
body.staff-shell .mm-alert-form {
  padding: 18px 20px !important;
  background: var(--ms-surface);
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius);
}
body.staff-shell .mm-alert-form input,
body.staff-shell .mm-alert-form textarea { background: var(--ms-bg) !important; border-color: var(--ms-border-strong) !important; }
body.staff-shell .mm-action-btn,
body.staff-shell .mm-apply-btn,
body.staff-shell .mm-autozero-btn {
  height: 36px; padding: 0 14px; border-radius: var(--ms-radius-sm) !important;
  border: 1px solid var(--ms-border-strong) !important; background: var(--ms-surface-2) !important;
  color: var(--ms-text) !important; font: 500 13.5px/1 var(--ms-font) !important; cursor: pointer;
}
body.staff-shell #mm-create-payment-btn,
body.staff-shell .mm-apply-btn { background: var(--ms-accent) !important; border-color: var(--ms-accent) !important; color: var(--ms-accent-ink) !important; font-weight: 600 !important; }
body.staff-shell .ledger-card {
  background: var(--ms-surface) !important; border: 1px solid var(--ms-border) !important;
  border-radius: var(--ms-radius) !important; box-shadow: none !important;
}
body.staff-shell .ledger-label { color: var(--ms-muted) !important; }

/* ---------------------------------------------------------------- check printing */
body.staff-shell .ck-card { background: var(--ms-surface) !important; border-color: var(--ms-border) !important; border-radius: var(--ms-radius) !important; }
body.staff-shell .ck-btn { border-radius: var(--ms-radius-sm) !important; background: var(--ms-surface-2) !important; border-color: var(--ms-border-strong) !important; }
body.staff-shell .ck-btn.primary { background: var(--ms-accent) !important; border-color: var(--ms-accent) !important; color: var(--ms-accent-ink) !important; }
body.staff-shell .ck-btn.danger { background: transparent !important; border-color: rgba(240, 97, 109, 0.5) !important; color: #ff8a93 !important; }
body.staff-shell .ck-badge.ready { background: var(--ms-accent-soft) !important; color: var(--ms-accent) !important; }
body.staff-shell .ck-empty.ov-empty { opacity: 1; display: flex; flex-direction: column; align-items: center; margin-top: 12px; }

/* ---------------------------------------------------------------- dogs */
body.staff-shell .dg-search { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
body.staff-shell .dg-search input[type="search"] { flex: 1 1 320px; width: auto !important; height: 38px; padding: 0 12px; margin: 0 !important; }
body.staff-shell .dg-search select { flex: 0 0 auto; width: auto !important; height: 38px; padding: 0 10px; margin: 0 !important; }
body.staff-shell .dg-search .btn { height: 38px; }
body.staff-shell .dg-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
body.staff-shell .dg-tab {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--ms-border); background: var(--ms-surface); color: var(--ms-text-2) !important;
  font-size: 13px; font-weight: 500; text-decoration: none !important;
}
body.staff-shell .dg-tab span { font-size: 12px; color: var(--ms-muted); font-variant-numeric: tabular-nums; }
body.staff-shell .dg-tab.is-active { background: var(--ms-accent-soft); border-color: rgba(60, 207, 133, 0.35); color: var(--ms-text) !important; }
body.staff-shell .dg-tab.is-active span { color: var(--ms-accent); }
body.staff-shell .dg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
body.staff-shell .dg-card {
  display: flex; gap: 14px; padding: 12px; background: var(--ms-surface); border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius); color: var(--ms-text) !important; text-decoration: none !important;
  transition: border-color 0.15s ease, background 0.15s ease;
}
body.staff-shell .dg-card:hover { border-color: var(--ms-border-strong); background: var(--ms-surface-2); }
body.staff-shell .dg-photo {
  width: 72px; height: 72px; flex: none; border-radius: 10px; overflow: hidden; background: var(--ms-surface-3);
  display: grid; place-items: center; color: var(--ms-muted);
}
body.staff-shell .dg-photo img { width: 100%; height: 100%; object-fit: cover; }
body.staff-shell .dg-body { min-width: 0; flex: 1; }
body.staff-shell .dg-top { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
body.staff-shell .dg-top strong { font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
body.staff-shell .dg-top .pill { height: 22px; font-size: 11.5px; padding: 0 8px; flex: none; }
body.staff-shell .dg-meta { font-size: 12.5px; color: var(--ms-text-2); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.staff-shell .dg-loc, body.staff-shell .dg-id { color: var(--ms-muted); }
body.staff-shell .dg-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; flex: 1 1 100%; box-sizing: border-box; }
body.staff-shell .dg-search .dg-filters select { flex: 1 1 200px; min-width: 0; max-width: 100%; }
body.staff-shell .dg-filters { min-width: 0; max-width: 100%; }
@media (max-width: 640px) { body.staff-shell .dg-search .dg-filters select { flex: 1 1 100%; width: 100% !important; } }
body.staff-shell .dg-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ms-text-2); margin: 0 4px; }
body.staff-shell .dg-check input { width: auto !important; margin: 0 !important; }
body.staff-shell .dg-clear { font-size: 13px; }
body.staff-shell .dg-litter-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
body.staff-shell .dg-litter-head h2 { margin: 0; font-size: 20px; }
body.staff-shell .dg-litter { border-style: dashed; }
body.staff-shell .dg-litter .dg-top strong { -webkit-line-clamp: 2; }
body.staff-shell .dg-litter-pill { background: var(--ms-accent-soft); color: var(--ms-accent); border: 1px solid rgba(60, 207, 133, 0.35); }
body.staff-shell .dg-litter-tag { color: var(--ms-accent); }
body.staff-shell .dg-mosaic { display: grid; place-items: stretch; gap: 2px; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
body.staff-shell .dg-mosaic.n1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
body.staff-shell .dg-mosaic.n2 { grid-template-rows: 1fr; }
body.staff-shell .dg-mosaic.n3 > :first-child { grid-row: span 2; }
body.staff-shell .dg-mosaic img, body.staff-shell .dg-mosaic span { width: 100%; height: 100%; min-height: 0; object-fit: cover; display: flex; align-items: center; justify-content: center; }
body.staff-shell .dg-mates { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
body.staff-shell .dg-mates li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
body.staff-shell .dg-mates .pill { height: 20px; font-size: 11px; padding: 0 7px; flex: none; }
body.staff-shell .dg-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 20px; color: var(--ms-muted); }
body.staff-shell .dg-head { display: flex; align-items: center; gap: 16px; }
body.staff-shell .dg-avatar { width: 72px; height: 72px; border-radius: 14px; object-fit: cover; border: 1px solid var(--ms-border); }
body.staff-shell .dg-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
body.staff-shell .dg-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--ms-border); }
body.staff-shell .dg-raw summary { cursor: pointer; color: var(--ms-text-2); font-weight: 500; }
body.staff-shell .dg-raw[open] summary { margin-bottom: 4px; }
body.staff-shell .dg-tickets { width: 100%; }

/* dog photos */
body.staff-shell .dg-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
body.staff-shell .dg-shot { margin: 0; border: 1px solid var(--ms-border); border-radius: 10px; overflow: hidden; background: var(--ms-surface-2); }
body.staff-shell .dg-shot.is-main { border-color: rgba(60, 207, 133, 0.5); }
body.staff-shell .dg-shot img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
body.staff-shell .dg-shot figcaption { padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--ms-muted); }
body.staff-shell .dg-shot-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
body.staff-shell .dg-shot-meta .pill { height: 20px; font-size: 11px; padding: 0 8px; }
body.staff-shell .dg-shot-actions { display: flex; gap: 12px; }
body.staff-shell .dg-shot-actions form { margin: 0; }
body.staff-shell .dg-link { background: none; border: 0; padding: 0; color: var(--ms-accent); font: inherit; font-size: 12.5px; cursor: pointer; }
body.staff-shell .dg-link.danger { color: #ff8a93; }
body.staff-shell .dg-link:hover { text-decoration: underline; }
body.staff-shell .dg-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--ms-border); }
body.staff-shell .dg-upload label { font-weight: 600; font-size: 13.5px; }
body.staff-shell .dg-upload input[type="file"] { flex: 1 1 260px; width: auto !important; margin: 0 !important; color: var(--ms-text-2); font-size: 13px; }
body.staff-shell .dg-upload .tk-small { flex-basis: 100%; margin: 0; }

/* ---------------------------------------------------------------- medical */
body.staff-shell .md-summary { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
body.staff-shell .md-sum { display: flex; align-items: baseline; gap: 8px; padding: 10px 14px; border-radius: var(--ms-radius); background: var(--ms-surface); border: 1px solid var(--ms-border); color: var(--ms-muted); font-size: 13px; }
body.staff-shell .md-sum span { font-size: 22px; font-weight: 650; color: var(--ms-text); font-variant-numeric: tabular-nums; }
body.staff-shell .md-sum.is-bad { border-color: rgba(240, 97, 109, 0.4); }
body.staff-shell .md-sum.is-bad span { color: #ff8a93; }
body.staff-shell .md-sum.is-warn { border-color: rgba(242, 184, 75, 0.35); }
body.staff-shell .md-sum.is-warn span { color: #f5c76b; }
body.staff-shell .md-section { margin-bottom: 14px !important; }
body.staff-shell .md-count { margin-left: 6px; color: var(--ms-text-2); font-weight: 600; }
body.staff-shell .md-list { display: flex; flex-direction: column; }
body.staff-shell .md-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--ms-border); flex-wrap: wrap; }
body.staff-shell .md-row:last-child { border-bottom: 0; }
body.staff-shell .md-dog { flex: 0 0 210px; min-width: 0; font-weight: 600; color: var(--ms-text) !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.staff-shell .md-what { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; }
body.staff-shell .md-what span { font-size: 12.5px; color: var(--ms-muted); }
body.staff-shell .md-due { flex: 0 0 auto; font-size: 13px; color: var(--ms-text-2); }
body.staff-shell .md-done { display: flex; gap: 6px; align-items: center; margin: 0; }
body.staff-shell .md-done input[type="date"] { height: 34px; padding: 0 8px; width: auto !important; margin: 0 !important; }
body.staff-shell .md-done .btn { height: 34px; }
body.staff-shell .md-files { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 4px; font-size: 12.5px; }
body.staff-shell .md-files a { color: var(--ms-accent) !important; }
body.staff-shell .md-more summary { cursor: pointer; color: var(--ms-muted); font-size: 12px; }
body.staff-shell .md-more[open] summary { margin-bottom: 6px; }
body.staff-shell .md-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0; }
body.staff-shell .md-inline input[type="file"] { width: auto !important; margin: 0 !important; font-size: 12.5px; }
body.staff-shell .md-add { margin-top: 14px; }
body.staff-shell .md-add > summary { list-style: none; display: inline-flex; cursor: pointer; }
body.staff-shell .md-add > summary::-webkit-details-marker { display: none; }
body.staff-shell .md-add[open] > summary { margin-bottom: 14px; }
body.staff-shell .md-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 14px; padding: 16px; border: 1px solid var(--ms-border); border-radius: var(--ms-radius); background: var(--ms-surface-2); }
body.staff-shell .md-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ms-muted); }
body.staff-shell .md-form input, body.staff-shell .md-form select, body.staff-shell .md-form textarea { width: 100% !important; margin: 0 !important; min-height: 36px; padding: 6px 10px; font-size: 14px; }
body.staff-shell .md-form .md-wide { grid-column: span 2; }
body.staff-shell .md-form .md-full { grid-column: 1 / -1; }
body.staff-shell .md-help { font-size: 12.5px; color: var(--ms-muted); }
@media (max-width: 700px) {
  body.staff-shell .md-dog { flex-basis: 100%; }
  body.staff-shell .md-form .md-wide { grid-column: 1 / -1; }
}
body.staff-shell .md-stale > summary { cursor: pointer; list-style: none; display: flex; flex-direction: column; gap: 4px; }
body.staff-shell .md-stale > summary::-webkit-details-marker { display: none; }
body.staff-shell .md-stale[open] > summary { margin-bottom: 10px; }
body.staff-shell a.md-sum { color: var(--ms-muted) !important; text-decoration: none !important; }

/* ---------------------------------------------------------------- applications */
body.staff-shell .ap-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
body.staff-shell .ap-col { background: var(--ms-surface); border: 1px solid var(--ms-border); border-radius: var(--ms-radius); padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 140px; }
body.staff-shell .ap-col > header { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 13.5px; padding: 2px 2px 6px; }
body.staff-shell .ap-card { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px; border-radius: 10px; background: var(--ms-surface-2); border: 1px solid var(--ms-border); color: var(--ms-text) !important; text-decoration: none !important; }
body.staff-shell .ap-card:hover { border-color: var(--ms-border-strong); }
body.staff-shell .ap-card span { font-size: 12.5px; color: var(--ms-muted); }
body.staff-shell .ap-card-foot { font-size: 11.5px !important; }
body.staff-shell .ap-checks { display: inline-flex; gap: 4px; flex-wrap: wrap; }
body.staff-shell .ap-chk { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11px !important; font-weight: 600; border: 1px solid var(--ms-border-strong); color: var(--ms-muted) !important; }
body.staff-shell .ap-chk.is-sent { color: #f5c76b !important; border-color: rgba(242, 184, 75, 0.4); }
body.staff-shell .ap-chk.is-done { color: var(--ms-accent) !important; border-color: rgba(60, 207, 133, 0.45); background: var(--ms-accent-soft); }
body.staff-shell .ap-chk.is-not_needed { text-decoration: line-through; opacity: 0.6; }
body.staff-shell .ap-steps { display: flex; flex-direction: column; gap: 8px; }
body.staff-shell .ap-step-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; }
body.staff-shell .ap-step-row .ap-chk { height: 26px; font-size: 12.5px !important; }
body.staff-shell .ap-step-row select, body.staff-shell .ap-assign select { width: auto !important; min-height: 32px; margin: 0 !important; padding: 0 8px; }
body.staff-shell .ap-assign { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; font-size: 12px; color: var(--ms-muted); }
body.staff-shell .ap-assign select { width: 100% !important; }
body.staff-shell .ap-decide form { display: flex; flex-direction: column; gap: 6px; }
body.staff-shell .ap-decide select, body.staff-shell .ap-decide textarea { width: 100%; }
body.staff-shell .ap-preview { white-space: pre-wrap; font: 12px/1.45 var(--ms-font); color: var(--ms-text-2); background: var(--ms-bg); border: 1px solid var(--ms-border); border-radius: 8px; padding: 8px 10px; margin: 0; max-height: 160px; overflow: auto; }
body.staff-shell .ap-answers { margin: 0; display: flex; flex-direction: column; gap: 12px; }
body.staff-shell .ap-answers dt { font-size: 12.5px; color: var(--ms-muted); }
body.staff-shell .ap-answers dd { margin: 2px 0 0; overflow-wrap: anywhere; }
body.staff-shell .table-wrap-x { overflow-x: auto; }
@media (max-width: 1000px) { body.staff-shell .ap-board { grid-template-columns: minmax(0, 1fr); } }

/* Comprehensive System Preview section in the sidebar */
body.staff-shell .ms-nav-label-preview { color: var(--ms-accent); }
body.staff-shell .ms-nav-item.is-planned { color: var(--ms-muted); }
body.staff-shell .ms-nav-item.is-planned .ms-ico { opacity: 0.6; }
body.staff-shell .ms-tag { font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--ms-border-strong); color: var(--ms-muted); }
body.staff-shell .pv-progress { display: flex; align-items: center; gap: 16px; margin-bottom: 16px !important; }
body.staff-shell .pv-bar { flex: 1; height: 8px; border-radius: 99px; background: var(--ms-surface-3); overflow: hidden; }
body.staff-shell .pv-bar i { display: block; height: 100%; background: var(--ms-accent); border-radius: 99px; }
body.staff-shell .pv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
body.staff-shell .pv-card { display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 80px; }
body.staff-shell .pv-card:target { border-color: var(--ms-accent) !important; }
body.staff-shell .pv-card.is-planned { opacity: 0.85; }
body.staff-shell .pv-head { display: flex; align-items: center; gap: 10px; }
body.staff-shell .pv-head h2 { flex: 1; margin: 0; font-size: 16px; }
body.staff-shell .pv-replaces { margin: 0; font-size: 12.5px; color: var(--ms-muted); }
body.staff-shell .pv-facts { margin: 0; padding-left: 18px; color: var(--ms-text-2); font-size: 13.5px; }
body.staff-shell .pv-next { margin: 0; font-size: 13px; color: var(--ms-text-2); }
body.staff-shell .pv-card .btn { align-self: flex-start; margin-top: auto; }

/* ---------------------------------------------------------------- contracts (staff view of the document) */
body.staff-shell .ct-body { line-height: 1.55; }
body.staff-shell .ct-sec { margin: 0 0 16px; }
body.staff-shell .ct-sec h4 { margin: 0 0 8px; font-size: 14px; color: var(--ms-accent); }
body.staff-shell .ct-sec p { margin: 0 0 8px; color: var(--ms-text-2); font-size: 13.5px; }
body.staff-shell .ct-intro { color: var(--ms-text-2); font-size: 13.5px; }
body.staff-shell .ct-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 16px; margin: 0 0 10px; padding: 12px; border-radius: 10px; background: var(--ms-surface-2); }
body.staff-shell .ct-fields dt { font-size: 12px; color: var(--ms-muted); }
body.staff-shell .ct-fields dd { margin: 2px 0 0; font-weight: 600; }
body.staff-shell .ct-missing { color: #f5c76b; font-weight: 500; }
body.staff-shell .ct-ack { padding: 10px 12px; margin: 0 0 8px; border-radius: 10px; border: 1px solid var(--ms-border); }
body.staff-shell .ct-ack p { font-size: 13px; }
body.staff-shell .ct-check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: 13px; }
body.staff-shell .ct-box { width: 15px; height: 15px; border-radius: 4px; border: 2px solid var(--ms-border-strong); flex: none; margin-top: 2px; }
body.staff-shell .ct-box.is-on { background: var(--ms-accent); border-color: var(--ms-accent); }
body.staff-shell .ct-multi { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ms-muted); font-size: 12.5px; }
body.staff-shell .ct-multi legend { width: 100%; margin-bottom: 4px; }
body.staff-shell .ct-multi .tk-check input { width: auto !important; min-height: 0; }
