/* ========================================================================
 * ops-admin shell v2 — WI-542
 * Collapsible navy icon-rail (64px ↔ 240px), brand-aligned top utility bar,
 * light-default + [data-theme="dark"] support. Scoped under body.layout-v2.
 * Brand tokens: see brand_colors.md
 *   --brand-blue   #0078dd  primary action
 *   --brand-aqua   #00b2cf  active indicator / secondary
 *   --brand-coral  #ff7f79  count badges only
 *   --brand-white  #f2f2ef  page bg (NEVER pure white)
 *   --brand-soft-grey #b3b1b0
 *   --brand-navy   #012d53  sidebar bg, headlines, body text
 * ======================================================================== */

:root {
  --brand-blue: #0078dd;
  --brand-aqua: #00b2cf;
  --brand-coral: #ff7f79;
  --brand-white: #f2f2ef;
  --brand-soft-grey: #b3b1b0;
  --brand-navy: #012d53;

  /* Light mode surfaces (default) */
  --page-bg: #f2f2ef;
  --card-bg: #ffffff;
  --sidebar-bg: #012d53;
  --sidebar-bg-gradient: linear-gradient(180deg, #012d53 0%, #013466 60%, #02426f 100%);
  --top-bar-bg: #ffffff;
  --text-primary: #012d53;
  --text-secondary: rgba(1, 45, 83, 0.65);
  --text-muted: rgba(1, 45, 83, 0.45);
  --border: rgba(179, 177, 176, 0.4);
  --border-hairline: rgba(179, 177, 176, 0.25);
  --hover-surface: rgba(1, 45, 83, 0.04);
  --search-pill-bg: #f2f2ef;
}

:root[data-theme="dark"] {
  --page-bg: #0a1628;
  --card-bg: #012d53;
  --sidebar-bg: #012d53;
  --sidebar-bg-gradient: linear-gradient(180deg, #012d53 0%, #013466 60%, #014a7f 100%);
  --top-bar-bg: #0a1628;
  --text-primary: #f2f2ef;
  --text-secondary: rgba(242, 242, 239, 0.6);
  --text-muted: rgba(242, 242, 239, 0.4);
  --border: rgba(0, 178, 207, 0.12);
  --border-hairline: rgba(0, 178, 207, 0.1);
  --hover-surface: rgba(0, 178, 207, 0.08);
  --search-pill-bg: rgba(242, 242, 239, 0.08);
}

/* ===== V2 SCOPED VARIABLES (legacy compat aliases) ===== */
body.layout-v2 {
  --sidebar-width-expanded: 240px;
  --sidebar-width-collapsed: 64px;
  --sidebar-width: var(--sidebar-width-expanded);
  /* Legacy aliases retained so any existing module CSS keeps working. */
  --v2-border: var(--border);
  --v2-text-primary: var(--text-primary);
  --v2-text-secondary: var(--text-secondary);
  --v2-text-muted: var(--text-muted);
  --v2-active-bg: rgba(0, 178, 207, 0.12);
  --v2-hover-bg: rgba(255, 255, 255, 0.06);
  --v2-section-label: var(--brand-aqua);
  --search-bg: var(--search-pill-bg);
  --color-bg-page: var(--page-bg);
  background: var(--page-bg) !important;
  color: var(--text-primary);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-feature-settings: "ss01", "ss02";
}

body.layout-v2.sidebar-collapsed {
  --sidebar-width: var(--sidebar-width-collapsed);
}

/* Numeric tabular figures across the shell */
body.layout-v2 .tabular,
body.layout-v2 .num,
body.layout-v2 .number,
body.layout-v2 .stat,
body.layout-v2 .total,
body.layout-v2 [class*="-amount"],
body.layout-v2 [class*="-count"] {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ===== HIDE LEGACY CHROME ===== */
body.layout-v2 .hero-banner,
body.layout-v2 .welcome-bar,
body.layout-v2 .app-header {
  display: none !important;
  height: 0 !important;
}

/* ========================================================================
 * SIDEBAR
 * ======================================================================== */

body.layout-v2 .sidebar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  bottom: 0 !important;
  height: 100vh !important;
  height: 100dvh !important;
  width: var(--sidebar-width) !important;
  background: var(--sidebar-bg-gradient) !important;
  border-radius: 0 !important;
  border-right: 1px solid rgba(0, 178, 207, 0.08) !important;
  box-shadow: none !important;
  margin-top: 0 !important;
  padding: 0 !important;
  z-index: 900 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  transform: none !important;
  transition: width 200ms ease;
}

/* Inner scroll container so head/foot stay pinned */
body.layout-v2 .sidebar .sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Sidebar head (B mark + wordmark + collapse chevron) */
body.layout-v2 .sidebar-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 14px 8px;
  flex-shrink: 0;
}

body.layout-v2 .sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex: 1;
  min-width: 0;
}

