/* ============================================================================
   DOCHUB SYSTEM - MAIN STYLESHEET
   ============================================================================
   All visual styling is contained here for easy modification.
   No business logic should depend on these styles.
   
   Organization:
   1. CSS Variables (Theme)
   2. Base Styles
   3. Layout Components
   4. Navigation
   5. Forms
   6. Tables
   7. Cards & Panels
   8. Utilities
   ============================================================================ */

/* ============================================================================
   1. CSS VARIABLES (THEME)
   Modify these to change the color scheme and visual appearance
   ============================================================================ */
:root {
  /* Primary Colors */
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #3b82f6;
  --color-primary-faint: #dbeafe;

  /* Secondary Colors */
  --color-secondary: #64748b;
  --color-secondary-dark: #475569;
  --color-secondary-light: #94a3b8;
  --color-secondary-faint: #f1f5f9;

  /* Success, Warning, Error */
  --color-success: #10b981;
  --color-success-bg: #d1fae5;
  --color-warning: #f59e0b;
  --color-warning-bg: #fef3c7;
  --color-error: #ef4444;
  --color-error-bg: #fee2e2;
  --color-info: #3b82f6;
  --color-info-bg: #dbeafe;

  /* Neutral Colors */
  --color-white: #ffffff;
  --color-black: #0f172a;
  --color-gray-50: #f8fafc;
  --color-gray-100: #f1f5f9;
  --color-gray-200: #e2e8f0;
  --color-gray-300: #cbd5e1;
  --color-gray-400: #94a3b8;
  --color-gray-500: #64748b;
  --color-gray-600: #475569;
  --color-gray-700: #334155;
  --color-gray-800: #1e293b;
  --color-gray-900: #0f172a;

  /* Typography */
  --font-family-base: "Manrope", "Segoe UI Variable", "Avenir Next", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-family-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;

  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-seMBold: 600;
  --font-weight-bold: 700;

  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;

  /* Spacing */
  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 200ms ease-in-out;
  --transition-slow: 300ms ease-in-out;

  /* Z-index Scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;

  /* --------------------------------------------------------------------------
     Phase 1 tokens (sourced from docs/DocHub_Mockup.html :root block).
     Additive only — existing tokens above are unchanged. Consumed by the
     chip / tile / matrix components introduced in Phase 2 and by dark theme.
     -------------------------------------------------------------------------- */

  /* Status text-on-bg foregrounds (paired with existing *-bg tokens) */
  --color-success-text: #065f46;
  --color-warning-text: #92400e;
  --color-error-text: #991b1b;
  --color-info-text: #1e40af;

  /* Semantic surface + text aliases — re-mapped by the dark theme below */
  --surface-body: var(--color-gray-50);
  --surface-raised: var(--color-white);
  --surface-sunken: var(--color-gray-100);
  --surface-border: var(--color-gray-200);
  --text-primary: var(--color-gray-900);
  --text-secondary: var(--color-gray-700);
  --text-tertiary: var(--color-gray-500);
  --text-muted: var(--color-gray-400);

  /* Hover wash + keyboard focus ring */
  --overlay-hover: rgba(15, 23, 42, 0.04);
  --focus-ring: 0 0 0 2px var(--surface-raised), 0 0 0 4px var(--color-primary);

  /* IP grant accent colors (portfolio tiles, matrix row headers) */
  --ip-cho: #7c3aed;
  --ip-cmhn: #0891b2;
  --ip-kehoc: #10b981;
  --ip-ummgaa-nw: #f59e0b;
  --ip-ummgaa-se: #ea580c;
  --ip-ycdn-crs: #2563eb;
  --ip-ycdn-srs: #6366f1;
}

/* Dark theme — opt-in via <html data-theme="dark">. Not applied to any view
   in Phase 1; present so Phase 2 components can be verified in both themes. */
:root[data-theme="dark"] {
  --color-primary: #3b82f6;
  --color-primary-dark: #2563eb;
  --color-primary-light: #60a5fa;
  --color-primary-faint: #1e3a8a;

  --color-success-bg: #064e3b;
  --color-success-text: #a7f3d0;
  --color-warning-bg: #78350f;
  --color-warning-text: #fde68a;
  --color-error-bg: #7f1d1d;
  --color-error-text: #fecaca;
  --color-info-bg: #1e3a8a;
  --color-info-text: #bfdbfe;

  --surface-body: #0f172a;
  --surface-raised: #1e293b;
  --surface-sunken: #0b1220;
  --surface-border: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --text-muted: #64748b;
  --overlay-hover: rgba(255, 255, 255, 0.06);

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.4);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
}

/* ============================================================================
   2. BASE STYLES
   ============================================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-gray-800);
  background-color: var(--color-gray-50);
  text-wrap: pretty;
}

body.dochub-nav-open {
  overflow: hidden;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* Keyboard-only focus ring. Component rules that set their own :focus shadow
   (forms, etc.) win on specificity; elements without a focus rule inherit
   this consistent ring when keyboard-navigated. */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* ============================================================================
   3. LAYOUT COMPONENTS
   ============================================================================ */

.dochub-skip-link {
  position: absolute;
  top: -9999px;
  left: 0;
  background: var(--color-primary);
  color: var(--color-white);
  padding: var(--space-3) var(--space-4);
  border-radius: 0 0 var(--radius-md) 0;
  z-index: var(--z-tooltip);
}

.dochub-skip-link:focus {
  top: 0;
}

/* Page Container */
.dochub-page {
  display: flex;
  min-height: 100vh;
}

/* Main Content Area */
.dochub-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-left: 280px; /* Width of sidebar */
  min-width: 0;
}

.dochub-content {
  flex: 1;
  padding: var(--space-6);
  overflow-y: auto;
}

/* Container */
.dochub-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.dochub-container--wide {
  max-width: 1400px;
}

@media (min-width: 1920px) {
  .dochub-container--wide {
    max-width: 1600px;
  }
}

.dochub-page-shell {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.dochub-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.dochub-page-header__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.dochub-page-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.dochub-page-title {
  font-size: clamp(1.5rem, 2vw, 2rem);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-gray-900);
}

.dochub-page-description {
  max-width: 72ch;
  color: var(--color-gray-600);
}

.dochub-surface {
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.dochub-surface--flush {
  overflow: hidden;
}

.dochub-surface__header,
.dochub-surface__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-4) var(--space-5);
}

.dochub-surface__header {
  border-bottom: 1px solid var(--color-gray-200);
}

.dochub-surface__footer {
  border-top: 1px solid var(--color-gray-200);
  background: var(--color-gray-50);
}

.dochub-surface__title {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-seMBold);
  color: var(--color-gray-900);
}

.dochub-surface__subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-gray-500);
}

.dochub-summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.dochub-summary-chip {
  min-width: 160px;
  padding: var(--space-3) var(--space-4);
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
}

.dochub-summary-chip__label {
  display: block;
  margin-bottom: var(--space-1);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-seMBold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-gray-500);
}

.dochub-summary-chip__value {
  display: block;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-gray-900);
}

.dochub-summary-chip__meta {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--font-size-sm);
  color: var(--color-gray-500);
}

/* ============================================================================
   4. NAVIGATION
   ============================================================================ */

/* Sidebar */
.dochub-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background-color: var(--color-white);
  border-right: 1px solid var(--color-gray-200);
  display: flex;
  flex-direction: column;
  z-index: var(--z-fixed);
  transition: transform var(--transition-base);
}

.dochub-sidebar__header {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--color-gray-200);
}

.dochub-sidebar__logo {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
}

.dochub-sidebar__nav {
  flex: 1;
  padding: var(--space-4) 0;
  overflow-y: auto;
}

.dochub-sidebar__footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-gray-200);
}

/* Navigation List */
.nav-list {
  list-style: none;
}

.nav-item {
  position: relative;
}

.nav-link,
.nav-item > span {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-6);
  color: var(--color-gray-600);
  font-weight: var(--font-weight-medium);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.nav-link:hover {
  color: var(--color-primary);
  background-color: var(--color-primary-faint);
  text-decoration: none;
}

.nav-item--active > .nav-link,
.nav-item--active > span {
  color: var(--color-primary);
  background-color: var(--color-primary-faint);
  border-right: 3px solid var(--color-primary);
}

/* Sub Navigation */
.sub-nav-list {
  list-style: none;
  padding-left: var(--space-6);
}

.sub-nav-list .nav-link {
  padding: var(--space-2) var(--space-6);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-normal);
}

/* Icons */
.icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Top Header */
.dochub-header {
  height: 64px;
  background-color: var(--color-white);
  border-bottom: 1px solid var(--color-gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.dochub-header__title {
  display: block;
  min-width: 0;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-seMBold);
  color: var(--color-gray-900);
}

.dochub-header__user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.dochub-sidebar__toggle {
  display: none;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-md);
  background: var(--color-white);
  color: var(--color-gray-700);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.dochub-sidebar__toggle:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.dochub-sidebar__backdrop {
  position: fixed;
  inset: 0;
  background: rgb(15 23 42 / 0.45);
  z-index: calc(var(--z-fixed) - 1);
}

.dochub-sidebar__backdrop[hidden] {
  display: none !important;
}

/* Breadcrumbs */
.breadcrumb-nav {
  padding: var(--space-4) var(--space-6);
  background-color: var(--color-white);
  border-bottom: 1px solid var(--color-gray-200);
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  list-style: none;
  gap: var(--space-2);
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--color-gray-500);
}

.breadcrumb-item::after {
  content: "/";
  color: var(--color-gray-400);
}

.breadcrumb-item:last-child::after {
  display: none;
}

.breadcrumb-item--active {
  color: var(--color-gray-700);
  font-weight: var(--font-weight-medium);
}

/* ============================================================================
   ENHANCED NAVIGATION STYLES
   ============================================================================ */

/* Brand Header */
.dochub-sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.dochub-sidebar__logo-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-xl);
  color: var(--color-white);
}

.dochub-sidebar__logo-text {
  display: flex;
  flex-direction: column;
}

.dochub-sidebar__logo-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-gray-900);
  line-height: 1.2;
}

.dochub-sidebar__logo-subtitle {
  font-size: var(--font-size-xs);
  color: var(--color-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Navigation Sections */
.nav-section {
  margin-bottom: var(--space-2);
}

.nav-section__title {
  padding: var(--space-3) var(--space-6) var(--space-2);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-seMBold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-gray-400);
}

/* Enhanced Nav Items */
.nav-item {
  margin: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.nav-item--active {
  background-color: var(--color-primary-faint);
}

.nav-item--active > .nav-link {
  color: var(--color-primary);
  font-weight: var(--font-weight-seMBold);
  border-right: none;
}

.nav-item--active .nav-icon {
  color: var(--color-primary);
}

/* Nav Links */
.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: var(--color-gray-600);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  text-decoration: none;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.nav-link:hover {
  color: var(--color-gray-900);
  background-color: var(--color-gray-100);
  text-decoration: none;
}

.nav-item--active > .nav-link:hover {
  background-color: transparent;
}

/* Nav Icon */
.nav-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-base);
  color: var(--color-gray-400);
  transition: color 0.2s ease;
}

.nav-link:hover .nav-icon,
.nav-item--active .nav-icon {
  color: var(--color-primary);
}

/* Nav Text */
.nav-text {
  flex: 1;
}

/* Nav Chevron for collapsible */
.nav-chevron {
  font-size: var(--font-size-xs);
  color: var(--color-gray-400);
  transition: transform 0.2s ease;
}

.nav-item--expanded .nav-chevron {
  transform: rotate(180deg);
}

/* Submenu */
.nav-submenu {
  list-style: none;
  padding: var(--space-1) 0;
  background-color: var(--color-gray-50);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.nav-submenu__item {
  position: relative;
}

.nav-submenu__item--active::before {
  content: "";
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background-color: var(--color-primary);
  border-radius: 50%;
}

.nav-submenu__link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-10);
  color: var(--color-gray-500);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-normal);
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav-submenu__link:hover {
  color: var(--color-gray-900);
  text-decoration: none;
}

.nav-submenu__item--active .nav-submenu__link {
  color: var(--color-primary);
  font-weight: var(--font-weight-medium);
}

/* User Profile Section */
.user-profile {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: start;
  gap: var(--space-3);
  padding: var(--space-3);
  background-color: var(--color-gray-50);
  border-radius: var(--radius-lg);
}

.user-profile__avatar {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary-faint) 0%, var(--color-primary) 100%);
  border-radius: 50%;
  font-size: var(--font-size-lg);
}

.user-profile__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-top: 1px;
}

.user-profile__name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-seMBold);
  color: var(--color-gray-900);
  line-height: var(--line-height-tight);
  overflow-wrap: anywhere;
}

.user-profile__role {
  font-size: var(--font-size-xs);
  color: var(--color-gray-500);
  line-height: var(--line-height-tight);
  overflow-wrap: anywhere;
}

.user-profile__actions {
  grid-column: 1 / -1;
  display: flex;
  gap: var(--space-2);
}

.user-profile__action {
  flex: 1 1 0;
  width: auto;
  height: 44px;
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-profile__action:hover {
  background-color: var(--color-primary-faint);
  border-color: var(--color-primary);
}

/* Enhanced Header */
.dochub-header__left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
}

.dochub-header__breadcrumbs {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.dochub-header__right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-shrink: 0;
}

.dochub-notification-menu {
  position: relative;
}

.dochub-notification-menu__toggle {
  position: relative;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-raised);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.dochub-notification-menu__toggle:hover,
.dochub-notification-menu__toggle[aria-expanded="true"] {
  border-color: var(--color-primary);
  background-color: var(--color-primary-faint);
}

.dochub-notification-menu__icon {
  font-size: var(--font-size-base);
}

.dochub-notification-menu__badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--color-error);
  color: var(--color-white);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-seMBold);
  line-height: 1;
}

.dochub-notification-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-2));
  width: min(380px, calc(100vw - 2rem));
  background: var(--surface-raised);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: calc(var(--z-dropdown) + 2);
}

.dochub-notification-menu__header,
.dochub-notification-menu__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface-sunken);
}

.dochub-notification-menu__title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-seMBold);
  color: var(--text-primary);
}

.dochub-notification-menu__subtitle {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
}

.dochub-notification-menu__mark-all {
  border: none;
  background: none;
  color: var(--color-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
}

.dochub-notification-menu__list {
  max-height: 360px;
  overflow-y: auto;
}

.dochub-notification-menu__item {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  padding: var(--space-4);
  border: none;
  border-top: 1px solid var(--surface-border);
  background: var(--surface-raised);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.dochub-notification-menu__item:hover {
  background-color: var(--overlay-hover);
}

.dochub-notification-menu__item--unread {
  background: var(--color-primary-faint);
}

.dochub-notification-menu__item-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-seMBold);
  color: var(--text-primary);
}

.dochub-notification-menu__item-message {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.dochub-notification-menu__item-meta {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
}

.dochub-notification-menu__empty {
  padding: var(--space-6) var(--space-4);
  color: var(--text-tertiary);
  text-align: center;
}

.dochub-header__date {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background-color: var(--color-gray-50);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  color: var(--color-gray-600);
}

.date-icon {
  font-size: var(--font-size-base);
}

.hamburger-icon {
  font-size: var(--font-size-lg);
}

/* Dismissible Alerts */
.dochub-alert--dismissible {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
}

.dochub-alert__icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-bold);
}

.dochub-alert__message {
  flex: 1;
}