/* WI-851 — round B icon stands on its own. The wrapper element is kept for
 * flex/spacing purposes, but the navy tile styling (background, border-radius,
 * fixed size) is removed so the SVG's own circular shape is the only visible
 * surface. */
body.layout-v2 .sidebar-brand-mark {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* WI-846 — official brand icon mark.
 * WI-851 — sized directly on the <img> now that the surrounding tile is gone. */
body.layout-v2 .sidebar-brand-mark-img {
  width: 40px;
  height: 40px;
  display: block;
}

/* WI-846 — wordmark is now an <img> rather than a text node. The collapsed
 * state hides it (selector at the bottom of this file) so it lines up with
 * the icon-rail.
 * WI-848 — bumped from 18px to 28px so the wordmark is legible alongside
 * the icon.
 * WI-851 — owner feedback: wordmark still too small. Sized by width (132px)
 * with height: auto so the SVG's natural aspect ratio is preserved. */
body.layout-v2 .sidebar-brand-word {
  width: 132px;
  height: auto;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.layout-v2 .sidebar-collapse-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

body.layout-v2 .sidebar-collapse-btn:hover {
  background: rgba(0, 178, 207, 0.18);
  color: #ffffff;
}

body.layout-v2 .sidebar-collapse-btn .material-icons {
  font-size: 18px;
}

body.layout-v2 .sidebar-role-caption {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--brand-aqua);
  padding: 0 16px 12px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Sidebar nav ===== */
body.layout-v2 .sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 0 16px;
}

body.layout-v2 .sidebar-section {
  margin-bottom: 2px;
}

body.layout-v2 .sidebar-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-aqua);
  padding: 16px 16px 6px;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.layout-v2 .sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 8px 16px;
  margin: 1px 8px;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
  overflow: hidden;
}

body.layout-v2 .sidebar-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
}

body.layout-v2 .sidebar-link.active {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-weight: 600;
}

/* 3px aqua left edge indicator on active item */
body.layout-v2 .sidebar-link.active::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand-aqua);
}

body.layout-v2 .sidebar-link.disabled {
  color: rgba(255, 255, 255, 0.35);
  cursor: default;
  pointer-events: none;
}

body.layout-v2 .sidebar-link.coming-soon {
  color: rgba(255, 255, 255, 0.55);
}
body.layout-v2 .sidebar-link.coming-soon:hover {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.8);
}
body.layout-v2 .sidebar-link.coming-soon .sidebar-link-icon {
  opacity: 0.6;
}

body.layout-v2 .sidebar-link-icon {
  flex-shrink: 0;
  font-size: 20px;
  opacity: 0.85;
}

body.layout-v2 .sidebar-link.active .sidebar-link-icon {
  opacity: 1;
  color: var(--brand-aqua);
}

body.layout-v2 .sidebar-link-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* SOON pill (expanded) and dot (collapsed) */
body.layout-v2 .sidebar-soon-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--brand-aqua);
  background: rgba(0, 178, 207, 0.12);
  border-radius: 2px;
}

body.layout-v2 .sidebar-soon-dot {
  display: none;
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-aqua);
}

/* ===== Sidebar foot (theme + profile) ===== */
body.layout-v2 .sidebar-foot {
  flex-shrink: 0;
  border-top: 1px solid rgba(0, 178, 207, 0.12);
  padding: 8px 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

body.layout-v2 .sidebar-theme-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 12px;
  width: 100%;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}
body.layout-v2 .sidebar-theme-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
}
body.layout-v2 .sidebar-theme-btn .material-icons {
  font-size: 20px;
  flex-shrink: 0;
}

body.layout-v2 .sidebar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px 6px 8px;
  border-radius: 8px;
}

body.layout-v2 .sidebar-profile-avatar {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-aqua);
  color: var(--brand-navy);
  font-family: "Manrope", "Inter", sans-serif;
  font-weight: 700;
  font-size: 12px;
}

body.layout-v2 .sidebar-profile-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  overflow: hidden;
}

body.layout-v2 .sidebar-profile-name {
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.layout-v2 .sidebar-profile-email {
  color: rgba(0, 178, 207, 0.7);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.layout-v2 .sidebar-profile-kebab {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
body.layout-v2 .sidebar-profile-kebab:hover {
  background: rgba(0, 178, 207, 0.18);
  color: #ffffff;
}
body.layout-v2 .sidebar-profile-kebab .material-icons {
  font-size: 18px;
}

/* ===== COLLAPSED STATE ===== */
body.layout-v2.sidebar-collapsed .sidebar-brand-word,
body.layout-v2.sidebar-collapsed .sidebar-collapse-btn,
body.layout-v2.sidebar-collapsed .sidebar-role-caption,
body.layout-v2.sidebar-collapsed .sidebar-section-label,
body.layout-v2.sidebar-collapsed .sidebar-link-label,
body.layout-v2.sidebar-collapsed .sidebar-soon-pill,
body.layout-v2.sidebar-collapsed .sidebar-theme-label,
body.layout-v2.sidebar-collapsed .sidebar-profile-meta,
body.layout-v2.sidebar-collapsed .sidebar-profile-kebab {
  display: none !important;
}

body.layout-v2.sidebar-collapsed .sidebar-head {
  justify-content: center;
  padding: 16px 8px 8px;
}
body.layout-v2.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  flex: 0 0 auto;
}
body.layout-v2.sidebar-collapsed .sidebar-link {
  margin: 1px 8px;
  padding: 10px 0;
  justify-content: center;
}
body.layout-v2.sidebar-collapsed .sidebar-link.active::before {
  left: -8px;
}
body.layout-v2.sidebar-collapsed .sidebar-soon-dot {
  display: block;
}
body.layout-v2.sidebar-collapsed .sidebar-section {
  padding-top: 6px;
  border-top: 1px solid rgba(0, 178, 207, 0.08);
  margin-top: 6px;
}
body.layout-v2.sidebar-collapsed .sidebar-section:first-of-type {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}
body.layout-v2.sidebar-collapsed .sidebar-foot {
  padding: 6px 8px 10px;
}
body.layout-v2.sidebar-collapsed .sidebar-theme-btn {
  justify-content: center;
  padding: 8px 0;
}
body.layout-v2.sidebar-collapsed .sidebar-profile {
  justify-content: center;
  padding: 6px 0;
}

/* ===== SIDEBAR SCROLLBAR ===== */
body.layout-v2 .sidebar-scroll::-webkit-scrollbar {
  width: 4px;
}
body.layout-v2 .sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}
body.layout-v2 .sidebar-scroll::-webkit-scrollbar-track {
  background: transparent;
}

/* ========================================================================
 * TOP UTILITY BAR (.content-header)
 * ======================================================================== */

body.layout-v2 .content-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 24px;
  height: 56px;
  background: var(--top-bar-bg);
  border-bottom: 1px solid var(--border-hairline);
}

body.layout-v2 .content-header-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}
body.layout-v2 .content-header-menu-btn:hover {
  background: var(--hover-surface);
  color: var(--text-primary);
}
body.layout-v2 .content-header-menu-btn .material-icons {
  font-size: 22px;
}

/* ===== Search pill ===== */
body.layout-v2 .search-container {
  position: relative;
  flex: 1;
  max-width: 640px;
  margin: 0 auto;
}

body.layout-v2 .search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