.dochub-alert__close {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: var(--font-size-xl);
  color: currentColor;
  opacity: 0.6;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dochub-alert__close:hover,
.dochub-alert__close:focus {
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
}

.dochub-alert__close:hover {
  opacity: 1;
}

.dochub-toast-region {
  position: fixed;
  top: calc(var(--space-6) + 64px);
  right: var(--space-6);
  z-index: 1200;
  width: min(420px, calc(100vw - (2 * var(--space-4))));
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.dochub-toast {
  margin: 0;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
}

@media (max-width: 640px) {
  .dochub-toast-region {
    top: var(--space-4);
    right: var(--space-4);
    left: var(--space-4);
    width: auto;
  }
}

.dochub-notification-inbox {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.dochub-notification-inbox__item {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  background: var(--color-white);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.dochub-notification-inbox__item:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.dochub-notification-inbox__item--unread {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.dochub-notification-inbox__topline,
.dochub-notification-inbox__footer,
.dochub-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.dochub-notification-inbox__title {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-seMBold);
  color: var(--color-gray-900);
}

.dochub-notification-inbox__meta,
.dochub-pagination__status {
  font-size: var(--font-size-sm);
  color: var(--color-gray-500);
}

.dochub-notification-inbox__message {
  color: var(--color-gray-700);
  line-height: 1.5;
  white-space: pre-line;
}

.dochub-empty-state {
  padding: var(--space-8);
  text-align: center;
  background: var(--color-gray-50);
  border-radius: var(--radius-lg);
}

.dochub-empty-state__title {
  margin-bottom: var(--space-2);
  color: var(--color-gray-900);
}

.dochub-empty-state__description {
  margin: 0;
  color: var(--color-gray-500);
}

.dochub-btn--disabled,
.dochub-btn--disabled:hover,
.dochub-btn--disabled:focus {
  opacity: 0.6;
  pointer-events: none;
}

/* ============================================================================
   5. FORMS
   ============================================================================ */

.dochub-form {
  max-width: 100%;
}

.dochub-form__group {
  margin-bottom: var(--space-5);
}

.dochub-form__label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: var(--font-weight-medium);
  color: var(--color-gray-700);
}

.dochub-form__label--required::after {
  content: " *";
  color: var(--color-error);
}

.dochub-form__input,
.dochub-form__select,
.dochub-form__textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-family: inherit;
  background-color: var(--color-white);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.dochub-form__input:focus,
.dochub-form__select:focus,
.dochub-form__textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-faint);
}
.dochub-form__select option:checked {
  background-color: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 0 10px 100px #2563eb inset !important;
}

.dochub-form__input:disabled,
.dochub-form__select:disabled,
.dochub-form__textarea:disabled {
  background-color: var(--color-gray-100);
  cursor: not-allowed;
}

.dochub-form__textarea {
  min-height: 120px;
  resize: vertical;
}

.dochub-form__hint {
  margin-top: var(--space-1);
  font-size: var(--font-size-sm);
  color: var(--color-gray-500);
}

.dochub-form__error {
  margin-top: var(--space-1);
  font-size: var(--font-size-sm);
  color: var(--color-error);
}

[data-validation-summary].validation-summary-valid {
  display: none;
}

[data-validation-summary] {
  scroll-margin-top: 80px;
}

[data-validation-summary] ul {
  margin: 0;
  padding-left: var(--space-5);
}

[data-validation-summary] li + li {
  margin-top: var(--space-2);
}

[data-validation-summary]:focus {
  outline: 3px solid var(--color-primary-faint);
  outline-offset: 2px;
}

.project-document-upload-row {
  padding: var(--space-4);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  background: var(--color-gray-50);
}

.project-document-upload-row__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.project-document-upload-row__title {
  font-weight: var(--font-weight-seMBold);
  color: var(--color-gray-900);
}

[data-remove-project-document][hidden] {
  display: none;
}

/* Form Layouts */
.dochub-form__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 640px) {
  .dochub-form__row {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

/* KPI-specific form row with limited columns */
.dochub-form__row--kpi {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

@media (min-width: 1100px) {
  .dochub-form__row--kpi {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================================================
   6. BUTTONS
   ============================================================================ */

.dochub-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  font-family: inherit;
  line-height: var(--line-height-tight);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.dochub-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Primary Button */
.dochub-btn--primary {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.dochub-btn--primary:hover:not(:disabled) {
  background-color: var(--color-primary-dark);
  text-decoration: none;
}

/* Secondary Button */
.dochub-btn--secondary {
  background-color: var(--color-white);
  color: var(--color-gray-700);
  border-color: var(--color-gray-300);
}

.dochub-btn--secondary:hover:not(:disabled) {
  background-color: var(--color-gray-50);
  border-color: var(--color-gray-400);
  text-decoration: none;
}

/* Danger Button */
.dochub-btn--danger {
  background-color: var(--color-error);
  color: var(--color-white);
}

.dochub-btn--danger:hover:not(:disabled) {
  background-color: #dc2626;
  text-decoration: none;
}

/* Success Button */
.dochub-btn--success {
  background-color: var(--color-success);
  color: var(--color-white);
}

.dochub-btn--success:hover:not(:disabled) {
  background-color: #059669;
  text-decoration: none;
}

/* Button Sizes */
.dochub-btn--sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-sm);
}

.dochub-btn--lg {
  padding: var(--space-4) var(--space-6);
  font-size: var(--font-size-lg);
}
.ip-dashboard__amendments-btn {
    width: 50%; height: 50%;
}
/* ============================================================================
   7. TABLES
   ============================================================================ */

.dochub-table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.dochub-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
}

.dochub-table__header {
  background-color: var(--color-gray-50);
}

.dochub-table th,
.dochub-table td {
  padding: var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--color-gray-200);
  vertical-align: top;
}

.dochub-table--compact th,
.dochub-table--compact td {
  padding: var(--space-3) var(--space-4);
}

/* ============================================================================
   DENSE TABLE MODE (UI Optimization)
   ============================================================================ */

.dochub-table--dense {
  font-size: var(--font-size-sm);
}

.dochub-table--dense th,
.dochub-table--dense td {
  padding: var(--space-2) var(--space-4);
}

.dochub-table--dense tr {
  min-height: 48px;
}

.dochub-table--dense .dochub-table__primary {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-tight);
}

.dochub-table--dense .dochub-table__secondary,
.dochub-table--dense .dochub-table__meta {
  font-size: var(--font-size-xs);
}

.dochub-table--dense .dochub-badge {
  font-size: var(--font-size-xs);
  padding: 2px var(--space-2);
}

.dochub-table--dense .dochub-btn--sm {
  padding: calc(var(--space-1) / 2) var(--space-3);
  font-size: var(--font-size-xs);
}

/* ============================================================================
   TABLE ROW HEIGHT FIXES (Prevents uneven row heights)
   ============================================================================ */

.dochub-table tbody tr {
  height: 48px; /* Fixed height instead of min-height */
}

.dochub-table td {
  vertical-align: middle; /* Center content vertically */
  white-space: normal;
}

.dochub-table td.dochub-table__cell--actions {
  white-space: nowrap;
}

/* Allow wrapping only in specific cells that need it */
.dochub-table td.allow-wrap {
  white-space: normal;
}

/* ============================================================================
   ACTION BUTTON COMPACT MODE (Reduces button bloat)
   ============================================================================ */

.dochub-table__actions--compact {
  gap: var(--space-1);
}

.dochub-table__actions--compact .dochub-btn--sm {
  padding: 2px 8px;
  font-size: 11px;
  min-height: 28px;
}

/* Icon-only buttons for common actions */
.dochub-btn--icon {
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.dochub-table th {
  font-weight: var(--font-weight-seMBold);
  color: var(--color-gray-700);
  font-size: var(--font-size-sm);
  text-transform: none;
  letter-spacing: 0.01em;
}

.dochub-table tbody tr:hover {
  background-color: var(--color-gray-50);
}

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

/* Table Actions */
.dochub-table__actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}

.dochub-table__primary {
  display: block;
  font-weight: var(--font-weight-seMBold);
  color: var(--color-gray-900);
}

.dochub-table__secondary {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--font-size-sm);
  color: var(--color-gray-500);
}

.dochub-table__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-1);
  font-size: var(--font-size-sm);
  color: var(--color-gray-500);
}

.dochub-table__meta > span:not(:last-child)::after {
  content: "•";
  margin-left: var(--space-2);
  color: var(--color-gray-300);
}

.dochub-table__cell--actions {
  white-space: nowrap;
}

.dochub-empty-surface {
  padding: var(--space-8);
}

/* ============================================================================
   8. CARDS & PANELS
   ============================================================================ */

.dochub-card {
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.dochub-card__header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.dochub-card__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-seMBold);
  color: var(--color-gray-900);
}

.dochub-card__body {
  padding: var(--space-6);
}

.dochub-card__footer {
  padding: var(--space-4) var(--space-6);
  background-color: var(--color-gray-50);
  border-top: 1px solid var(--color-gray-200);
}

.dochub-card__footer--sticky {
  margin: var(--space-6) calc(-1 * var(--space-6)) calc(-1 * var(--space-6));
  padding: var(--space-4) var(--space-6);
}

/* ============================================================================
   PANEL COMPONENT (UI Optimization - flat container without shadow)
   ============================================================================ */

.dochub-panel {
  background: var(--color-white);
  border-radius: var(--radius-xl);
}

.dochub-panel__header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.dochub-panel__title {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-seMBold);
  color: var(--color-gray-900);
}

.dochub-panel__body {
  padding: 0;
}

.dochub-list-search {
  align-items: flex-end;
}

.dochub-list-search__field {
  flex: 1 1 28rem;
  max-width: 42rem;
}

.dochub-list-search__controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.dochub-list-search__status {
  margin: 0 0 var(--space-3);
  color: var(--color-gray-600);
  font-size: var(--font-size-sm);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .dochub-list-search__controls {
    align-items: stretch;
    flex-direction: column;
  }

  .dochub-list-search__status {
    margin-bottom: 0;
  }
}

/* Stats Card */
.dochub-stat {
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.dochub-stat__label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-gray-500);
  letter-spacing: 0.02em;
}

.dochub-metric-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  border-left: 4px solid var(--color-gray-300);
  box-shadow: var(--shadow-sm);
}

.dochub-metric-card--info {
  border-left-color: var(--color-info);
  background: var(--color-info-bg);
}

.dochub-metric-card--warning {
  border-left-color: var(--color-warning);
  background: var(--color-warning-bg);
}

.dochub-metric-card--success {
  border-left-color: var(--color-success);
  background: var(--color-success-bg);
}

.dochub-tabset {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.dochub-filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-3);
}

.dochub-page-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.dochub-section-eyebrow {
  font-size: var(--font-size-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-gray-500);
}

.dochub-comment-preview {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dochub-review-panel {
  border: 2px solid var(--color-primary-faint);
}

.dochub-review-panel > .dochub-card__header {
  background: linear-gradient(180deg, var(--color-primary), var(--color-primary-dark));
  color: var(--color-white);
}

.dochub-review-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.dochub-history-item {
  border-left: 4px solid var(--color-gray-300);
}

.dochub-history-item--approved {
  border-left-color: var(--color-success);
}

.dochub-history-item--revision {
  border-left-color: var(--color-warning);
}

.dochub-sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: var(--z-sticky);
  backdrop-filter: blur(6px);
}

.dochub-stat__value {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-gray-900);
  margin-top: var(--space-2);
}

.dochub-stat__change {
  font-size: var(--font-size-sm);
  margin-top: var(--space-2);
}

.dochub-stat__change--positive {
  color: var(--color-success);
}

.dochub-stat__change--negative {
  color: var(--color-error);
}

/* ============================================================================
   9. ALERTS & MESSAGES
   ============================================================================ */

.dochub-alert {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.dochub-alert--success {
  background-color: var(--color-success-bg);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.dochub-alert--warning {
  background-color: var(--color-warning-bg);
  color: #92400e;
  border: 1px solid #fde68a;
}

.dochub-alert--error {
  background-color: var(--color-error-bg);
  color: #991b1b;
  border: 1px solid #fecaca;
}

.dochub-alert--info {
  background-color: var(--color-info-bg);
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* ============================================================================
   10. BADGES
   ============================================================================ */

.dochub-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-seMBold);
  border-radius: var(--radius-full);
}

.dochub-badge--success {
  background-color: var(--color-success-bg);
  color: #065f46;
}

.dochub-badge--warning {
  background-color: var(--color-warning-bg);
  color: #92400e;
}

.dochub-badge--error {
  background-color: var(--color-error-bg);
  color: #991b1b;
}

.dochub-badge--info {
  background-color: var(--color-info-bg);
  color: #1e40af;
}

.dochub-badge--neutral {
  background-color: var(--color-gray-200);
  color: var(--color-gray-700);
}

/* Large Badge Variant */
.dochub-badge--lg {
  font-size: var(--font-size-lg);
  padding: var(--space-2) var(--space-4);
}

/* ============================================================================
   11. UTILITIES
   ============================================================================ */

/* Display */
.u-hidden { display: none !important; }
.u-block { display: block !important; }
.u-inline { display: inline !important; }
.u-inline-block { display: inline-block !important; }
.u-flex { display: flex !important; }
.u-grid { display: grid !important; }

/* Text */
.u-text-left { text-align: left !important; }
.u-text-center { text-align: center !important; }
.u-text-right { text-align: right !important; }
.u-text-nowrap { white-space: nowrap !important; }
.u-text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Spacing - Margin Top */
.u-mt-0 { margin-top: 0 !important; }
.u-mt-1 { margin-top: var(--space-1) !important; }
.u-mt-2 { margin-top: var(--space-2) !important; }
.u-mt-3 { margin-top: var(--space-3) !important; }
.u-mt-4 { margin-top: var(--space-4) !important; }
.u-mt-6 { margin-top: var(--space-6) !important; }
.u-mt-8 { margin-top: var(--space-8) !important; }

/* Spacing - Margin Bottom */
.u-mb-0 { margin-bottom: 0 !important; }
.u-mb-2 { margin-bottom: var(--space-2) !important; }
.u-mb-3 { margin-bottom: var(--space-3) !important; }
.u-mb-4 { margin-bottom: var(--space-4) !important; }
.u-mb-6 { margin-bottom: var(--space-6) !important; }
.u-mb-8 { margin-bottom: var(--space-8) !important; }

/* Spacing - Margin Y (Vertical) */
.u-my-4 { margin-top: var(--space-4) !important; margin-bottom: var(--space-4) !important; }
.u-my-6 { margin-top: var(--space-6) !important; margin-bottom: var(--space-6) !important; }

/* Spacing - Margin Left */
.u-ml-2 { margin-left: var(--space-2) !important; }
.u-ml-6 { margin-left: var(--space-6) !important; }

/* Spacing - Padding */
.u-p-2 { padding: var(--space-2) !important; }
.u-p-3 { padding: var(--space-3) !important; }
.u-p-4 { padding: var(--space-4) !important; }
.u-py-3 { padding-top: var(--space-3) !important; padding-bottom: var(--space-3) !important; }
.u-py-4 { padding-top: var(--space-4) !important; padding-bottom: var(--space-4) !important; }

/* Flexbox Utilities */
.u-justify-between { justify-content: space-between !important; }
.u-justify-center { justify-content: center !important; }
.u-justify-start { justify-content: flex-start !important; }
.u-justify-end { justify-content: flex-end !important; }
.u-align-center { align-items: center !important; }
.u-items-center { align-items: center !important; }
.u-align-start { align-items: flex-start !important; }
.u-align-end { align-items: flex-end !important; }
.u-flex-col { flex-direction: column !important; }
.u-flex-wrap { flex-wrap: wrap !important; }
.u-flex-1 { flex: 1 1 auto !important; }

/* Grid */
.u-grid-cols-2 { grid-template-columns: repeat(2, 1fr) !important; }
.u-grid-cols-3 { grid-template-columns: repeat(3, 1fr) !important; }
.u-grid-cols-4 { grid-template-columns: repeat(4, 1fr) !important; }
.u-grid-cols-6 { grid-template-columns: repeat(6, 1fr) !important; }
.u-gap-2 { gap: var(--space-2) !important; }
.u-gap-3 { gap: var(--space-3) !important; }
.u-gap-4 { gap: var(--space-4) !important; }
.u-gap-6 { gap: var(--space-6) !important; }

/* Width & Height Utilities */
.u-w-auto { width: auto !important; }
.u-w-full { width: 100% !important; }
.u-h-full { height: 100% !important; }
.u-overflow-auto { overflow: auto !important; }

/* Container Utilities */
.u-container-sm { max-width: 450px !important; margin-left: auto !important; margin-right: auto !important; }
.u-container-md { max-width: 500px !important; margin-left: auto !important; margin-right: auto !important; }
.u-container-center { margin-left: auto !important; margin-right: auto !important; }

/* Margin Center Utility */
.u-mx-auto { margin-left: auto !important; margin-right: auto !important; }

/* Font Size Utilities */
.u-text-xs { font-size: var(--font-size-xs) !important; }
.u-text-sm { font-size: var(--font-size-sm) !important; }
.u-text-base { font-size: var(--font-size-base) !important; }
.u-text-lg { font-size: var(--font-size-lg) !important; }
.u-text-xl { font-size: var(--font-size-xl) !important; }
.u-text-2xl { font-size: var(--font-size-2xl) !important; }
.u-text-3xl { font-size: var(--font-size-3xl) !important; }
.u-text-4xl { font-size: var(--font-size-4xl) !important; }

/* Font Weight Utilities */
.u-font-normal { font-weight: var(--font-weight-normal) !important; }
.u-font-medium { font-weight: var(--font-weight-medium) !important; }
.u-font-seMBold { font-weight: var(--font-weight-seMBold) !important; }
.u-font-bold { font-weight: var(--font-weight-bold) !important; }

/* Background Color Utilities */
.u-bg-gray-50 { background-color: var(--color-gray-50) !important; }
.u-bg-gray-100 { background-color: var(--color-gray-100) !important; }
.u-bg-primary-faint { background-color: var(--color-primary-faint) !important; }
.u-bg-white { background-color: var(--color-white) !important; }
.u-bg-highlight { background-color: rgb(219 234 254 / 0.35) !important; }
.u-bg-info-50 { background-color: var(--color-info-bg) !important; }
.u-bg-warning-50 { background-color: var(--color-warning-bg) !important; }
.u-bg-success-50 { background-color: var(--color-success-bg) !important; }

/* Text Color Utilities */
.u-text-error { color: var(--color-error) !important; }
.u-text-success { color: #047857 !important; }
.u-text-warning { color: #b45309 !important; }
.u-text-primary { color: var(--color-primary) !important; }
.u-text-muted { color: var(--color-gray-500) !important; }

/* Border Utilities */
.u-border-left-primary { border-left: 4px solid var(--color-primary) !important; }
.u-border-left-success { border-left: 4px solid var(--color-success) !important; }
.u-border-left-warning { border-left: 4px solid var(--color-warning) !important; }
.u-border-top { border-top: 1px solid var(--color-gray-200) !important; }

/* Border Radius Utilities */
.u-rounded-md { border-radius: var(--radius-md) !important; }
.u-rounded-lg { border-radius: var(--radius-lg) !important; }

/* Cursor Utilities */
.u-cursor-pointer { cursor: pointer !important; }
.u-cursor-not-allowed { cursor: not-allowed !important; }

/* List Utilities */
.u-list-disc { list-style-type: disc !important; }
.u-list-decimal { list-style-type: decimal !important; }
.u-list-none { list-style-type: none !important; }

/* Pre-wrap for text */
.u-white-space-pre-wrap { white-space: pre-wrap !important; }

/* ============================================================================
   UI OPTIMIZATION UTILITIES
   ============================================================================ */

/* Text truncation with ellipsis */
.dochub-table__truncate {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dochub-table__truncate--2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}

/* Link-styled button */
.dochub-link-btn {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.dochub-link-btn:hover {
  color: var(--color-primary-dark);
}

/* ============================================================================
   12. FILE UPLOAD
   ============================================================================ */

.dochub-file-upload {
  position: relative;
  display: block;
  width: 100%;
}

.dochub-file-upload__input {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.dochub-file-upload__label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  border: 2px dashed var(--color-gray-300);
  border-radius: var(--radius-lg);
  background-color: var(--color-gray-50);
  transition: all var(--transition-fast);
  cursor: pointer;
  text-align: center;
}

.dochub-file-upload:hover .dochub-file-upload__label,
.dochub-file-upload__input:focus + .dochub-file-upload__label {
  border-color: var(--color-primary);
  background-color: var(--color-primary-faint);
}

.dochub-file-upload__icon {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-3);
}

.dochub-file-upload__text {
  font-weight: var(--font-weight-medium);
  color: var(--color-gray-700);
  margin-bottom: var(--space-1);
}

.dochub-file-upload__hint {
  font-size: var(--font-size-sm);
  color: var(--color-gray-500);
}

/* File Preview */
.dochub-file-preview {
  margin-top: var(--space-4);
}

.dochub-file-preview__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background-color: var(--color-gray-50);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
}

.dochub-file-preview__name {
  flex: 1;
  font-weight: var(--font-weight-medium);
  color: var(--color-gray-700);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dochub-file-preview__size {
  font-size: var(--font-size-sm);
  color: var(--color-gray-500);
}

.dochub-file-preview__remove {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-error);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: var(--font-size-xl);
  line-height: 1;
  transition: background-color var(--transition-fast);
}

.dochub-file-preview__remove:hover {
  background-color: #dc2626;
}

/* File Item (for existing documents) */
.dochub-file-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background-color: var(--color-gray-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-gray-200);
}

.dochub-file-item__icon {
  font-size: var(--font-size-xl);
}

.dochub-file-item__name {
  flex: 1;
  min-width: 0;
  font-size: var(--font-size-sm);
  color: var(--color-gray-700);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-uploaded-documents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 32rem), 1fr));
  gap: var(--space-4);
}