body.layout-v2 .search-icon {
  position: absolute;
  left: 12px;
  font-size: 18px;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 1;
}

body.layout-v2 .search-input {
  width: 100%;
  height: 36px;
  padding: 0 64px 0 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--search-pill-bg);
  font-family: "Inter", sans-serif;
  font-size: 13px;
  color: var(--text-primary);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

body.layout-v2 .search-input::placeholder {
  color: var(--text-muted);
}

body.layout-v2 .search-input:focus {
  border-color: var(--brand-aqua);
  background: var(--card-bg);
  box-shadow: 0 0 0 3px rgba(0, 178, 207, 0.12);
}

body.layout-v2 .search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  font-family: "Inter", sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  pointer-events: none;
  letter-spacing: 0.02em;
}

/* Search dropdown carries over the existing structure */
body.layout-v2 .search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-width: 720px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
  z-index: 1100;
  overflow: hidden;
  max-height: 480px;
  overflow-y: auto;
}
body.layout-v2 .search-dropdown[hidden] { display: none; }
body.layout-v2 .search-category { padding: 8px 0; border-bottom: 1px solid var(--border-hairline); }
body.layout-v2 .search-category:last-child { border-bottom: none; }
body.layout-v2 .search-category-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 4px 16px 6px;
}
body.layout-v2 .search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.1s;
}
body.layout-v2 .search-result:hover,
body.layout-v2 .search-result.search-result-active { background: var(--hover-surface); }
body.layout-v2 .search-result-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--search-pill-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
body.layout-v2 .search-result-icon .material-icons { font-size: 16px; color: var(--text-secondary); }
body.layout-v2 .search-result-text { flex: 1; min-width: 0; }
body.layout-v2 .search-result-primary {
  font-size: 13px; font-weight: 500; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body.layout-v2 .search-result-secondary {
  font-size: 12px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body.layout-v2 .search-view-all {
  display: block;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-blue);
  text-decoration: none;
}
body.layout-v2 .search-view-all:hover { text-decoration: underline; }
body.layout-v2 .search-view-all-bottom {
  border-top: 1px solid var(--border-hairline);
  text-align: center;
  padding: 10px 16px;
}
body.layout-v2 .search-empty,
body.layout-v2 .search-loading {
  padding: 20px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
body.layout-v2 .search-category-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px;
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  background: var(--search-pill-bg);
  border-radius: 9px;
}
body.layout-v2 .search-cat-icon {
  font-size: 14px; margin-right: 6px;
  color: var(--text-muted);
  vertical-align: middle;
}
body.layout-v2 .search-chips { padding: 12px 16px; }
body.layout-v2 .search-chips-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
body.layout-v2 .search-chips-row { display: flex; flex-wrap: wrap; gap: 6px; }
body.layout-v2 .search-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  font-family: "Inter", sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--brand-blue);
  background: rgba(0, 120, 221, 0.08);
  border: 1px solid rgba(0, 120, 221, 0.22);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.15s;
}
body.layout-v2 .search-chip:hover {
  background: rgba(0, 120, 221, 0.16);
  border-color: rgba(0, 120, 221, 0.4);
}

/* ===== Top-bar action cluster ===== */
body.layout-v2 .content-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}

body.layout-v2 .content-header-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  background: var(--top-bar-bg);
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
body.layout-v2 .content-header-btn:hover {
  background: var(--hover-surface);
  color: var(--text-primary);
  border-color: var(--border);
}
body.layout-v2 .content-header-btn .material-icons {
  font-size: 20px;
}

/* Quick-add — solid Breezes Blue circle */
body.layout-v2 .quick-add-btn {
  background: var(--brand-blue);
  color: #ffffff;
  border-color: var(--brand-blue);
  border-radius: 50%;
}
body.layout-v2 .quick-add-btn:hover {
  background: #006ac4;
  border-color: #006ac4;
  color: #ffffff;
}
body.layout-v2 .quick-add-btn .material-icons {
  font-size: 22px;
}