.report-uploaded-documents-grid .dochub-file-item {
  min-width: 0;
  flex-wrap: wrap;
}

.report-uploaded-documents-grid .dochub-file-item__name {
  flex-basis: 12rem;
}

/* ============================================================================
   13. COMPONENT EXTENSIONS (Guardrail 1 Compliance)
   ============================================================================ */

/* Card Footer Variants */
.dochub-card__footer--flush { 
  margin: var(--space-6) calc(-1 * var(--space-6)) calc(-1 * var(--space-6)); 
  padding: var(--space-4) var(--space-6); 
}
.dochub-card__footer--compact { 
  padding: var(--space-3) var(--space-4); 
}

/* Form Input Variants */
.dochub-form__input--readonly { 
  background-color: var(--color-gray-100); 
}

/* Code Inline */
.dochub-code { 
  background: var(--color-gray-100); 
  padding: var(--space-1) var(--space-2); 
  border-radius: var(--radius-sm);
  font-family: var(--font-family-mono);
  font-size: var(--font-size-sm);
}

/* Icon Sizes */
.dochub-icon--lg { font-size: var(--font-size-2xl); }
.dochub-icon--xl { font-size: 3rem; }
.dochub-icon--2xl { font-size: 4rem; }

/* Stat Value Variants */
.dochub-stat__value--medium { font-size: var(--font-size-xl); }
.dochub-stat__value--large { 
  font-size: var(--font-size-3xl); 
  font-weight: var(--font-weight-bold); 
}

/* Badge Variants */
.dochub-badge--large { 
  font-size: var(--font-size-lg); 
  padding: var(--space-2) var(--space-4); 
}

/* Divider */
.dochub-divider { 
  margin: var(--space-4) 0; 
  border: none; 
  border-top: 1px solid var(--color-gray-200); 
}

/* KPI Unit */
.dochub-kpi__unit { 
  font-weight: normal; 
  color: var(--color-gray-500); 
}

/* Box (Gray background container) */
.dochub-box { 
  padding: var(--space-4); 
  background-color: var(--color-gray-50); 
  border-radius: var(--radius-md); 
}

/* File Item Row Variant */
.dochub-file-item--row { 
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3); 
  border: 1px solid var(--color-gray-200); 
  border-radius: var(--radius-md); 
  align-items: center; 
}
.dochub-file-item--row__icon { 
  font-size: var(--font-size-2xl); 
}

/* ============================================================================
   14. PROGRESS BAR
   ============================================================================ */

.dochub-progress {
  width: 100%;
  height: 8px;
  background-color: var(--color-gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.dochub-progress__bar {
  height: 100%;
  background-color: var(--color-success);
  transition: width var(--transition-slow), background-color var(--transition-fast);
}

.dochub-progress--success .dochub-progress__bar {
  background-color: var(--color-success);
}

.dochub-progress--warning .dochub-progress__bar {
  background-color: var(--color-warning);
}

.dochub-progress--danger .dochub-progress__bar {
  background-color: var(--color-error);
}

/* ============================================================================
   15. INPUT GROUP (for currency prefix)
   ============================================================================ */

.dochub-input-group {
  display: flex;
  align-items: stretch;
}

.dochub-input-group__prefix {
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background-color: var(--color-gray-100);
  border: 1px solid var(--color-gray-300);
  border-right: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  font-weight: var(--font-weight-medium);
  color: var(--color-gray-600);
}

.dochub-input-group .dochub-form__input {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  flex: 1;
}

/* ============================================================================
   16. RESPONSIVE ADJUSTMENTS
   ============================================================================ */
@media (max-width: 1100px) {
  .dochub-main {
    margin-left: 0;
  }

  .dochub-sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-xl);
  }

  .dochub-sidebar--open {
    transform: translateX(0);
  }

  .dochub-sidebar__toggle {
    display: inline-flex;
  }

  .dochub-content {
    padding: var(--space-4);
  }

  .dochub-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .u-grid-cols-6 { grid-template-columns: repeat(2, 1fr) !important; }
  .u-grid-cols-4 { grid-template-columns: repeat(2, 1fr) !important; }
  .u-grid-cols-3 { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 700px) {
  .dochub-container {
    padding: 0 var(--space-2);
  }

  .dochub-header {
    padding: 0 var(--space-3);
    gap: var(--space-2);
  }

  .dochub-header__title {
    font-size: var(--font-size-lg);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .dochub-header__right {
    gap: var(--space-2);
  }

  .dochub-header__date {
    display: none;
  }

  .dochub-card__header,
  .dochub-card__body,
  .dochub-card__footer {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  .dochub-filter-grid {
    grid-template-columns: 1fr;
  }

  .u-grid-cols-6,
  .u-grid-cols-4,
  .u-grid-cols-3,
  .u-grid-cols-2 {
    grid-template-columns: 1fr !important;
  }

  .dochub-review-actions {
    grid-template-columns: 1fr;
  }

  .dochub-table th,
  .dochub-table td {
    padding: var(--space-3);
  }

  .dochub-tabset {
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
    padding-bottom: var(--space-1);
  }

  .dochub-btn {
    padding: var(--space-3) var(--space-4);
    min-height: 44px;
  }
  
  /* Prevent iOS zoom on input focus - ensure 16px font size */
  .dochub-form__input,
  .dochub-form__select,
  .dochub-form__textarea {
    font-size: 16px;
    min-height: 44px;
  }
  
  /* Stack sticky action buttons on mobile */
  .dochub-sticky-actions .u-flex {
    flex-direction: column;
    gap: var(--space-3);
  }
  
  .dochub-sticky-actions .dochub-btn {
    width: 100%;
  }
  
  /* Ensure content isn't hidden behind sticky footer */
  .dochub-card__body {
    padding-bottom: 100px;
  }
}

/* Extra small screens */
@media (max-width: 375px) {
  .dochub-sidebar {
    width: 100%;
  }
  
  .dochub-card__title {
    font-size: var(--font-size-base);
  }
}

/* ============================================================================
   17. PRINT STYLES
   ============================================================================ */
@media print {
  .dochub-sidebar,
  .dochub-header,
  .breadcrumb-nav,
  .dochub-btn {
    display: none !important;
  }

  .dochub-main {
    margin-left: 0;
  }

  .dochub-card {
    box-shadow: none;
    border: 1px solid var(--color-gray-300);
  }
}

/* ============================================================================
   PRIORITY SCORE VISUALIZATION
   Styles for personalized priority widget and score display
   ============================================================================ */

/* Priority Cell Container */
.dochub-priority-cell {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 80px;
}

/* Priority Score Bar Container */
.dochub-priority-score {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Score Bar Background */
.dochub-score-bar {
  flex: 1;
  height: 6px;
  background-color: var(--color-gray-200);
  border-radius: 3px;
  overflow: hidden;
  min-width: 40px;
}

/* Score Bar Fill */
.dochub-score-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-success) 0%, var(--color-warning) 50%, var(--color-error) 100%);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Score Value Text */
.dochub-score-value {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-gray-600);
  min-width: 24px;
  text-align: right;
}

/* Priority Configuration Widget Styles */
.dochub-priority-widget .form-range {
  margin-bottom: 0.5rem;
}

.dochub-priority-widget .progress {
  height: 30px;
  border-radius: 4px;
  overflow: hidden;
}

.dochub-priority-widget .progress-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Priority Badge Enhancements */
.dochub-badge[title] {
  cursor: help;
  position: relative;
}

/* High Priority Row Highlight */
.dochub-table__row--highlight {
  background-color: rgba(239, 68, 68, 0.05);
  border-left: 3px solid var(--color-error);
}

.dochub-table__row--highlight:hover {
  background-color: rgba(239, 68, 68, 0.1);
}

/* Priority Tooltip Enhancement */
.dochub-priority-tooltip {
  max-width: 300px;
  white-space: pre-line;
}

/* Widget Card Styles */
.dochub-priority-section {
  opacity: 1;
  transition: opacity 0.2s ease;
}

.dochub-priority-section.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Mobile Responsiveness for Priority */
@media (max-width: 768px) {
  .dochub-priority-cell {
    min-width: 60px;
  }
  
  .dochub-score-bar {
    min-width: 30px;
  }
  
  .dochub-score-value {
    font-size: 0.7rem;
  }
}


/* ============================================================================
   MOBILE TABLE & CARD VIEW STYLES
   ============================================================================ */

/* Table column width definitions */
.dochub-table--reports th:nth-child(1),
.dochub-table--reports td:nth-child(1) { width: 50px; text-align: center; } /* Checkbox */

.dochub-table--reports th:nth-child(2),
.dochub-table--reports td:nth-child(2) { width: 100px; min-width: 80px; } /* Priority */

.dochub-table--reports th:nth-child(3),
.dochub-table--reports td:nth-child(3) { width: 120px; white-space: nowrap; } /* Period */

.dochub-table--reports th:nth-child(4),
.dochub-table--reports td:nth-child(4) { min-width: 150px; max-width: 200px; } /* IP */

.dochub-table--reports th:nth-child(5),
.dochub-table--reports td:nth-child(5) { min-width: 120px; max-width: 180px; } /* Site */

.dochub-table--reports th:nth-child(6),
.dochub-table--reports td:nth-child(6) { min-width: 140px; max-width: 220px; } /* Project */

.dochub-table--reports th:nth-child(10),
.dochub-table--reports td:nth-child(10) { width: 120px; white-space: nowrap; } /* Submitted */

.dochub-table--reports th:nth-child(11),
.dochub-table--reports td:nth-child(11) { width: 120px; text-align: right; } /* Budget */

.dochub-table--reports th:nth-child(12),
.dochub-table--reports td:nth-child(12) { width: 100px; text-align: center; } /* Actions */

/* Ensure table wrap has minimum height */
.dochub-table-wrap {
  min-height: 200px;
}

/* Mobile visibility utilities */
.dochub-hidden-mobile {
  display: block;
}

.dochub-visible-mobile-only {
  display: none;
}

/* Table checkbox touch target enhancement */
.dochub-table__checkbox-col {
  position: relative;
}

.dochub-table__checkbox-col input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--color-primary);
}

/* Mobile card list styles */
.dochub-card-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.dochub-card-list.dochub-visible-mobile-only {
  display: none;
}

.dochub-report-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-gray-200);
}

.dochub-report-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-gray-100);
}

.dochub-report-card__date {
  font-size: var(--font-size-sm);
  color: var(--color-gray-500);
}

.dochub-report-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.dochub-report-card__field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
}

.dochub-report-card__label {
  font-size: var(--font-size-sm);
  color: var(--color-gray-500);
  font-weight: var(--font-weight-medium);
}

.dochub-report-card__value {
  font-size: var(--font-size-sm);
  color: var(--color-gray-800);
  text-align: right;
  max-width: 60%;
}

.dochub-report-card__tracks {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dochub-report-card__actions {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-gray-100);
  display: flex;
  justify-content: flex-end;
}

.dochub-report-card__actions .dochub-btn {
  width: 100%;
  min-height: 44px;
}

/* Mobile breakpoint for card view */
@media (max-width: 768px) {
  .dochub-hidden-mobile {
    display: none !important;
  }
  
  .dochub-visible-mobile-only {
    display: block !important;
  }
  
  /* Override desktop hiding for the mobile card layout */
  .dochub-card-list.dochub-visible-mobile-only {
    display: flex !important;
  }
}

/* Filter bar improvements */
.dochub-filter-bar--collapsible {
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.dochub-filter-bar--collapsed {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

.dochub-filter-bar--expanded {
  max-height: 1000px;
  opacity: 1;
}

/* Quick filter scrollable on mobile */
@media (max-width: 640px) {
  .dochub-quick-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--space-2);
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .dochub-quick-filters::-webkit-scrollbar {
    display: none;
  }
  
  .dochub-quick-filter {
    flex-shrink: 0;
    min-height: 44px;
  }
}

/* Modal close button enhancement */
.dochub-modal__close {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 1.5rem;
  color: var(--color-gray-500);
  cursor: pointer;
  transition: all 0.2s ease;
}

.dochub-modal__close:hover,
.dochub-modal__close:focus {
  background: var(--color-gray-100);
  border-color: var(--color-gray-200);
  color: var(--color-gray-700);
}

/* Sticky action bar improvements */
.dochub-sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: var(--z-sticky);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--color-gray-200);
  padding: var(--space-4) 0;
  margin-top: var(--space-6);
}

/* Right-aligned currency values */
.dochub-table td:nth-child(11) {
  text-align: right;
  font-family: var(--font-family-mono);
  font-variant-numeric: tabular-nums;
}

/* Improved file upload max-width */
.dochub-file-upload {
  max-width: 600px;
}

/* Ensure file upload touch targets */
.dochub-file-upload__label {
  min-height: 120px;
}

@media (max-width: 640px) {
  .dochub-file-upload__label {
    min-height: 100px;
    padding: var(--space-6);
  }
}

/* ============================================================================
   PHASE 2 — NEW COMPONENT LAYER (mockup-aligned)
   Additive: existing .dochub-* classes remain fully functional. Views migrate
   to these class names incrementally. Names mirror docs/DocHub_Mockup.html so
   the mockup HTML can be pasted into a Razor view with minimal edits.
   ============================================================================ */

/* Icon utility — used with the #icon-* sprite injected into _Layout.cshtml */
.icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.125em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* ---------- Chip (replaces .dochub-badge + ad-hoc status spans) ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-seMBold);
  border-radius: var(--radius-full);
  line-height: 1.4;
  border: 1px solid transparent;
}
.chip__dot { width: 6px; height: 6px; border-radius: var(--radius-full); background: currentColor; }
.chip--success  { background: var(--color-success-bg); color: var(--color-success-text); }
.chip--warning  { background: var(--color-warning-bg); color: var(--color-warning-text); }
.chip--error    { background: var(--color-error-bg);   color: var(--color-error-text); }
.chip--info     { background: var(--color-info-bg);    color: var(--color-info-text); }
.chip--neutral  { background: var(--surface-sunken);   color: var(--text-secondary); }
.chip--xs { font-size: 10px; padding: 1px 6px; min-width: 26px; justify-content: center; }
.chip--md {
  min-width: 72px;
  height: 36px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-md);
  justify-content: center;
}
.chip--md.chip--na {
  background: transparent;
  color: var(--text-muted);
  border: 1px dashed var(--surface-border);
}

/* ---------- Metric card (coexists with .dochub-stat / .dochub-metric-card) ---------- */
.metric-card {
  background: var(--surface-raised);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}
.metric-card--sm { padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); }
.metric-card--warning { border-left: 4px solid var(--color-warning); }
.metric-card--success { border-left: 4px solid var(--color-success); }
.metric-card--info    { border-left: 4px solid var(--color-info); }
.metric-card--error   { border-left: 4px solid var(--color-error); }
.metric-card__label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-seMBold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.metric-card__value {
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  line-height: 1.1;
  margin-top: var(--space-2);
  font-size: var(--font-size-3xl);
}
.metric-card--sm .metric-card__value { font-size: var(--font-size-xl); margin-top: 4px; }
.metric-card__value--success { color: var(--color-success); }
.metric-card__value--error   { color: var(--color-error); }
.metric-card__meta { font-size: var(--font-size-xs); color: var(--text-tertiary); margin-top: var(--space-2); }
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.metrics-grid--sm {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

/* ---------- M&E dashboard status tiles ---------- */
.me-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.me-status-card {
  background: var(--color-info-bg);
  border-left: 4px solid var(--color-info);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  min-height: 122px;
  padding: var(--space-5) var(--space-6);
}

.me-status-card--warning {
  background: var(--color-warning-bg);
  border-left-color: var(--color-warning);
}

.me-status-card--success {
  background: var(--color-success-bg);
  border-left-color: var(--color-success);
}

.me-status-card__label {
  color: var(--text-tertiary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-seMBold);
  letter-spacing: 0.02em;
}

.me-status-card__value {
  color: var(--text-primary);
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  line-height: 1.1;
  margin-top: var(--space-4);
}

.me-status-card__meta {
  color: var(--text-tertiary);
  font-size: var(--font-size-sm);
  margin-top: var(--space-3);
}

@media (max-width: 960px) {
  .me-status-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 560px) {
  .me-status-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Portfolio tiles (IP grid on /Portfolio) ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-4);
}
.tile {
  background: var(--surface-raised);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  text-align: left;
  font-family: inherit;
  color: inherit;
  width: 100%;
  font-size: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}
.tile:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary-light);
  transform: translateY(-2px);
}
.tile__top { display: flex; align-items: flex-start; gap: var(--space-3); }
.tile__mark {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-lg);
  flex-shrink: 0;
  background: var(--color-primary);
}
.tile__mark--cho        { background: var(--ip-cho); }
.tile__mark--cmhn       { background: var(--ip-cmhn); }
.tile__mark--kehoc      { background: var(--ip-kehoc); }
.tile__mark--ummgaa-nw  { background: var(--ip-ummgaa-nw); }
.tile__mark--ummgaa-se  { background: var(--ip-ummgaa-se); }
.tile__mark--ycdn-crs   { background: var(--ip-ycdn-crs); }
.tile__mark--ycdn-srs   { background: var(--ip-ycdn-srs); }
.tile__name {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  line-height: 1.2;
}
.tile__sub { font-size: var(--font-size-xs); color: var(--text-tertiary); margin-top: 2px; }
.tile__region { font-size: var(--font-size-sm); color: var(--text-secondary); margin-top: var(--space-1); }
.tile__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--surface-border);
  border-bottom: 1px solid var(--surface-border);
}
.tile__stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  font-weight: var(--font-weight-seMBold);
}
.tile__stat-val { font-size: var(--font-size-base); font-weight: var(--font-weight-seMBold); color: var(--text-primary); }
.tile__footer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.tile__arrow { color: var(--color-primary); font-weight: var(--font-weight-bold); font-size: var(--font-size-xs); }

/* ---------- Compliance matrix (grant × document-type grid) ---------- */
.matrix { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--font-size-sm); }
.matrix th, .matrix td { padding: var(--space-2); text-align: center; border-bottom: 1px solid var(--surface-border); }
.matrix thead th {
  background: var(--surface-sunken);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  font-weight: var(--font-weight-seMBold);
}
.matrix thead th.matrix__th-lead { text-align: left; padding-left: var(--space-4); }
.matrix tbody th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  font-weight: var(--font-weight-seMBold);
  color: var(--text-primary);
  background: var(--surface-raised);
  position: sticky;
  left: 0;
  border-right: 1px solid var(--surface-border);
  font-size: var(--font-size-sm);
}
.matrix__ip-meta {
  font-weight: var(--font-weight-normal);
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  display: block;
  margin-top: 2px;
}
.matrix__colsub {
  font-weight: 400;
  text-transform: none;
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---------- Reports portal (grouped link list) ---------- */
.rpt-list__group {
  padding: var(--space-3) var(--space-4) var(--space-2);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  font-weight: var(--font-weight-seMBold);
  background: var(--surface-sunken);
  border-top: 1px solid var(--surface-border);
  border-bottom: 1px solid var(--surface-border);
}
.rpt-list__group:first-child { border-top: none; }
.rpt-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--surface-border);
  text-decoration: none;
  color: inherit;
  gap: var(--space-3);
}
.rpt-link:hover { background: var(--overlay-hover); }
.rpt-link__left { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.rpt-link__ico {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  display: grid;
  place-items: center;
  color: var(--text-tertiary);
  flex-shrink: 0;
}
.rpt-link__title { font-size: var(--font-size-sm); font-weight: var(--font-weight-seMBold); color: var(--text-primary); }
.rpt-link__meta  { font-size: var(--font-size-xs); color: var(--text-tertiary); margin-top: 2px; }
.rpt-link__right { display: flex; align-items: center; gap: var(--space-3); flex-shrink: 0; }
.rpt-link__arrow { color: var(--text-muted); }

/* ---------- ARIA tab pattern (used on Portfolio / Grant detail) ---------- */
.tabs {
  display: flex;
  gap: var(--space-1);
  background: var(--surface-sunken);
  padding: 4px;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
  overflow-x: auto;
}
.tab {
  flex-shrink: 0;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-seMBold);
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: transparent;
  white-space: nowrap;
  font-family: inherit;
}
.tab[aria-selected="true"],
a.tab[aria-current="page"] {
  background: var(--surface-raised);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}
a.tab {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

/* ============================================================================
   HOME TAB RAIL  (.ht-*)
   Editorial underline-style navigation used across the three home views:
   IP Portfolio / Compliance Matrix / KPI Dashboard.
   ============================================================================ */

/* Rail — the horizontal strip that holds the three tabs */
.ht-rail {
  display: flex;
  align-items: flex-end;
  gap: 0;
  border-bottom: 1.5px solid var(--color-gray-200);
  margin-bottom: 2rem;
  overflow-x: auto;
  /* Stagger the tab entrance */
  animation: ht-fade-in 0.35s ease both;
}

@keyframes ht-fade-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Individual tab link */
.ht-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.625rem 1.375rem 0.625rem;
  font-family: 'Syne', var(--font-family-base);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-gray-400);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  /* Underline indicator */
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1.5px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.ht-tab:hover {
  color: var(--color-gray-700);
  border-bottom-color: var(--color-gray-300);
}

/* Active / current tab */
.ht-tab--active,
.ht-tab[aria-current="page"] {
  color: #1a3d2b;
  border-bottom-color: #1a3d2b;
}

/* Icon inside each tab */
.ht-tab__ico {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  opacity: 0.55;
  transition: opacity 0.2s ease;
}

.ht-tab:hover .ht-tab__ico,
.ht-tab--active .ht-tab__ico,
.ht-tab[aria-current="page"] .ht-tab__ico {
  opacity: 1;
}

/* Stagger each tab's entrance */
.ht-tab:nth-child(1) { animation: ht-tab-in 0.3s 0.05s ease both; }
.ht-tab:nth-child(2) { animation: ht-tab-in 0.3s 0.12s ease both; }
.ht-tab:nth-child(3) { animation: ht-tab-in 0.3s 0.19s ease both; }

@keyframes ht-tab-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Dark theme */
[data-theme="dark"] .ht-rail      { border-bottom-color: var(--color-gray-700); }
[data-theme="dark"] .ht-tab       { color: var(--color-gray-600); }
[data-theme="dark"] .ht-tab:hover { color: var(--color-gray-300); border-bottom-color: var(--color-gray-600); }
[data-theme="dark"] .ht-tab--active,
[data-theme="dark"] .ht-tab[aria-current="page"] { color: #5dcea0; border-bottom-color: #5dcea0; }

/* ============================================================================
   HOME HERO  (.home-hero)
   Used only on the Dashboard/Index view. Full-bleed banner with the user's
   name and a contextual period label.
   ============================================================================ */

.home-hero {
  background: linear-gradient(135deg, #0e3526 0%, #1a5c3e 60%, #1e6b48 100%);
  border-radius: var(--radius-xl);
  padding: 2.25rem 2.5rem 2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  color: #fff;
}

/* Subtle geometric texture overlay */
.home-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.06) 0%, transparent 50%),
    radial-gradient(circle at 20% 80%, rgba(255,255,255,0.04) 0%, transparent 40%);
  pointer-events: none;
}

/* Decorative right-side element */
.home-hero::after {
  content: '';
  position: absolute;
  right: -40px;
  top: -40px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.08);
  pointer-events: none;
}

.home-hero__eyebrow {
  font-family: 'Syne', var(--font-family-base);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: 0.5rem;
}

.home-hero__title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 600;
  line-height: 1.15;
  color: #fff;
  margin: 0 0 0.35rem;
  letter-spacing: -0.01em;
}

.home-hero__title em {
  font-style: normal;
  color: rgba(255,255,255,0.72);
  font-weight: 500;
}

.home-hero__sub {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.5);
  margin: 0;
}

.home-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 100px;
  padding: 0.2rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.04em;
  backdrop-filter: blur(4px);
  margin-top: 1rem;
}

.home-hero__badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px #4ade80;
}

/* Dark theme: hero is already dark, keep as is */

/* ── Hero dot-grid texture (overrides the plain circle ::after) ── */
.home-hero::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 340px;
  background-image: radial-gradient(circle, rgba(255,255,255,0.18) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,0.35) 0%, transparent 100%);
  mask-image: linear-gradient(to left, rgba(0,0,0,0.35) 0%, transparent 100%);
  pointer-events: none;
  border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
}

/* ── Hero inner two-column layout ── */
.home-hero__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
  position: relative;
  z-index: 1;
}

.home-hero__left { flex: 1; min-width: 0; }

.home-hero__right {
  display: flex;
  gap: 2rem;
  flex-shrink: 0;
  padding-left: 2rem;
  border-left: 1px solid rgba(255,255,255,0.14);
}

.home-hero__keystat { text-align: center; }

.home-hero__keystat-val {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 2.125rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.02em;
}

.home-hero__keystat-label {
  font-family: 'Syne', var(--font-family-base);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.42);
  margin-top: 0.4rem;
  white-space: nowrap;
}

@media (max-width: 800px) {
  .home-hero__right { display: none; }
  .home-hero::after { width: 120px; }
}

/* ── Home metric cards — replaces the generic metric-card--sm on /Dashboard ── */
.home-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.875rem;
}

.home-metric {
  background: var(--surface-raised);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-xl);
  padding: 1.375rem 1.5rem 1.25rem;
  transition: box-shadow var(--transition-base), transform var(--transition-base);
  animation: hm-in 0.4s ease both;
}
.home-metric:nth-child(1) { animation-delay: 0.04s; }
.home-metric:nth-child(2) { animation-delay: 0.09s; }
.home-metric:nth-child(3) { animation-delay: 0.14s; }
.home-metric:nth-child(4) { animation-delay: 0.19s; }

@keyframes hm-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.home-metric:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.home-metric__val {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--color-gray-900);
  line-height: 1;
  letter-spacing: -0.025em;
}

.home-metric__label {
  font-family: 'Syne', var(--font-family-base);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-gray-400);
  margin-top: 0.6rem;
}

@media (max-width: 900px) { .home-metrics { grid-template-columns: repeat(2, 1fr); } }

[data-theme="dark"] .home-metric { border-color: var(--color-gray-700); }
[data-theme="dark"] .home-metric__val { color: var(--color-gray-50); }

/* ── Section label (replaces card headers for action groups) ── */
.home-section-title {
  font-family: 'Syne', var(--font-family-base);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-gray-400);
  margin-bottom: 0.875rem;
}

/* ── Action strip — icon-forward tiles replacing the dochub-card + emoji buttons ── */
.home-action-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.home-action {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.125rem;
  background: var(--surface-raised);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-xl);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
  animation: hm-in 0.35s ease both;
}

.home-action:nth-child(1) { animation-delay: 0.08s; }
.home-action:nth-child(2) { animation-delay: 0.14s; }
.home-action:nth-child(3) { animation-delay: 0.20s; }

.home-action:hover {
  border-color: #1a3d2b;
  box-shadow: 0 0 0 1px #1a3d2b, var(--shadow-sm);
  transform: translateY(-1px);
}

.home-action--primary {
  background: #1a3d2b;
  border-color: #1a3d2b;
}

.home-action--primary:hover {
  background: #0e3526;
  border-color: #0e3526;
  box-shadow: 0 0 0 1px #0e3526, var(--shadow-md);
}

.home-action__icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-lg);
  background: rgba(26,61,43,0.08);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #1a3d2b;
}

.home-action__icon svg { width: 16px; height: 16px; }

.home-action--primary .home-action__icon {
  background: rgba(255,255,255,0.14);
  color: #fff;
}

.home-action__text { flex: 1; min-width: 0; }

.home-action__name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-seMBold);
  color: var(--color-gray-800);
  line-height: 1.3;
}

.home-action--primary .home-action__name { color: #fff; }

.home-action__hint {
  font-size: 0.72rem;
  color: var(--color-gray-400);
  margin-top: 1px;
}

.home-action--primary .home-action__hint { color: rgba(255,255,255,0.55); }

.home-action__arrow {
  width: 15px;
  height: 15px;
  color: var(--color-gray-300);
  flex-shrink: 0;
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.home-action:hover .home-action__arrow { transform: translateX(3px); color: #1a3d2b; }
.home-action--primary .home-action__arrow { color: rgba(255,255,255,0.5); }
.home-action--primary:hover .home-action__arrow { color: #fff; transform: translateX(3px); }

[data-theme="dark"] .home-action { border-color: var(--color-gray-700); }
[data-theme="dark"] .home-action__icon { background: rgba(93,206,160,0.1); color: #5dcea0; }
[data-theme="dark"] .home-action__name { color: var(--color-gray-200); }
[data-theme="dark"] .home-action:hover { border-color: #5dcea0; box-shadow: 0 0 0 1px #5dcea0; }
[data-theme="dark"] .home-action:hover .home-action__arrow { color: #5dcea0; }

/* ── Tab rail: first tab flush-left ── */
.ht-tab:first-child { padding-left: 0.25rem; }

/* ---------- Small layout utilities used by the mockup views ---------- */
.u-stack  { display: flex; flex-direction: column; gap: var(--space-3); }
.u-row    { display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center; }
.u-grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--space-4); }
.u-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-4); }
.u-scroll-x { overflow-x: auto; }
.u-flex-1 { flex: 1; min-width: 0; }
.u-mb-2 { margin-bottom: var(--space-2); }
.u-pad-0 { padding: 0 !important; }
@media (max-width: 900px) { .u-grid-2 { grid-template-columns: 1fr; } }

/* ============================================================================
   GRANT DETAIL PAGE  (.gd-*)
   Color identity driven by --gc, injected inline as var(--ip-<key>).
   ============================================================================ */

/* ── Hero band ── */
.gd-hero {
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-top: 4px solid var(--gc, var(--color-primary));
  border-radius: var(--radius-xl);
  padding: 2.5rem 2.5rem 0;
  margin-bottom: 1.75rem;
  position: relative;
  overflow: hidden;
  color: var(--color-gray-900);
  box-shadow: var(--shadow-sm);
  animation: gd-hero-in 0.4s ease both;
}
@keyframes gd-hero-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* Legibility overlay */
.gd-hero::before {
  content: none;
}
/* Dot-grid texture */
.gd-hero::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 320px;
  background-image: radial-gradient(circle, rgba(37, 99, 235, 0.14) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,0.35), transparent 80%);
  mask-image: linear-gradient(to left, rgba(0,0,0,0.35), transparent 80%);
  pointer-events: none;
  border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
}

.gd-hero__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2.5rem;
  position: relative;
  z-index: 1;
}
.gd-hero__left { flex: 1; min-width: 0; }