/* Notifications bell — count overlay (coral) */
body.layout-v2 .notification-center-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
body.layout-v2 .notification-bell-btn {
  /* Use the same chip styling as other top-bar buttons */
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  background: var(--top-bar-bg);
  color: var(--text-secondary);
}
body.layout-v2 .notification-bell-btn:hover {
  background: var(--hover-surface);
  color: var(--text-primary);
}
body.layout-v2 .notification-bell-btn .material-icons {
  font-size: 20px;
}
body.layout-v2 .notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 9999px;
  background: var(--brand-coral);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* Quick-add menu */
body.layout-v2 .quick-add-wrap { position: relative; }
body.layout-v2 .quick-add-menu,
body.layout-v2 .profile-mini-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
  padding: 6px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
body.layout-v2 .quick-add-menu[hidden],
body.layout-v2 .profile-mini-menu[hidden] { display: none; }

body.layout-v2 .quick-add-item,
body.layout-v2 .profile-mini-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-primary);
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  text-align: left;
  width: 100%;
}
body.layout-v2 .quick-add-item:hover,
body.layout-v2 .profile-mini-item:hover {
  background: var(--hover-surface);
}
body.layout-v2 .quick-add-item .material-icons,
body.layout-v2 .profile-mini-item .material-icons {
  font-size: 18px;
  color: var(--text-secondary);
}

/* Profile mini button */
body.layout-v2 .content-header-user { position: relative; }
body.layout-v2 .profile-mini-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  height: 36px;
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  background: var(--top-bar-bg);
  color: var(--text-primary);
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
body.layout-v2 .profile-mini-btn:hover {
  background: var(--hover-surface);
  border-color: var(--border);
}
body.layout-v2 .profile-mini-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand-aqua);
  color: var(--brand-navy);
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  font-size: 11px;
}
body.layout-v2 .profile-mini-name {
  white-space: nowrap;
}
body.layout-v2 .profile-mini-caret {
  font-size: 18px;
  color: var(--text-muted);
}

/* Hide the legacy "Sign Out" pill button if any consumer still renders it */
body.layout-v2 .content-header > .content-header-signout { display: none !important; }

/* ========================================================================
 * APP SHELL / MAIN CONTENT GRID
 * ======================================================================== */

body.layout-v2 .app-shell {
  display: block !important;
  margin-left: var(--sidebar-width);
  padding: 0 !important;
  grid-template-columns: unset !important;
  gap: unset !important;
  max-width: unset !important;
  transition: margin-left 200ms ease;
}

body.layout-v2.layout-centered .app-shell,
body.layout-v2.layout-wide .app-shell {
  display: block !important;
  grid-template-columns: unset !important;
  margin-left: var(--sidebar-width);
  padding: 0 !important;
}

body.layout-v2 .main-content {
  width: 100% !important;
  grid-column: unset !important;
}

body.layout-v2 .main-content .container {
  padding: 8px 24px 24px;
}
body.layout-v2.layout-wide .main-content .container {
  padding: 8px 24px 24px;
}

/* Hide old mobile nav toggle — replaced by content-header-menu-btn */
body.layout-v2 #mobile-nav-toggle { display: none !important; }

/* ========================================================================
 * MOBILE (≤980px)
 * ======================================================================== */
@media (max-width: 980px) {
  body.layout-v2 .sidebar {
    width: 280px !important;
    transform: translateX(-100%) !important;
    transition: transform 0.25s ease !important;
    z-index: 2000 !important;
  }
  body.layout-v2.nav-open .sidebar { transform: translateX(0) !important; }

  /* Force expanded chrome inside the slide-in drawer regardless of
   * sidebar-collapsed (which only controls desktop width). */
  body.layout-v2.sidebar-collapsed .sidebar { width: 280px !important; }
  body.layout-v2.sidebar-collapsed .sidebar-brand-word,
  body.layout-v2.sidebar-collapsed .sidebar-collapse-btn,
  body.layout-v2.sidebar-collapsed .sidebar-role-caption,
  body.layout-v2.sidebar-collapsed .sidebar-section-label,
  body.layout-v2.sidebar-collapsed .sidebar-link-label,
  body.layout-v2.sidebar-collapsed .sidebar-soon-pill,
  body.layout-v2.sidebar-collapsed .sidebar-theme-label,
  body.layout-v2.sidebar-collapsed .sidebar-profile-meta,
  body.layout-v2.sidebar-collapsed .sidebar-profile-kebab {
    display: revert !important;
  }
  body.layout-v2.sidebar-collapsed .sidebar-soon-dot { display: none; }

  body.layout-v2 .app-shell,
  body.layout-v2.layout-centered .app-shell,
  body.layout-v2.layout-wide .app-shell {
    margin-left: 0 !important;
  }

  body.layout-v2 .content-header { padding: 10px 16px; gap: 10px; }
  body.layout-v2 .main-content .container { padding: 8px 16px 16px; }
  body.layout-v2 .profile-mini-name { display: none; }
  body.layout-v2 .help-btn { display: none; }
  body.layout-v2 .search-kbd { display: none; }

  body.layout-v2 .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(1, 45, 83, 0.5);
    z-index: 1500;
  }
  body.layout-v2:not(.nav-open) .nav-overlay { display: none; }
}