/* Back link */
.gd-back {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: 'Syne', var(--font-family-base);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-gray-600);
  text-decoration: none;
  margin-bottom: 1rem;
  transition: color 0.2s ease;
}
.gd-back:hover { color: var(--color-primary); }
.gd-back svg { width: 13px; height: 13px; }

/* Grant name */
.gd-hero__name {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.05;
  color: var(--color-gray-900);
  letter-spacing: -0.03em;
  margin-bottom: 0.625rem;
}
.gd-hero__title {
  font-size: var(--font-size-sm);
  color: var(--color-gray-600);
  line-height: 1.45;
  margin-bottom: 0.5rem;
}
.gd-hero__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-family: 'Syne', var(--font-family-base);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-gray-500);
}
.gd-hero__sep {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--color-gray-300);
}

/* Right stat block */
.gd-hero__stats {
  display: flex;
  gap: 2rem;
  flex-shrink: 0;
  align-items: flex-start;
  padding-left: 2rem;
  border-left: 1px solid var(--color-gray-200);
  padding-top: 0.375rem;
}
.gd-hero__stat { text-align: right; }
.gd-hero__stat-val {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-gray-900);
  line-height: 1;
  letter-spacing: -0.03em;
}
.gd-hero__stat-label {
  font-family: 'Syne', var(--font-family-base);
  font-size: 0.57rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-gray-500);
  margin-top: 0.35rem;
  white-space: nowrap;
}

/* Action footer inside hero */
.gd-hero__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.625rem;
  padding: 1.25rem 0;
  margin-top: 1.75rem;
  border-top: 1px solid var(--color-gray-200);
  position: relative;
  z-index: 1;
}
.gd-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-seMBold);
  font-family: var(--font-family-base);
  cursor: pointer;
  text-decoration: none;
  border: 1px solid var(--color-gray-300);
  color: var(--color-primary);
  background: var(--color-white);
  transition: all 0.2s ease;
}
.gd-hero-btn:hover {
  background: #eff6ff;
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.gd-hero-btn--solid {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
}
.gd-hero-btn--solid:hover {
  background: #1d4ed8;
  color: var(--color-white);
}
.gd-hero-btn svg { width: 13px; height: 13px; }

@media (max-width: 800px) {
  .gd-hero__stats { display: none; }
  .gd-hero::after { width: 100px; }
}

/* ── Two-column layout ── */
.gd-layout {
  display: grid;
  grid-template-columns: 1fr 390px;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 1100px) { .gd-layout { grid-template-columns: 1fr 320px; } }
@media (max-width: 900px)  { .gd-layout { grid-template-columns: 1fr; } }

.gd-sticky {
  position: sticky;
  top: 1.5rem;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  scrollbar-width: thin;
}

/* ── Panels (activities + reports portal) ── */
.gd-panel {
  background: var(--surface-raised);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  animation: gd-panel-in 0.4s 0.12s ease both;
}
@keyframes gd-panel-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.gd-panel__head {
  padding: 1.125rem 1.5rem;
  border-bottom: 1px solid var(--surface-border);
  background: var(--surface-sunken);
}
.gd-panel__title {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-seMBold);
  color: var(--text-primary);
}
.gd-panel__sub {
  font-family: 'Syne', var(--font-family-base);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.2rem;
}
.gd-panel__body { padding: 0 1.5rem 1.25rem; }

/* ── Activity grouped list ── */
.gd-act-section {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 1.125rem 0 0.5rem;
  font-family: 'Syne', var(--font-family-base);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gc, var(--color-primary));
  border-top: 1.5px solid var(--gc, var(--color-primary));
  margin-top: 0.5rem;
}
.gd-act-section:first-child { border-top: none; padding-top: 1rem; margin-top: 0; }
.gd-act-section__dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--gc, var(--color-primary));
  flex-shrink: 0;
}

/* Activity item — horizontal two-column */
.gd-act-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--surface-border);
  align-items: baseline;
}
.gd-act-item:last-of-type { border-bottom: none; }
.gd-act-item__label {
  font-family: 'Syne', var(--font-family-base);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding-top: 0.1rem;
}
.gd-act-item__val {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  line-height: 1.5;
}
.gd-act-item__val--empty {
  color: var(--text-muted);
  font-style: italic;
}

/* ── Indicator list (reports portal) ── */
.gd-ind-list { list-style: none; padding: 0; margin: 0; }

.gd-ind-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--surface-border);
  text-decoration: none;
  color: inherit;
  transition: background var(--transition-fast);
}
.gd-ind-item:last-child { border-bottom: none; }
.gd-ind-item:hover { background: var(--overlay-hover); }

.gd-ind-code {
  font-family: 'Syne', var(--font-family-base);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  /* color-mix gives grant-color tint; fallback for older browsers */
  background: var(--color-primary-faint);
  background: color-mix(in srgb, var(--gc, var(--color-primary)) 12%, transparent);
  border: 1px solid var(--color-primary-faint);
  border: 1px solid color-mix(in srgb, var(--gc, var(--color-primary)) 25%, transparent);
  color: var(--gc, var(--color-primary));
  flex-shrink: 0;
  min-width: 46px;
  text-align: center;
  margin-top: 0.125rem;
}
.gd-ind-body { flex: 1; min-width: 0; }
.gd-ind-name {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-seMBold);
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gd-ind-target {
  font-family: 'Fraunces', Georgia, serif;
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--gc, var(--color-primary));
  margin-top: 0.2rem;
}
.gd-ind-target span {
  font-family: var(--font-family-base);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  font-style: normal;
}

.gd-section-label {
  font-family: 'Syne', var(--font-family-base);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.75rem 1.25rem 0.25rem;
  background: var(--surface-sunken);
  border-top: 1px solid var(--surface-border);
  border-bottom: 1px solid var(--surface-border);
}
.gd-section-label:first-child { border-top: none; }

.gd-placeholder {
  padding: 1.25rem 1.25rem;
  color: var(--text-muted);
  font-size: var(--font-size-xs);
}
.gd-placeholder a { color: var(--gc, var(--color-primary)); text-decoration: underline; }

[data-theme="dark"] .gd-panel { border-color: var(--color-gray-700); }
[data-theme="dark"] .gd-panel__head { background: var(--surface-sunken); }

/* Grant detail activity list */
.act-list { list-style: none; padding: 0; margin: 0; }
.act-list__item { padding: var(--space-3) 0; border-bottom: 1px solid var(--surface-border); }
.act-list__item:last-child { border-bottom: none; }
.act-list__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  font-weight: var(--font-weight-seMBold);
}
.act-list__val { font-size: var(--font-size-sm); color: var(--text-primary); margin-top: 2px; }
.act-list__val--muted { color: var(--text-muted); font-style: italic; }

/* Header theme toggle (sun/moon) — sits between the notification bell and date */
.dochub-theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--surface-sunken);
  border: none;
  color: var(--text-secondary);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.dochub-theme-toggle:hover { background: var(--overlay-hover); color: var(--text-primary); }
.dochub-theme-toggle[aria-pressed="true"] { color: var(--color-primary); }

/* Warning / advisory banner used above the Compliance Matrix */
.note {
  background: var(--color-warning-bg);
  border-left: 4px solid var(--color-warning);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  color: var(--color-warning-text);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.note code {
  background: rgba(0, 0, 0, 0.06);
  padding: 0 4px;
  border-radius: 3px;
  font-family: var(--font-family-mono);
  font-size: 0.85em;
}

/* "Back to X" link on page headers */
.ph__back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--font-size-sm);
  color: var(--color-primary);
  font-weight: var(--font-weight-seMBold);
  margin-bottom: var(--space-2);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}
.ph__back:hover { text-decoration: underline; }

/* ============================================================================
   MHF Submit form — Output card identity, Supp Doc pane, Save bar, TOC chips
   ============================================================================ */

.output-card                   { border-top: 4px solid var(--color-primary); }
.output-card--o1               { border-top-color: #2563eb; }
.output-card--o2               { border-top-color: #d97706; }
.output-card--o3               { border-top-color: #059669; }
.output-card--am               { border-top-color: #7c3aed; }
.output-card--loc              { border-top-color: #475569; }
.output-card--agg              { border-top-color: #0891b2; }
.output-card--disb             { border-top-color: #16a34a; }

.output-card__head             { display:flex; gap:.75rem; align-items:center; }
.output-card__icon             { width:36px; height:36px; flex:none; border-radius:8px;
                                 display:grid; place-items:center; font-weight:700; font-size:1rem; }
.output-card--o1 .output-card__icon { background:#dbeafe; color:#1e3a8a; }
.output-card--o2 .output-card__icon { background:#fef3c7; color:#92400e; }
.output-card--o3 .output-card__icon { background:#d1fae5; color:#065f46; }
.output-card--am .output-card__icon { background:#ede9fe; color:#5b21b6; }

.subsection-bar                { font-weight:600; padding:.55rem .9rem;
                                 background:var(--surface-sunken, #f9fafb);
                                 border-top:1px solid var(--surface-border, #e5e7eb);
                                 display:flex; gap:.5rem; align-items:center;
                                 font-size:.8rem; color:var(--text-secondary, #475569);
                                 text-transform:uppercase; letter-spacing:.04em; }

/* Supp Doc pane */
.mov-pane                      { background:var(--color-primary-faint, #eff6ff); padding:.9rem 1rem;
                                 border-top:1px dashed var(--color-primary, #0f62fe); }
.mov-pane__head                { display:flex; gap:.5rem; align-items:baseline; margin-bottom:.6rem; flex-wrap:wrap; }
.mov-pane__icon                { font-size:1rem; }
.mov-pane__hint                { color:var(--text-tertiary, #64748b); font-size:.8rem; }
.mov-uploader                  { display:flex; gap:.5rem; flex-wrap:wrap; align-items:center; }
.mov-uploader__kind            { min-width:240px; }
.mov-uploader__file            { font-size:.85rem; }
.mov-uploader__status          { font-size:.85rem; min-height:1em; }
.mov-uploader__status--ok      { color:var(--color-success, #059669); font-weight:500; }
.mov-uploader__status--err     { color:var(--color-error, #dc2626); font-weight:500; }

.mov-list                      { list-style:none; padding:0; margin:.5rem 0 0;
                                 display:flex; flex-direction:column; gap:.25rem; }
.mov-list__item                { display:flex; gap:.5rem; align-items:center; padding:.45rem .65rem;
                                 background:var(--surface-raised, white);
                                 border:1px solid var(--surface-border, #e5e7eb); border-radius:6px; font-size:.85rem; }
.mov-list__kind                { font-size:.7rem; font-weight:600; color:var(--color-primary, #0f62fe);
                                 background:var(--color-primary-faint, #eff6ff); padding:.15rem .55rem;
                                 border-radius:10px; white-space:nowrap; }
.mov-list__name                { flex:1; color:var(--text-primary, #0f172a); text-decoration:none; }
.mov-list__name:hover          { text-decoration:underline; }

/* Per-section Save & refresh totals */
.section-save-bar              { display:flex; gap:.75rem; align-items:center; padding:.6rem 1rem;
                                 background:var(--surface-sunken, #f9fafb);
                                 border-top:1px solid var(--surface-border, #e5e7eb); }
.section-save-bar__status      { font-size:.85rem; font-weight:500; }
.section-save-bar__status--ok  { color:var(--color-success, #059669); }
.section-save-bar__status--err { color:var(--color-error, #dc2626); }

/* Cleaner Totals */
.dochub-card__body.u-pad-0,
.dochub-surface > .u-pad-0      { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl                            { width: 100%; min-width: 760px; border-collapse: collapse; }
.tbl th,
.tbl td                         { padding: var(--space-3); border-bottom: 1px solid var(--surface-border, #e5e7eb); vertical-align: middle; }
.tbl td.num                    { font-variant-numeric: tabular-nums; }
.tbl td.row-total              { font-weight:600; color:var(--color-primary, #0f62fe);
                                 background:var(--color-primary-faint, #eff6ff); }

/* Top-of-form Table-of-Contents chips */
.form-toc                      { display:flex; gap:.4rem; flex-wrap:wrap;
                                 padding:.7rem 1rem; margin-bottom:1rem;
                                 background:var(--surface-sunken, #f9fafb);
                                 border:1px solid var(--surface-border, #e5e7eb); border-radius:8px;
                                 position:sticky; top:8px; z-index:5; backdrop-filter: saturate(160%) blur(4px); }
.form-toc__chip                { padding:.3rem .7rem; background:var(--surface-raised, white);
                                 border:1px solid var(--surface-border, #e5e7eb); border-radius:14px;
                                 font-size:.78rem; font-weight:600; text-decoration:none;
                                 color:var(--text-secondary, #475569); }
.form-toc__chip:hover          { color:var(--color-primary, #0f62fe); border-color:var(--color-primary, #0f62fe); }
.form-toc__chip--o1            { border-left:3px solid #2563eb; }
.form-toc__chip--o2            { border-left:3px solid #d97706; }
.form-toc__chip--o3            { border-left:3px solid #059669; }
.form-toc__chip--am            { border-left:3px solid #7c3aed; }


/* === Narrative + Finance section headings (between quantitative block and form bottom) === */
.report-section-heading        { margin: 2rem 0 1rem; padding: .9rem 1.2rem; border-radius: 12px;
                                 display: flex; flex-direction: column; gap: .25rem;
                                 font-size: 1.4rem; font-weight: 700; letter-spacing: -.01em;
                                 border-left: 6px solid var(--color-primary, #0f62fe);
                                 background: var(--surface-sunken, #f9fafb); }
.report-section-heading--finance   { border-left-color: #16a34a; background: #f0fdf4; color: #14532d; }
.report-section-heading--narrative { border-left-color: #6366f1; background: #eef2ff; color: #312e81; }
.report-section-heading__hint  { font-size: .85rem; font-weight: 400; color: var(--text-secondary, #475569);
                                 text-transform: none; letter-spacing: 0; }

/* Per-Output narrative box sits between the indicator table and the Supp Doc pane. */
.output-narrative              { padding: 1rem 1.25rem; background: #fafbfc;
                                 border-top: 1px solid var(--surface-border, #e5e7eb); }
.output-narrative textarea     { min-height: 6rem; }

/* TOC chip variants for the two new headings. */
.form-toc__chip--finance       { border-left: 3px solid #16a34a; background: #dcfce7; color: #14532d; }
.form-toc__chip--narrative     { border-left: 3px solid #6366f1; background: #e0e7ff; color: #312e81; }

/* Native <details>/<summary> styled as a card. */
details.dochub-card > summary  { list-style: none; cursor: pointer; display: flex; align-items: center; }
details.dochub-card > summary::-webkit-details-marker { display: none; }
details.dochub-card > summary::after { content: "▸"; margin-left: auto; transition: transform .15s; }
details.dochub-card[open] > summary::after { transform: rotate(90deg); }

/* === Floating top header for fast section navigation ===
   It stays in normal flow until its slot reaches the application header. */
.report-form-shell { position: relative; }
.report-form-main  { min-width: 0; }
.report-form-shell [id] { scroll-margin-top: 148px; }
.form-topbar-slot { position: relative; min-width: 0; margin-bottom: 1rem; }

.form-topbar       { position: relative; z-index: 1; width: 100%;
                     display: flex; gap: .35rem; flex-wrap: wrap; align-items: center;
                     padding: .5rem .75rem;
                     background: rgba(255, 255, 255, .96);
                     border: 1px solid var(--surface-border, #e5e7eb);
                     border-radius: 999px;
                     box-shadow: 0 8px 24px rgba(15, 23, 42, .12), 0 1px 2px rgba(15, 23, 42, .06);
                     backdrop-filter: saturate(180%) blur(8px);
                     -webkit-backdrop-filter: saturate(180%) blur(8px);
                     font-size: .82rem; overflow-x: auto; }
.form-topbar--floating { position: fixed; top: 76px; left: 50%; transform: translateX(-50%);
                         z-index: 9999; width: max-content; max-width: calc(100vw - 24px); }
.form-topbar__label{ font-size: .68rem; font-weight: 700; letter-spacing: .08em;
                     color: var(--text-tertiary, #94a3b8); text-transform: uppercase;
                     padding: 0 .35rem 0 .25rem; flex: none; }
.form-topbar__link { display: inline-flex; align-items: center; padding: .35rem .7rem;
                     border-radius: 999px;
                     color: var(--text-secondary, #475569); text-decoration: none;
                     background: transparent; border: 1px solid transparent;
                     transition: background .15s, border-color .15s, color .15s;
                     white-space: nowrap; flex: none; font-weight: 500; }
.form-topbar__link:hover  { background: var(--surface-sunken, #f9fafb); color: var(--color-primary, #0f62fe); }
.form-topbar__link--active{ background: var(--surface-sunken, #f9fafb); color: var(--color-primary, #0f62fe); font-weight: 700; border-color: var(--color-primary, #0f62fe); }
.form-topbar__link--o1.form-topbar__link--active { background: #dbeafe; color: #1e3a8a; border-color: #2563eb; }
.form-topbar__link--o2.form-topbar__link--active { background: #fef3c7; color: #92400e; border-color: #d97706; }
.form-topbar__link--o3.form-topbar__link--active { background: #d1fae5; color: #065f46; border-color: #059669; }
.form-topbar__link--am.form-topbar__link--active { background: #ede9fe; color: #5b21b6; border-color: #7c3aed; }
.form-topbar__link--narrative.form-topbar__link--active { background: #e0e7ff; color: #312e81; border-color: #6366f1; }
.form-topbar__link--finance.form-topbar__link--active   { background: #dcfce7; color: #14532d; border-color: #16a34a; }

@media (max-width: 768px) {
    .form-topbar { border-radius: 14px; flex-wrap: nowrap; overflow-x: auto; }
    .form-topbar--floating { top: 66px; left: 8px; right: 8px; transform: none; width: auto; max-width: calc(100vw - 16px); }
}

/* === Per-location collapse === */
.loc-card                { padding: .75rem 0 0; border-top: 1px solid var(--surface-border, #e5e7eb); }
.loc-card:first-of-type  { border-top: 0; }
.loc-card:not(.loc-card--active) { display: none; }
.loc-card__save          { padding: .5rem 1rem; }
.loc-add-row             { padding: .9rem 1rem; display: flex; justify-content: center;
                           background: var(--surface-sunken, #f9fafb);
                           border-top: 1px dashed var(--surface-border, #e5e7eb); }

/* IP user dashboard */
.ip-dashboard { display: grid; gap: 1rem; }
.ip-dashboard__header { display:flex; justify-content:space-between; align-items:end; gap:1.5rem; flex-wrap:wrap; }
.ip-dashboard__grant-filter { min-width:min(100%, 360px); display:grid; gap:.35rem; }
.ip-dashboard__grant-filter label,
.ip-filter-grid label,
.ip-document-replace label { font-size:.78rem; font-weight:700; color:var(--text-secondary, #475569); }
.ip-dashboard__tabs { display:flex; gap:.25rem; border-bottom:1px solid var(--surface-border, #dbe3ef); overflow-x:auto; }
.ip-dashboard__tab { padding:.8rem 1.1rem; color:var(--text-secondary, #475569); text-decoration:none; border-bottom:3px solid transparent; font-weight:650; white-space:nowrap; }
.ip-dashboard__tab:hover,
.ip-dashboard__tab.is-active { color:var(--color-primary, #0f62fe); border-bottom-color:var(--color-primary, #0f62fe); }
.ip-dashboard__empty { text-align:center; padding:3rem 1rem; }
.ip-dashboard__empty h2 { margin-top:0; }
.ip-dashboard__grant-summary { display:grid; grid-template-columns:minmax(220px, 1.4fr) repeat(4, minmax(130px, 1fr)); gap:1px; overflow:hidden; background:var(--surface-border, #dbe3ef); border:1px solid var(--surface-border, #dbe3ef); border-radius:12px; }
.ip-dashboard__grant-summary > div { display:flex; flex-direction:column; gap:.2rem; padding:1rem; background:#fff; }
.ip-dashboard__grant-summary span { font-size:.78rem; color:var(--text-secondary, #64748b); }
.ip-dashboard__grant-summary strong { color:var(--text-primary, #0f172a); }
.ip-dashboard__eyebrow { text-transform:uppercase; letter-spacing:.08em; font-weight:700; }
.ip-dashboard__metrics { display:grid; grid-template-columns:repeat(5, minmax(135px, 1fr)); gap:.75rem; }
.ip-dashboard__grant-selector-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.ip-dashboard__grant-selector {
    flex: 1;
}

.ip-dashboard__grant-selector-row .dochub-btn {
    flex-shrink: 0;
    margin-bottom: 0;
}
.ip-metric { display:flex; min-height:92px; flex-direction:column; justify-content:space-between; padding:1rem; background:#fff; border:1px solid var(--surface-border, #dbe3ef); border-radius:12px; text-decoration:none; color:inherit; }
.ip-metric span { color:var(--text-secondary, #64748b); font-size:.82rem; }
.ip-metric strong { font-size:1.75rem; line-height:1; }
.ip-metric.is-overdue strong { color:#b91c1c; }
.ip-metric.is-due strong,
.ip-metric.is-progress strong { color:#b45309; }
.ip-metric.is-submitted strong { color:#1d4ed8; }
.ip-metric.is-approved strong { color:#047857; }
.ip-dashboard__overview-grid { display:grid; grid-template-columns:minmax(0, 2fr) minmax(280px, .8fr); gap:1rem; align-items:start; }
.ip-dashboard__side { display:grid; gap:1rem; }
.ip-dashboard__section-note { margin:.25rem 0 0; color:var(--text-secondary, #64748b); font-size:.82rem; }
.ip-dashboard__empty-copy,
.ip-dashboard__muted { color:var(--text-secondary, #64748b); }
.ip-dashboard__blocked-action { display:grid; gap:.15rem; min-width:190px; color:var(--text-secondary, #64748b); }
.ip-dashboard__blocked-action strong { color:var(--text-primary, #334155); font-size:.78rem; }
.ip-dashboard__blocked-action small { line-height:1.3; }
.ip-timeline__legend { display:flex; flex-wrap:wrap; gap:.5rem 1rem; margin-bottom:1rem; }
.ip-timeline__legend span { display:inline-flex; align-items:center; gap:.35rem; font-size:.78rem; color:var(--text-secondary, #475569); }
.ip-timeline__legend span::before { content:""; width:.7rem; height:.7rem; border-radius:50%; background:#94a3b8; }
.ip-timeline__legend .is-approved::before { background:#059669; }
.ip-timeline__legend .is-submitted::before { background:#2563eb; }
.ip-timeline__legend .is-progress::before { background:#d97706; }
.ip-timeline__legend .is-overdue::before { background:#dc2626; }
.ip-timeline { display:grid; gap:1rem; }
.ip-timeline__row { display:grid; grid-template-columns:minmax(150px, 220px) minmax(0, 1fr); gap:1rem; align-items:start; padding-bottom:1rem; border-bottom:1px solid var(--surface-border, #e5e7eb); }
.ip-timeline__row:last-child { border-bottom:0; padding-bottom:0; }
.ip-timeline__row h3 { margin:.4rem 0; font-size:.95rem; }
.ip-timeline__periods { display:flex; gap:.5rem; padding-bottom:.25rem; overflow-x:auto; }
.ip-timeline__period { display:flex; flex:0 0 150px; flex-direction:column; gap:.2rem; min-height:58px; padding:.55rem .65rem; color:#334155; text-decoration:none; border:1px solid #cbd5e1; border-top:4px solid #94a3b8; border-radius:8px; background:#f8fafc; }
.ip-timeline__period span { font-size:.78rem; font-weight:700; }
.ip-timeline__period small { font-size:.7rem; line-height:1.25; color:#64748b; }
.ip-timeline__period.is-approved { border-top-color:#059669; background:#ecfdf5; }
.ip-timeline__period.is-submitted { border-top-color:#2563eb; background:#eff6ff; }
.ip-timeline__period.is-progress { border-top-color:#d97706; background:#fffbeb; }
.ip-timeline__period.is-overdue { border-top-color:#dc2626; background:#fef2f2; }
.ip-task-list,
.ip-notification-list { list-style:none; margin:0; padding:0; display:grid; gap:.65rem; }
.ip-task-list li,
.ip-notification-list li { border:1px solid var(--surface-border, #e2e8f0); border-radius:8px; }
.ip-task-list a,
.ip-notification-list a { display:flex; flex-direction:column; gap:.2rem; padding:.7rem .8rem; color:inherit; text-decoration:none; }
.ip-task-list span,
.ip-notification-list span { color:var(--text-secondary, #475569); font-size:.8rem; }
.ip-task-list small,
.ip-notification-list small { color:#64748b; font-size:.72rem; }
.ip-notification-list li.is-unread { border-left:4px solid #2563eb; background:#eff6ff; }
.ip-dashboard__filter-card .dochub-card__body { padding:1rem; }

/* ============================================================================
   APPLICATION SHELL
   Fixed IOM-blue navigation and compact account header.
   ============================================================================ */
:root {
  --shell-sidebar-width: 232px;
  --shell-sidebar-collapsed-width: 72px;
  --shell-sidebar-start: #003b9b;
  --shell-sidebar-end: #0057c8;
  --shell-sidebar-text: #f8fbff;
  --shell-sidebar-muted: #c8dcff;
  --shell-header-height: 68px;
}

.dochub-sidebar {
  width: var(--shell-sidebar-width);
  background: linear-gradient(165deg, var(--shell-sidebar-start) 0%, var(--shell-sidebar-end) 100%);
  border-right: 0;
  color: var(--shell-sidebar-text);
  box-shadow: 8px 0 24px rgb(0 35 110 / 0.08);
  transition:
    width var(--transition-base),
    transform var(--transition-base);
}

.dochub-main {
  margin-left: var(--shell-sidebar-width);
  transition: margin-left var(--transition-base);
}

.dochub-sidebar__header {
  min-height: var(--shell-header-height);
  display: flex;
  align-items: center;
  padding: 12px 22px;
  border-bottom: 1px solid rgb(255 255 255 / 0.16);
}

.dochub-sidebar__brand {
  min-width: 0;
  color: var(--shell-sidebar-text);
  gap: 10px;
  text-decoration: none;
}

.dochub-sidebar__brand:hover {
  color: var(--color-white);
  text-decoration: none;
}

.dochub-sidebar__logo-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  color: var(--color-white);
  background: transparent;
  border: 1.5px solid rgb(255 255 255 / 0.9);
  border-radius: 50%;
  font-size: 27px;
}

.dochub-sidebar__logo-text {
  gap: 1px;
}

.dochub-sidebar__logo-title {
  color: var(--color-white);
  font-size: 1.8rem;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.04em;
  line-height: 1;
}

.dochub-sidebar__logo-subtitle {
  color: var(--shell-sidebar-text);
  font-size: 0.63rem;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.17em;
}

.dochub-sidebar__nav {
  padding: 18px 12px;
  scrollbar-color: rgb(255 255 255 / 0.36) transparent;
  scrollbar-width: thin;
}

.nav-section {
  margin: 0;
}

.nav-section + .nav-section {
  margin-top: 4px;
}

.nav-section__title {
  display: none;
}

.nav-list {
  margin: 0;
  padding: 0;
}

.nav-item {
  margin: 3px 0;
  border-radius: 8px;
  overflow: visible;
  background: transparent;
}

.nav-link {
  min-height: 44px;
  gap: 12px;
  padding: 10px 12px;
  color: var(--shell-sidebar-text);
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.25;
}

.nav-link:hover,
.nav-item--active > .nav-link:hover {
  color: var(--color-white);
  background: rgb(255 255 255 / 0.13);
}

.nav-item--active,
.nav-item--active > .nav-link {
  color: var(--color-white);
  background: rgb(30 119 255 / 0.72);
}

.nav-item--active > .nav-link {
  font-weight: var(--font-weight-seMBold);
}

.nav-icon,
.nav-link:hover .nav-icon,
.nav-item--active .nav-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  color: currentColor;
  font-size: 18px;
}

.nav-text {
  min-width: 0;
}

.nav-chevron {
  width: 18px;
  height: 18px;
  color: var(--shell-sidebar-muted);
  font-size: 14px;
}

.nav-submenu {
  display: none;
  padding: 4px 0 6px;
  background: transparent;
}

.nav-item--expanded > .nav-submenu {
  display: block;
}

.nav-submenu__item--active::before {
  display: none;
}

.nav-submenu__link {
  min-height: 38px;
  padding: 9px 12px 9px 46px;
  color: var(--shell-sidebar-muted);
  border-radius: 7px;
  font-size: 0.82rem;
}

.nav-submenu__link:hover,
.nav-submenu__item--active .nav-submenu__link {
  color: var(--color-white);
  background: rgb(255 255 255 / 0.1);
  text-decoration: none;
}

.nav-submenu__item--active .nav-submenu__link {
  font-weight: var(--font-weight-seMBold);
}

.dochub-sidebar__footer {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 64px;
  margin: 0 22px;
  padding: 16px 0;
  color: var(--shell-sidebar-muted);
  border-top: 1px solid rgb(255 255 255 / 0.2);
  font-size: var(--font-size-xs);
  white-space: nowrap;
}

.dochub-sidebar__powered-brand {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-white);
  font-weight: var(--font-weight-seMBold);
  font-size: var(--font-size-sm);
}

.dochub-header {
  height: var(--shell-header-height);
  padding: 0 26px;
  background: var(--surface-raised);
  border-bottom-color: var(--surface-border);
  box-shadow: 0 1px 8px rgb(15 23 42 / 0.05);
}

.dochub-sidebar__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  color: var(--color-primary-dark);
  background: transparent;
  border: 0;
  border-radius: 8px;
}

.dochub-sidebar__toggle:hover {
  color: var(--color-primary);
  background: var(--color-primary-faint);
  border-color: transparent;
}

.hamburger-icon {
  display: inline-flex;
  font-size: 24px;
}

.dochub-header__left {
  gap: 14px;
}

.dochub-header__product {
  color: #003b9b;
  font-size: 1.3rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.dochub-header__product:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.dochub-header__product-short {
  display: none;
}

.dochub-header__divider {
  width: 1px;
  height: 24px;
  background: var(--surface-border);
}

.dochub-header__title {
  max-width: min(36vw, 520px);
  overflow: hidden;
  color: var(--text-tertiary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dochub-header__right {
  gap: 10px;
}

.dochub-notification-menu__toggle,
.dochub-theme-toggle {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  color: #003b9b;
  background: transparent;
  border: 0;
  border-radius: 50%;
}

.dochub-notification-menu__toggle:hover,
.dochub-notification-menu__toggle[aria-expanded="true"],
.dochub-theme-toggle:hover {
  color: var(--color-primary);
  background: var(--color-primary-faint);
  border-color: transparent;
}

.dochub-notification-menu__icon {
  display: inline-flex;
  font-size: 20px;
}

.dochub-notification-menu__badge {
  top: 1px;
  right: 0;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border: 2px solid var(--surface-raised);
  font-size: 0.62rem;
}

.dochub-user-menu {
  position: relative;
}

.dochub-user-menu__toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 5px 8px;
  color: var(--text-primary);
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
}

.dochub-user-menu__toggle:hover,
.dochub-user-menu__toggle[aria-expanded="true"] {
  background: var(--overlay-hover);
}

.dochub-user-menu__avatar {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
  color: var(--color-white);
  background: #003b9b;
  border-radius: 50%;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-seMBold);
}

.dochub-user-menu__identity {
  display: flex;
  flex-direction: column;
  min-width: 110px;
  max-width: 210px;
}

.dochub-user-menu__name,
.dochub-user-menu__role {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dochub-user-menu__name {
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-seMBold);
}

.dochub-user-menu__role {
  color: var(--text-tertiary);
  font-size: var(--font-size-xs);
}

.dochub-user-menu__chevron {
  color: var(--text-tertiary);
  font-size: 16px;
  transition: transform var(--transition-fast);
}

.dochub-user-menu__toggle[aria-expanded="true"] .dochub-user-menu__chevron {
  transform: rotate(180deg);
}

.dochub-user-menu__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 250px;
  padding: 8px;
  background: var(--surface-raised);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  z-index: calc(var(--z-dropdown) + 2);
}

.dochub-user-menu__panel[hidden] {
  display: none;
}

.dochub-user-menu__roles {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0 4px 6px;
  padding: 8px;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--surface-border);
  font-size: var(--font-size-xs);
}

.dochub-user-menu__roles-summary {
  color: var(--text-secondary);
  font-weight: var(--font-weight-medium);
  overflow-wrap: anywhere;
}

.dochub-user-menu__panel form {
  margin: 0;
}

.dochub-user-menu__action {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  color: var(--text-secondary);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font: inherit;
  font-size: var(--font-size-sm);
  text-align: left;
}

.dochub-user-menu__action:hover {
  color: var(--color-primary);
  background: var(--color-primary-faint);
  text-decoration: none;
}

body.dochub-sidebar-collapsed .dochub-sidebar {
  width: var(--shell-sidebar-collapsed-width);
}

body.dochub-sidebar-collapsed .dochub-main {
  margin-left: var(--shell-sidebar-collapsed-width);
}

body.dochub-sidebar-collapsed .dochub-sidebar__header {
  justify-content: center;
  padding-inline: 12px;
}

body.dochub-sidebar-collapsed .dochub-sidebar__logo-text,
body.dochub-sidebar-collapsed .nav-text,
body.dochub-sidebar-collapsed .nav-chevron,
body.dochub-sidebar-collapsed .nav-submenu,
body.dochub-sidebar-collapsed .dochub-sidebar__powered {
  display: none;
}

body.dochub-sidebar-collapsed .dochub-sidebar__brand {
  gap: 0;
}

body.dochub-sidebar-collapsed .dochub-sidebar__nav {
  padding-inline: 10px;
  overflow: visible;
}

body.dochub-sidebar-collapsed .nav-link {
  justify-content: center;
  padding-inline: 9px;
}

body.dochub-sidebar-collapsed .dochub-sidebar__footer {
  justify-content: center;
  margin-inline: 12px;
}

body.dochub-sidebar-collapsed .nav-item--expanded > .nav-submenu {
  position: absolute;
  top: 0;
  left: calc(100% + 10px);
  z-index: calc(var(--z-dropdown) + 3);
  display: block;
  width: 224px;
  padding: 8px;
  background: var(--shell-sidebar-start);
  border: 1px solid rgb(255 255 255 / 0.18);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
}

body.dochub-sidebar-collapsed .nav-submenu__link {
  padding: 9px 12px;
}

.reports-workspace-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  overflow-x: auto;
  background: var(--surface-muted);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
}

.reports-workspace-tabs__link {
  flex: 0 0 auto;
  padding: 9px 14px;
  color: var(--text-secondary);
  border-radius: 7px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-seMBold);
  text-decoration: none;
}

.reports-workspace-tabs__link:hover,
.reports-workspace-tabs__link--active {
  color: var(--color-primary-dark);
  background: var(--surface-raised);
  text-decoration: none;
}

.reports-workspace-tabs__link--active {
  box-shadow: 0 1px 3px rgb(15 23 42 / 0.1);
}

@media (max-width: 1100px) {
  .dochub-main,
  body.dochub-sidebar-collapsed .dochub-main {
    margin-left: 0;
  }

  .dochub-sidebar,
  body.dochub-sidebar-collapsed .dochub-sidebar {
    width: min(var(--shell-sidebar-width), 88vw);
  }

  body.dochub-sidebar-collapsed .dochub-sidebar__header {
    justify-content: flex-start;
    padding: 12px 22px;
  }

  body.dochub-sidebar-collapsed .dochub-sidebar__logo-text,
  body.dochub-sidebar-collapsed .nav-text,
  body.dochub-sidebar-collapsed .nav-chevron,
  body.dochub-sidebar-collapsed .dochub-sidebar__powered {
    display: initial;
  }

  body.dochub-sidebar-collapsed .nav-submenu {
    display: none;
  }

  body.dochub-sidebar-collapsed .nav-item--expanded > .nav-submenu {
    display: block;
  }

  body.dochub-sidebar-collapsed .dochub-sidebar__brand {
    gap: 10px;
  }

  body.dochub-sidebar-collapsed .dochub-sidebar__nav {
    padding: 18px 12px;
    overflow-x: visible;
  }

  body.dochub-sidebar-collapsed .nav-link {
    justify-content: flex-start;
    padding-inline: 12px;
  }

  body.dochub-sidebar-collapsed .dochub-sidebar__footer {
    justify-content: flex-start;
    margin: 0 22px;
  }

  .dochub-header__product-full {
    display: none;
  }

  .dochub-header__product-short {
    display: inline;
  }
}

@media (max-width: 760px) {
  .dochub-header {
    padding: 0 12px;
  }

  .dochub-header__left {
    gap: 8px;
  }

  .dochub-header__divider,
  .dochub-header__title {
    display: none;
  }

  .dochub-header__product {
    font-size: 1.1rem;
  }

  .dochub-header__product-full {
    display: none;
  }

  .dochub-header__product-short {
    display: inline;
  }

  .dochub-header__right {
    gap: 2px;
  }

  .dochub-user-menu__identity {
    display: none;
  }

  .dochub-user-menu__toggle {
    gap: 4px;
    padding-inline: 4px;
  }

  .dochub-user-menu__chevron {
    display: none;
  }
}

@media (max-width: 430px) {
  .dochub-theme-toggle {
    display: none;
  }

  .dochub-header__product {
    max-width: none;
  }
}
.ip-filter-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)); gap:.75rem; align-items:end; }
.ip-filter-grid > div { display:grid; gap:.3rem; }
.ip-filter-grid__actions { display:flex !important; flex-direction:row; gap:.5rem !important; }
.ip-table-wrap { overflow-x:auto; }
.ip-dashboard__table { min-width:900px; }
.ip-dashboard__table td { vertical-align:top; }
.ip-dashboard__table td > small,
.ip-dashboard__table td > strong + small { display:block; margin-top:.2rem; color:#64748b; font-size:.72rem; }
.ip-dashboard__row-actions { display:flex; flex-wrap:wrap; gap:.35rem; }
.ip-dashboard__row-actions form { margin:0; }
.ip-status { display:inline-flex; padding:.25rem .55rem; border-radius:999px; background:#f1f5f9; color:#475569; font-size:.72rem; font-weight:700; white-space:nowrap; }
.ip-status--approved,
.ip-status--passed { background:#dcfce7; color:#166534; }
.ip-status--submitted,
.ip-status--resubmitted,
.ip-status--under-review { background:#dbeafe; color:#1e40af; }
.ip-status--draft,
.ip-status--revision-requested,
.ip-status--pending { background:#fef3c7; color:#92400e; }
.ip-status--overdue,
.ip-status--failed,
.ip-status--error,
.ip-status--rejected { background:#fee2e2; color:#991b1b; }
.ip-pagination { display:flex; justify-content:center; align-items:center; gap:1rem; padding:1rem; border-top:1px solid var(--surface-border, #e2e8f0); }
.ip-pagination .is-disabled { pointer-events:none; opacity:.45; }
.ip-dashboard__back { display:inline-block; margin-bottom:.45rem; text-decoration:none; }
.ip-document-details { display:grid; grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)); gap:1px; margin:0; background:var(--surface-border, #e2e8f0); border:1px solid var(--surface-border, #e2e8f0); border-radius:10px; overflow:hidden; }
.ip-document-details > div { padding:1rem; background:#fff; }
.ip-document-details dt { font-size:.75rem; font-weight:700; color:#64748b; }
.ip-document-details dd { margin:.3rem 0 0; overflow-wrap:anywhere; }
.ip-document-actions { display:flex; align-items:end; flex-wrap:wrap; gap:.75rem; margin-top:1rem; }
.ip-document-actions form { margin:0; }
.ip-document-replace { display:grid; grid-template-columns:minmax(180px, 280px) auto; gap:.35rem .5rem; align-items:end; }
.ip-document-replace label { grid-column:1 / -1; }

@media (max-width: 1050px) {
    .ip-dashboard__grant-summary { grid-template-columns:repeat(2, minmax(180px, 1fr)); }
    .ip-dashboard__metrics { grid-template-columns:repeat(3, minmax(135px, 1fr)); }
    .ip-dashboard__overview-grid { grid-template-columns:1fr; }
}

@media (max-width: 700px) {
    .ip-dashboard__header { align-items:stretch; }
    .ip-dashboard__grant-filter { min-width:100%; }
    .ip-dashboard__grant-summary,
    .ip-dashboard__metrics { grid-template-columns:1fr 1fr; }
    .ip-timeline__row { grid-template-columns:1fr; }
    .ip-document-replace { grid-template-columns:1fr; width:100%; }
}

@media (max-width: 460px) {
    .ip-dashboard__grant-summary,
    .ip-dashboard__metrics { grid-template-columns:1fr; }
}

/* Document security status */
.document-security-upload-note {
    margin: .45rem 0 0;
    color: var(--text-secondary, #475569);
    font-size: .82rem;
    line-height: 1.4;
}

.document-security-status {
    display: inline-flex;
    align-items: flex-start;
    gap: .4rem;
    max-width: 36rem;
    padding: .3rem .55rem;
    border: 1px solid transparent;
    border-radius: .5rem;
    font-size: .78rem;
    font-weight: 650;
    line-height: 1.35;
}

.document-security-status__icon {
    flex: 0 0 auto;
    font-weight: 800;
}

.document-security-status--pending,
.document-security-status--legacy-unverified {
    border-color: #f59e0b;
    background: #fffbeb;
    color: #92400e;
}

.document-security-status--passed {
    border-color: #22c55e;
    background: #f0fdf4;
    color: #166534;
}

.document-security-status--failed,
.document-security-status--error {
    border-color: #ef4444;
    background: #fef2f2;
    color: #991b1b;
}

.document-security-action-blocker {
    align-self: center;
    color: #92400e;
    font-size: .78rem;
    line-height: 1.35;
}

/* ME user dashboard */
.me-dashboard { display: grid; gap: 1rem; }
.me-dashboard__header { display:flex; justify-content:space-between; align-items:end; gap:1.5rem; flex-wrap:wrap; }
.me-dashboard__grant-filter { min-width:min(100%, 360px); display:grid; gap:.35rem; }
.me-dashboard__grant-filter label,
.me-filter-grid label,
.me-document-replace label { font-size:.78rem; font-weight:700; color:var(--text-secondary, #475569); }
.me-dashboard__tabs { display:flex; gap:.25rem; border-bottom:1px solid var(--surface-border, #dbe3ef); overflow-x:auto; }
.me-dashboard__tab { padding:.8rem 1.1rem; color:var(--text-secondary, #475569); text-decoration:none; border-bottom:3px solid transparent; font-weight:650; white-space:nowrap; }
.me-dashboard__tab:hover,
.me-dashboard__tab.is-active { color:var(--color-primary, #0f62fe); border-bottom-color:var(--color-primary, #0f62fe); }
.me-dashboard__empty { text-align:center; padding:3rem 1rem; }
.me-dashboard__empty h2 { margin-top:0; }
.me-dashboard__grant-summary { display:grid; grid-template-columns:minmax(220px, 1.4fr) repeat(4, minmax(130px, 1fr)); gap:1px; overflow:hidden; background:var(--surface-border, #dbe3ef); border:1px solid var(--surface-border, #dbe3ef); border-radius:12px; }
.me-dashboard__grant-summary > div { display:flex; flex-direction:column; gap:.2rem; padding:1rem; background:#fff; }
.me-dashboard__grant-summary span { font-size:.78rem; color:var(--text-secondary, #64748b); }
.me-dashboard__grant-summary strong { color:var(--text-primary, #0f172a); }
.me-dashboard__eyebrow { text-transform:uppercase; letter-spacing:.08em; font-weight:700; }
.me-dashboard__metrics { display:grid; grid-template-columns:repeat(5, minmax(135px, 1fr)); gap:.75rem; }
.me-metric { display:flex; min-height:92px; flex-direction:column; justify-content:space-between; padding:1rem; background:#fff; border:1px solid var(--surface-border, #dbe3ef); border-radius:12px; text-decoration:none; color:inherit; }
.me-metric span { color:var(--text-secondary, #64748b); font-size:.82rem; }
.me-metric strong { font-size:1.75rem; line-height:1; }
.me-metric.is-overdue strong { color:#b91c1c; }
.me-metric.is-due strong,
.me-metric.is-progress strong { color:#b45309; }
.me-metric.is-submitted strong { color:#1d4ed8; }
.me-metric.is-approved strong { color:#047857; }
.me-dashboard__overview-grid { display:grid; grid-template-columns:minmax(0, 2fr) minmax(280px, .8fr); gap:1rem; align-items:start; }
.me-dashboard__side { display:grid; gap:1rem; }
.me-dashboard__section-note { margin:.25rem 0 0; color:var(--text-secondary, #64748b); font-size:.82rem; }
.me-dashboard__empty-copy,
.me-dashboard__muted { color:var(--text-secondary, #64748b); }
.me-timeline__legend { display:flex; flex-wrap:wrap; gap:.5rem 1rem; margin-bottom:1rem; }
.me-timeline__legend span { display:inline-flex; align-items:center; gap:.35rem; font-size:.78rem; color:var(--text-secondary, #475569); }
.me-timeline__legend span::before { content:""; width:.7rem; height:.7rem; border-radius:50%; background:#94a3b8; }
.me-timeline__legend .is-approved::before { background:#059669; }
.me-timeline__legend .is-submitted::before { background:#2563eb; }
.me-timeline__legend .is-progress::before { background:#d97706; }
.me-timeline__legend .is-overdue::before { background:#dc2626; }
.me-timeline { display:grid; gap:1rem; }
.me-timeline__row { display:grid; grid-template-columns:minmax(150px, 220px) minmax(0, 1fr); gap:1rem; align-items:start; padding-bottom:1rem; border-bottom:1px solid var(--surface-border, #e5e7eb); }
.me-timeline__row:last-child { border-bottom:0; padding-bottom:0; }
.me-timeline__row h3 { margin:.4rem 0; font-size:.95rem; }
.me-timeline__periods { display:flex; gap:.5rem; padding-bottom:.25rem; overflow-x:auto; }
.me-timeline__period { display:flex; flex:0 0 150px; flex-direction:column; gap:.2rem; min-height:58px; padding:.55rem .65rem; color:#334155; text-decoration:none; border:1px solid #cbd5e1; border-top:4px solid #94a3b8; border-radius:8px; background:#f8fafc; }
.me-timeline__period span { font-size:.78rem; font-weight:700; }
.me-timeline__period small { font-size:.7rem; line-height:1.25; color:#64748b; }
.me-timeline__period.is-approved { border-top-color:#059669; background:#ecfdf5; }
.me-timeline__period.is-submitted { border-top-color:#2563eb; background:#eff6ff; }
.me-timeline__period.is-progress { border-top-color:#d97706; background:#fffbeb; }
.me-timeline__period.is-overdue { border-top-color:#dc2626; background:#fef2f2; }
.me-task-list,
.me-notification-list { list-style:none; margin:0; padding:0; display:grid; gap:.65rem; }
.me-task-list li,
.me-notification-list li { border:1px solid var(--surface-border, #e2e8f0); border-radius:8px; }
.me-task-list a,
.me-notification-list a { display:flex; flex-direction:column; gap:.2rem; padding:.7rem .8rem; color:inherit; text-decoration:none; }
.me-task-list span,
.me-notification-list span { color:var(--text-secondary, #475569); font-size:.8rem; }
.me-task-list small,
.me-notification-list small { color:#64748b; font-size:.72rem; }
.me-notification-list li.is-unread { border-left:4px solid #2563eb; background:#eff6ff; }
.me-dashboard__filter-card .dochub-card__body { padding:1rem; }
.me-filter-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)); gap:.75rem; align-items:end; }
.me-filter-grid > div { display:grid; gap:.3rem; }
.me-filter-grid__actions { display:flex !important; flex-direction:row; gap:.5rem !important; }
.me-table-wrap { overflow-x:auto; }
.me-dashboard__table { min-width:900px; }
.me-dashboard__table td { vertical-align:top; }
.me-dashboard__table td > small,
.me-dashboard__table td > strong + small { display:block; margin-top:.2rem; color:#64748b; font-size:.72rem; }
.me-dashboard__row-actions { display:flex; flex-wrap:wrap; gap:.35rem; }
.me-dashboard__row-actions form { margin:0; }
.me-status { display:inline-flex; padding:.25rem .55rem; border-radius:999px; background:#f1f5f9; color:#475569; font-size:.72rem; font-weight:700; white-space:nowrap; }
.me-status--approved,
.me-status--passed { background:#dcfce7; color:#166534; }
.me-status--submitted,
.me-status--resubmitted,
.me-status--under-review { background:#dbeafe; color:#1e40af; }
.me-status--draft,
.me-status--revision-requested,
.me-status--pending { background:#fef3c7; color:#92400e; }
.me-status--overdue,
.me-status--failed,
.me-status--error,
.me-status--rejected { background:#fee2e2; color:#991b1b; }
.me-pagination { display:flex; justify-content:center; align-items:center; gap:1rem; padding:1rem; border-top:1px solid var(--surface-border, #e2e8f0); }
.me-pagination .is-disabled { pointer-events:none; opacity:.45; }
.me-dashboard__back { display:inline-block; margin-bottom:.45rem; text-decoration:none; }
.me-document-details { display:grid; grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)); gap:1px; margin:0; background:var(--surface-border, #e2e8f0); border:1px solid var(--surface-border, #e2e8f0); border-radius:10px; overflow:hidden; }
.me-document-details > div { padding:1rem; background:#fff; }
.me-document-details dt { font-size:.75rem; font-weight:700; color:#64748b; }
.me-document-details dd { margin:.3rem 0 0; overflow-wrap:anywhere; }
.me-document-actions { display:flex; align-items:end; flex-wrap:wrap; gap:.75rem; margin-top:1rem; }
.me-document-actions form { margin:0; }
.me-document-replace { display:grid; grid-template-columns:minmax(180px, 280px) auto; gap:.35rem .5rem; align-items:end; }
.me-document-replace label { grid-column:1 / -1; }

@media (max-width: 1050px) {
    .me-dashboard__grant-summary { grid-template-columns:repeat(2, minmax(180px, 1fr)); }
    .me-dashboard__metrics { grid-template-columns:repeat(3, minmax(135px, 1fr)); }
    .me-dashboard__overview-grid { grid-template-columns:1fr; }
}

@media (max-width: 700px) {
    .me-dashboard__header { align-items:stretch; }
    .me-dashboard__grant-filter { min-width:100%; }
    .me-dashboard__grant-summary,
    .me-dashboard__metrics { grid-template-columns:1fr 1fr; }
    .me-timeline__row { grid-template-columns:1fr; }
    .me-document-replace { grid-template-columns:1fr; width:100%; }
}

@media (max-width: 460px) {
    .me-dashboard__grant-summary,
    .me-dashboard__metrics { grid-template-columns:1fr; }
}
/* Feature-flagged file-first report workspace. */
.report-workspace { max-width: 1240px; margin: 0 auto; padding: 1.5rem; color: #101828; }
.report-workspace > .dochub-card { margin-bottom: .75rem; border: 1px solid #dfe7f2; border-radius: .75rem; box-shadow: 0 1px 2px rgba(16, 24, 40, .03); }
.report-workspace__header { display: flex; gap: 1rem; justify-content: space-between; align-items: flex-end; margin-bottom: 1.25rem; }
.report-workspace__header .dochub-page__title { margin: 0; font-size: clamp(1.6rem, 2.5vw, 2rem); }
.report-workspace__crumb { display: flex; align-items: center; gap: .6rem; color: #667085; margin: 0 0 .75rem; font-size: .875rem; }
.report-workspace__crumb a { color: #475467; text-decoration: none; }
.report-workspace__crumb a:hover, .report-workspace__crumb a:focus-visible { color: #155eef; text-decoration: underline; }
.report-workspace__context { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: .75rem; background: #fff; border: 1px solid #dfe7f2; border-radius: .75rem; box-shadow: 0 1px 2px rgba(16, 24, 40, .03); }
.report-workspace__context > div { min-width: 0; padding: 1rem 1.25rem; border-right: 1px solid #e8edf5; }
.report-workspace__context > div:last-child { border-right: 0; }
.report-workspace__context span, .report-workspace__context strong { display: block; }
.report-workspace__context span { color: #667085; font-size: .78rem; margin-bottom: .3rem; }
.report-workspace__context strong { overflow-wrap: anywhere; }
.report-workspace__section-nav {display: flex;gap: 0;padding: .25rem;background: #e4e7ec;border-radius: .75rem;}
.report-workspace__section-nav a {flex: 1;padding: .85rem 1rem;background: transparent;border-radius: .5rem;text-align: center;font-weight: 600;color: #475467;}
.report-workspace__section-nav a:hover,
.report-workspace__section-nav a:focus-visible {background: #fff; color: #155eef; box-shadow: 0 1px 3px rgba(0,0,0,.1);}
.report-workspace__anchor-section { scroll-margin-top: 1rem; }
.report-workspace__site-selection { max-width: 28rem; margin-bottom: 1rem; }
.report-workspace__site-selection .dochub-form__select { width: 100%; }
.report-workspace__site-selection .dochub-form__hint { margin: .35rem 0 0; }
.report-workspace__upload-choices { display: inline-flex; margin-bottom: .75rem; border: 1px solid #d0d5dd; border-radius: .45rem; overflow: hidden; }
.report-workspace__upload-choice { min-width: 13rem; padding: .65rem 1rem; color: #475467; background: #fff; border: 0; border-right: 1px solid #d0d5dd; cursor: pointer; font-weight: 600; }
.report-workspace__upload-choice:last-child { border-right: 0; }
.report-workspace__upload-choice.is-active { color: #155eef; background: #eff6ff; box-shadow: inset 0 0 0 1px #155eef; }
.report-workspace__upload-choice:focus-visible { outline: 3px solid rgba(21, 94, 239, .3); outline-offset: -3px; }
.report-workspace__dropzone { display: grid; justify-items: center; gap: .45rem; padding: 2rem 1rem; border: 1.5px dashed #a9bddc; border-radius: .55rem; cursor: pointer; text-align: center; transition: background-color .15s ease, border-color .15s ease; }
.report-workspace__dropzone:hover, .report-workspace__dropzone:focus-within, .report-workspace__dropzone.is-dragging { background: #f8fbff; border-color: #155eef; }
.report-workspace__dropzone input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }
.report-workspace__upload-icon { color: #155eef; font-size: 2rem; line-height: 1; }
.report-workspace__dropzone small { color: #667085; }
.report-workspace__supp-type { display: grid; grid-template-columns: minmax(14rem, 22rem) minmax(14rem, 1fr); gap: .75rem; margin-bottom: .75rem; }
.report-workspace__supp-type .dochub-form__label { grid-column: 1 / -1; margin-bottom: -.4rem; }
.report-workspace__upload-result { min-height: 1.3rem; margin-top: .75rem; color: #344054; white-space: pre-line; }
.report-workspace__document-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: center; padding: .9rem 1rem; border: 1px solid #e4e7ec; border-radius: .5rem; }
.report-workspace__document-card strong, .report-workspace__document-card span { display: block; }
.report-workspace__document-card span { color: #667085; font-size: .85rem; margin-top: .2rem; }
.report-workspace__document-card > div:last-child { display: grid; justify-items: end; gap: .6rem; }
.report-workspace__related-list { display: grid; gap: 1rem; }
.report-workspace__related-record { display: grid; gap: 1rem; padding: 1rem; border: 1px solid #e4e7ec; border-radius: .65rem; }
.report-workspace__related-record h3 { font-size: 1rem; }
.report-workspace__processing-summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr); gap: .5rem 1rem; padding: .75rem; background: #f8fafc; border-radius: .5rem; }
.report-workspace__processing-summary span { color: #667085; }
.report-workspace__summary-list { display: grid; gap: .65rem; }
.report-workspace__summary-list > div { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: .8rem 0; border-bottom: 1px solid #eaecf0; }
.report-workspace__summary-list > div:last-child { border-bottom: 0; }
.report-workspace__table-wrap { overflow-x: auto; }
.report-workspace__comment .dochub-form__textarea { width: 100%; min-height: 6rem; }
.report-workspace__comment-value { padding: .8rem; min-height: 3rem; white-space: pre-wrap; background: #f8fafc; border: 1px solid #e4e7ec; border-radius: .45rem; }
.report-workspace__review .dochub-review-actions { width: 100%; }
.report-workspace__actions { display: flex; justify-content: flex-end; margin: .75rem 0 1.25rem; padding: 1rem; background: #fff; border: 1px solid #dfe7f2; border-radius: .75rem; box-shadow: 0 1px 2px rgba(16, 24, 40, .03); }
.report-workspace__activity ol { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.report-workspace__activity li { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid #eaecf0; padding-bottom: .75rem; }
.report-workspace__activity li:last-child { border-bottom: 0; padding-bottom: 0; }
.report-workspace__activity small { color: #667085; text-align: right; }
@media (max-width: 720px) {
    .report-workspace { padding: 1rem; }
    .report-workspace__header, .report-workspace__document-card, .report-workspace__activity li { display: grid; }
    .report-workspace__context { grid-template-columns: 1fr 1fr; }
    .report-workspace__context > div:nth-child(2) { border-right: 0; }
    .report-workspace__context > div:nth-child(-n+2) { border-bottom: 1px solid #e8edf5; }
    .report-workspace__upload-choices { display: grid; width: 100%; }
    .report-workspace__upload-choice { width: 100%; min-width: 0; border-right: 0; border-bottom: 1px solid #d0d5dd; }
    .report-workspace__upload-choice:last-child { border-bottom: 0; }
    .report-workspace__supp-type { grid-template-columns: 1fr; }
    .report-workspace__document-card > div:last-child { justify-items: start; }
    .report-workspace__processing-summary { grid-template-columns: auto minmax(0, 1fr); }
    .report-workspace__activity small { text-align: left; }
}

/* Raw Data edit/details presentation. Existing report behavior remains unchanged. */
.raw-data-report {
    max-width: 1240px;
    margin: 0 auto;
    padding: 1.5rem;
    color: #101828;
}

.raw-data-report__breadcrumbs {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: 1rem;
    color: #667085;
    font-size: .875rem;
}

.raw-data-report__breadcrumbs a {
    color: #475467;
    text-decoration: none;
}

.raw-data-report__breadcrumbs a:hover,
.raw-data-report__breadcrumbs a:focus-visible {
    color: #155eef;
    text-decoration: underline;
}

.raw-data-report__header,
.raw-data-report__title-row,
.raw-data-report__header-actions,
.raw-data-report__section-heading {
    display: flex;
    align-items: center;
}

.raw-data-report__header {
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.raw-data-report__title-row,
.raw-data-report__header-actions {
    gap: .75rem;
    flex-wrap: wrap;
}

.raw-data-report__title-row h1 {
    margin: 0;
    font-size: clamp(1.6rem, 2.5vw, 2rem);
}

.raw-data-report__metadata,
.raw-data-report__period-fields,
.raw-data-report__section {
    background: #fff;
    border: 1px solid #dfe7f2;
    border-radius: .75rem;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .03);
}

.raw-data-report__metadata {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: .75rem;
}

.raw-data-report__metadata > div {
    min-width: 0;
    padding: 1rem 1.25rem;
    border-right: 1px solid #e8edf5;
}

.raw-data-report__metadata > div:last-child {
    border-right: 0;
}

.raw-data-report__metadata span,
.raw-data-report__metadata strong,
.raw-data-report__metadata small,
.raw-data-report__primary-file span,
.raw-data-report__primary-file strong,
.raw-data-report__primary-file small {
    display: block;
}

.raw-data-report__metadata span,
.raw-data-report__primary-file > div > span {
    margin-bottom: .3rem;
    color: #667085;
    font-size: .78rem;
}

.raw-data-report__metadata strong,
.raw-data-report__primary-file strong {
    overflow-wrap: anywhere;
}

.raw-data-report__metadata small,
.raw-data-report__primary-file small {
    margin-top: .25rem;
    color: #667085;
}

.raw-data-report__period-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1rem 1.25rem;
    margin-bottom: .75rem;
}

.raw-data-report__section {
    padding: 1rem 1.25rem;
    margin-bottom: .75rem;
}

.raw-data-report__section-heading {
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .75rem;
}

.raw-data-report__section-heading h2 {
    margin: 0;
    font-size: 1rem;
}

.raw-data-report__section-heading p {
    margin: .25rem 0 0;
    color: #667085;
    font-size: .85rem;
}

.raw-data-report__file-kind {
    padding: .55rem 1rem;
    color: #155eef;
    border: 1px solid #155eef;
    border-radius: .4rem;
    font-weight: 600;
}

.raw-data-report__dropzone {
    display: grid;
    justify-items: center;
    gap: .45rem;
    padding: 2rem 1rem;
    border: 1.5px dashed #a9bddc;
    border-radius: .55rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

.raw-data-report__dropzone:hover,
.raw-data-report__dropzone:focus-within,
.raw-data-report__dropzone--active {
    border-color: #155eef;
    background: #f5f8ff;
}

.raw-data-report__dropzone > span:not(.dochub-btn) {
    color: #667085;
    font-size: .85rem;
}

.raw-data-report__upload-icon {
    color: #155eef !important;
    font-size: 2.2rem !important;
    line-height: 1;
}

.raw-data-report__native-file {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    opacity: 0;
    pointer-events: none;
}

.raw-data-report__selected-file {
    min-height: 1.2rem;
    color: #155eef !important;
    font-weight: 600;
}

.raw-data-report__primary-file {
    display: grid;
    grid-template-columns: auto minmax(13rem, 1.4fr) minmax(5rem, .45fr) minmax(12rem, 1fr) minmax(15rem, 1fr);
    align-items: center;
    gap: 1rem;
    padding: .85rem;
    border: 1px solid #e4e7ec;
    border-radius: .5rem;
}

.raw-data-report__file-icon {
    display: grid !important;
    place-items: center;
    inline-size: 2.5rem;
    block-size: 2.8rem;
    color: #067647;
    background: #ecfdf3;
    border: 1px solid #abefc6;
    border-radius: .35rem;
    font-weight: 800;
}

.raw-data-report__file-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    flex-wrap: wrap;
}

.raw-data-report__table-wrap {
    overflow-x: auto;
}

.raw-data-report__table {
    width: 100%;
    border-collapse: collapse;
}

.raw-data-report__table th,
.raw-data-report__table td {
    padding: .65rem .75rem;
    border-bottom: 1px solid #eaecf0;
    text-align: left;
}

.raw-data-report__table th {
    color: #344054;
    background: #f8fafc;
    font-size: .8rem;
}

.raw-data-report__activity {
    padding: 0;
    margin: 0;
    list-style: none;
}

.raw-data-report__activity li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: .75rem;
    padding: .6rem 0;
    border-bottom: 1px solid #f0f2f5;
}

.raw-data-report__activity li:last-child {
    border-bottom: 0;
}

.raw-data-report__activity-avatar {
    color: #155eef;
}

.raw-data-report__activity small {
    display: block;
    margin-top: .15rem;
    color: #667085;
}

.raw-data-report__activity time {
    color: #667085;
    font-size: .82rem;
    white-space: nowrap;
}

.raw-data-report__empty {
    padding: 1rem;
    color: #667085;
    background: #f8fafc;
    border-radius: .45rem;
}

.raw-data-report__readonly-comment {
    min-height: 3.5rem;
    padding: .9rem 1rem;
    color: #344054;
    background: #f8fafc;
    border: 1px solid #e4e7ec;
    border-radius: .45rem;
}

.raw-data-report__quality-card .dochub-card__body > .u-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.raw-data-report__footer-actions {
    display: flex;
    gap: .75rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.raw-data-report #processing-results {
    border-color: #c7d7fe;
    box-shadow: none;
}

.raw-data-report #processing-results .dochub-card__header {
    background: #f5f7ff;
}

@media (max-width: 900px) {
    .raw-data-report__metadata {
        grid-template-columns: 1fr 1fr;
    }

    .raw-data-report__metadata > div:nth-child(2) {
        border-right: 0;
    }

    .raw-data-report__primary-file {
        grid-template-columns: auto 1fr 1fr;
    }

    .raw-data-report__file-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .raw-data-report__quality-card .dochub-card__body > .u-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .raw-data-report {
        padding: 1rem;
    }

    .raw-data-report__header,
    .raw-data-report__metadata,
    .raw-data-report__period-fields,
    .raw-data-report__primary-file {
        display: grid;
        grid-template-columns: 1fr;
    }

    .raw-data-report__metadata > div {
        border-right: 0;
        border-bottom: 1px solid #e8edf5;
    }

    .raw-data-report__metadata > div:last-child {
        border-bottom: 0;
    }

    .raw-data-report__header-actions,
    .raw-data-report__header-actions .dochub-btn {
        width: 100%;
    }

    .raw-data-report__activity li {
        grid-template-columns: auto 1fr;
    }

    .raw-data-report__activity time {
        grid-column: 2;
    }

    .raw-data-report__quality-card .dochub-card__body > .u-grid {
        grid-template-columns: 1fr;
    }
}
.grant-workflow-tabs {
    margin: 0 0 var(--space-6);
    overflow-x: auto;
}

.grant-workflow-tabs__list {
    display: grid;
    grid-auto-columns: max-content;
    grid-auto-flow: column;
    grid-template-columns: none;
    gap: var(--space-2);
    min-width: max-content;
    margin: 0;
    padding: 0;
    list-style: none;
}

.grant-workflow-tabs__link {
    display: flex;
    min-height: 3.5rem;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    background: var(--surface-raised);
    text-decoration: none;
    white-space: nowrap;
}

.grant-workflow-tabs__link:hover {
    border-color: var(--color-primary);
}

.grant-workflow-tabs__link--current {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-primary-faint);
    font-weight: 600;
}

.grant-workflow-tabs__link--disabled {
    color: var(--text-muted);
    background: var(--surface-sunken);
    cursor: not-allowed;
}

.grant-workflow-tabs__number {
    display: inline-flex;
    width: 1.5rem;
    height: 1.5rem;
    flex: 0 0 1.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    background: var(--color-primary);
    font-size: .75rem;
}
.phase2-powerbi-frame {
    position: relative;
    width: 100%;
    min-height: 70vh;
    overflow: hidden;
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    background: var(--color-white);
}

.phase2-powerbi-frame iframe {
    display: block;
    width: 100%;
    min-height: 70vh;
    border: 0;
}
.dochub-role-permissions {
    margin-top: 1rem;
}

.dochub-role-permission-group {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--color-gray-200);
    border-radius: 0.375rem;
    background: var(--color-gray-50);
}

.dochub-role-permission-group__title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.dochub-role-permission-list {
    margin: 0;
    padding-left: 1.25rem;
}

.dochub-role-permission-list__item {
    margin-bottom: 0.25rem;
}