/* ========================================================================
 * NOTIFICATION PANEL (WI-084) — kept compatible with new tokens
 * ======================================================================== */
body.layout-v2 .notification-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(1, 45, 83, 0.45);
  z-index: 1100;
}
body.layout-v2 .notification-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100vw);
  height: 100vh;
  height: 100dvh;
  background: var(--card-bg);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
  z-index: 1110;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.2s ease-out;
}
body.layout-v2 .notification-panel.open { transform: translateX(0); }
body.layout-v2 .notification-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
body.layout-v2 .notification-panel-title {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
body.layout-v2 .notification-panel-close {
  border: none;
  background: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-secondary);
}
body.layout-v2 .notification-panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
body.layout-v2 .notification-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  cursor: pointer;
}
body.layout-v2 .notification-audit-link {
  font-weight: 600;
  color: var(--brand-blue);
  text-decoration: none;
}
body.layout-v2 .notification-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px 24px;
}
body.layout-v2 .nc-category {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
}
body.layout-v2 .nc-category-header {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: none;
  background: var(--search-pill-bg);
  cursor: pointer;
  text-align: left;
  color: var(--text-primary);
}
body.layout-v2 .nc-cat-label { font-weight: 700; flex: 1; }
body.layout-v2 .nc-cat-meta { font-size: 12px; color: var(--text-secondary); }
body.layout-v2 .nc-expand { font-size: 20px !important; color: var(--text-muted); }
body.layout-v2 .nc-category-body { padding: 8px 12px 12px; background: var(--card-bg); }
body.layout-v2 .nc-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-hairline);
}
body.layout-v2 .nc-thread:last-child { border-bottom: none; }
body.layout-v2 .nc-summary {
  margin: 0;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.4;
}
body.layout-v2 .nc-meta { margin: 0; font-size: 12px; color: var(--text-secondary); }
body.layout-v2 .nc-status {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--search-pill-bg);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}
body.layout-v2 .nc-thread-actions { display: flex; flex-wrap: wrap; gap: 8px; }
body.layout-v2 .nc-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-primary);
  text-decoration: none;
}
body.layout-v2 .nc-btn:hover { background: var(--hover-surface); }

/* ========================================================================
 * TYPOGRAPHY OVERRIDES — Manrope for headlines
 * ======================================================================== */
body.layout-v2 h1,
body.layout-v2 h2,
body.layout-v2 h3,
body.layout-v2 h4,
body.layout-v2 .page-heading,
body.layout-v2 .page-title {
  font-family: "Manrope", "Inter", sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ========================================================================
 * WI-711: Restore [hidden] semantics on .modal elements.
 * booking-links.css ships `.modal { display: flex; ... }` (used there as
 * the inner card style) and is injected globally by layout.js on every
 * ops-admin page. On pages where `.modal` is the outer overlay with the
 * `hidden` attribute (e.g. /users/), that author-level `display: flex`
 * overrides the UA `[hidden] { display: none }` rule, leaving modals
 * stuck visible on load. This rule restores hidden semantics globally.
 * ======================================================================== */
.modal[hidden] {
  display: none !important;
}
