/* ----------------------------------------
🎨 THEME VARIABLES
---------------------------------------- */
:root {
  --bg-color: #ffffff;
  --text-color: #222222;
  --header-bg: #f9f9f9;
  --accent-color: #006400;
  --border-color: #dddddd;
  --card-bg: #ffffff;
  --sidebar-bg: #f0f0f0;
}

.theme-dark {
  --bg-color: #1a1a1a;
  --text-color: #eeeeee;
  --header-bg: #333333;
  --accent-color: #4caf50;
  --border-color: #444444;
  --card-bg: #222222;
  --sidebar-bg: #2a2a2a;
}

/* GLOBAL BOX SIZING SAFETY */
html {
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

/* ----------------------------------------
🌍 GLOBAL STYLES
---------------------------------------- */
body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  padding: 0;
}

/* ----------------------------------------
📦 LAYOUT
---------------------------------------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}

.main-content {
  padding: 30px;
}

/* ----------------------------------------
🧾 REPORT HEADER & FOOTER
---------------------------------------- */
.report-header,
.report-footer {
  background-color: var(--header-bg);
  color: var(--text-color);
  padding: 15px 30px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 15px;
}

.report-header {
  width: 100%;
  justify-content: space-between;
}

@media (min-width: 769px) {
  .report-header {
    padding: 8px 24px;
    flex-wrap: nowrap;
    align-items: center;
  }

  .header-right {
    margin-left: auto;
    white-space: nowrap;
  }

  .header-left {
    min-width: 0;
  }
}

.logo {
  height: 36px;
  max-height: 36px;
  width: auto;
  object-fit: contain;
}

.org-name {
  font-size: 22px;
  font-weight: bold;
  color: var(--accent-color);
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-right {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.user-greeting {
  font-size: 0.9rem;
  opacity: 0.8;
}

.nav-toggle {
  padding: 6px 10px;
}

/* ----------------------------------------
📊 CARDS, BUTTONS, NAV
---------------------------------------- */
.card {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

.btn {

  background-color: #0066cc;
  color: white;
  padding: 0.5rem 1rem;
  text-decoration: none;
  border-radius: 4px;
}

.btn:hover {
  background-color: #0051a3;
}

.nav-list {
  list-style: none;
  padding: 0;
}

.nav-list li {
  margin-bottom: 0.75rem;
}

/* ----------------------------------------
📱 DASHBOARD GRID
---------------------------------------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

/* 🎯 Force high-contrast white-on-black styling inside the report */
.report-skin {
  --bg-color: #ffffff;
  --text-color: #000000;
  --header-bg: #ffffff;
  --accent-color: #000000;
  --border-color: #cccccc;
}

.report-skin .financial-report {
  background-color: var(--bg-color);
  color: var(--text-color);
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.1);
}

.report-skin .financial-report h1,
.report-skin .financial-report h2 {
  color: var(--accent-color);
}

.report-skin .financial-report li {
  color: var(--text-color);
  border-color: var(--border-color);
}

/* ----------------------------------------
📐 GRID LAYOUT FOR SIDEBAR + MAIN
---------------------------------------- */
.app-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 53px); /* visible height less header */
}


/* 🔑 CRITICAL FIX: allow horizontal overflow inside CSS grid */
.app-layout > * {
  min-width: 0;
}

.main-content {
  min-width: 0;
}



/* 🧱 Sidebar Styles */
.sidebar {
  background-color: var(--sidebar-bg);
  padding: 20px;
  border-right: 1px solid var(--border-color);
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Sidebar Header (e.g. logo or fallback text) */
.sidebar-header {
  margin-bottom: 8px;
  text-align: center;
}

.sidebar-brand {

  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-color);
}

/* Sidebar Navigation */
.nav-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-links a {
  display: block;
  color: var(--text-color);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.nav-links a:hover {
  background-color: var(--accent-color);
  color: white;
}

/* Ensure sidebar stretches full height of layout */
.sidebar {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* Expandable nav sections */
.nav-links details {
  background-color: var(--sidebar-bg);
  border: none;
  padding: 0;
}

.nav-links summary {
  font-weight: bold;
  cursor: pointer;
  padding: 8px 12px;
  color: var(--text-color);
  background-color: transparent;
  border-radius: 4px;
  list-style: none;
}

.nav-links summary:hover {
  background-color: var(--accent-color);
  color: white;
}

.nav-links a {
  padding: 6px 24px;
  font-size: 0.95em;
}

.nav-links details[open] summary {
  background-color: var(--accent-color);
  color: white;
}

.nav-heading {
  font-size: 0.9rem;
  font-weight: bold;
  margin-top: 20px;
  padding: 0 12px;
  color: var(--accent-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Optional: add small indentation for nested links */
.nav-links details a {
  padding-left: 24px;
  font-size: 0.95em;
}

/* Expandable section */
.nav-links details {
  margin-top: 5px;
}

.nav-links summary::before {
  content: '▸';

  margin-right: 6px;
  transform: rotate(0deg);
  transition: transform 0.2s ease;
}

.nav-links details[open] summary::before {
  transform: rotate(90deg);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}
.data-table th, .data-table td {
  padding: 12px;
  text-align: left;
  border-top: 1px solid var(--border-color);
}
.data-table thead {
  background-color: var(--header-bg);
}

/* Table sorting links */
.table-sort,
.table-sort:link,
.table-sort:visited,
.table-sort:hover,
.table-sort:active {
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
}

.table-sort:hover {
  color: var(--accent-color);
}

.table-sort.active,
.table-sort.active:link,
.table-sort.active:visited,
.table-sort.active:hover,
.table-sort.active:active {
  color: var(--accent-color);
}

.sort-arrow {
  font-size: 0.72em;
  line-height: 1;
  opacity: 0.8;
  min-width: 0.9em;
  text-align: center;
}

.theme-dark .table-sort,
.theme-dark .table-sort:link,
.theme-dark .table-sort:visited,
.theme-dark .table-sort:active {
  color: var(--text-color);
}

.theme-dark .table-sort:hover {
  color: var(--accent-color);
}

.theme-dark .table-sort.active,
.theme-dark .table-sort.active:link,
.theme-dark .table-sort.active:visited,
.theme-dark .table-sort.active:hover,
.theme-dark .table-sort.active:active {
  color: var(--accent-color);
}

.data-table tr:hover {
  background-color: #2a2a2a;
  cursor: pointer;
}

.pill {

  background-color: var(--header-bg);
  color: var(--accent-color);
  padding: 2px 6px;
  font-size: 12px;
  border-radius: 4px;
  margin-right: 4px;
}

.summary-box {
  background-color: var(--card-bg);
  padding: 12px;
  margin-bottom: 1rem;
  border-left: 4px solid var(--accent-color);
  color: var(--text-color);
  font-weight: bold;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.table th,
.table td {
  border: 1px solid #ccc;   /* Light outline */
  padding: 0.6rem 1rem;
  text-align: left;
}

.table th {
  background-color: #f9f9f9;
  font-weight: 600;
}

/* ----------------------------------------
📱 Table horizontal scrolling (single canonical block)
---------------------------------------- */
/* Optional diagnostic helper: add class to see scroll container bounds */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

body.modal-lock {
  overflow: hidden;
}

.modal.show {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
}

#modal .modal-body {
  position: relative;
  background: var(--card-bg);
  color: var(--text-color);
  border-radius: 10px;
  padding: 0;
  width: calc(100% - 1rem);
  max-width: 100%;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 0;
  z-index: 1;
  max-height: 90vh;
  overflow: hidden;
}

#modal .modal-window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background-color: var(--header-bg);
  color: var(--text-color);
  border-bottom: 1px solid var(--border-color);
  border-radius: 10px 10px 0 0;
  cursor: grab;
  user-select: none;
}

#modal .modal-window-title {
  font-weight: 600;
  font-size: 0.95rem;
}

#modal .modal-window-actions {
  display: flex;
  gap: 0.35rem;
}

#modal .modal-window-button {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  border-radius: 6px;
  padding: 0.1rem 0.5rem;
  cursor: pointer;
  line-height: 1;
}

#global-modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  overflow-x: auto;
  flex: 1 1 auto;
}

#modal .modal-body.is-minimised #global-modal-body {
  display: none;
}

#modal .modal-body.is-minimised .modal-window-header {
  border-radius: 10px;
}

@media (min-width: 769px) {
  /* Desktop window mode: don’t block the page */
  .modal { pointer-events: none; }
  .modal-backdrop { background: transparent; pointer-events: none; }
  .modal-body {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    width: min(600px, calc(100% - 3rem));
    max-height: 80vh;
    pointer-events: auto;
  }
}

.help-text {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-top: 0.35rem;
}


.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-header {
  background-color: var(--header-bg);
  color: var(--text-color);
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border-color);
  border-radius: 8px 8px 0 0;
}


/* Dark Mode support */
.theme-dark .select2-container .select2-selection--single {
  background-color: #1e1e1e;
  color: #f0f0f0;
  border-color: #444;
}

.select2-dropdown {
  z-index: 2000 !important; /* Make sure dropdowns are always visible */
}

/* ✅ SELECT2 DARK MODE SUPPORT */
.theme-dark .select2-container--default .select2-selection--single {
  background-color: #1e1e1e;
  border: 1px solid #444;
  color: #f0f0f0;
}

.theme-dark .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #f0f0f0;
}

.theme-dark .select2-container--default .select2-selection--single .select2-selection__arrow {
  color: #f0f0f0;
}


.theme-dark .select2-results__option--highlighted {
  background-color: #333;
  color: #fff;
}

.theme-dark .select2-results__option--selected {
  background-color: #2d2d2d;
  color: #fff;
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 650;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.nav-backdrop[hidden] {
  display: none !important;
  pointer-events: none !important;
  opacity: 0 !important;
}



/* Ensure line height and spacing look normal */
.select2-selection__rendered {
  line-height: 1.5 !important;
  padding-left: 2px;
}

/* Arrow positioning fix */
.select2-selection__arrow {
  height: 100% !important;
  top: 0 !important;
}


.theme-dark .select2-dropdown {
  background-color: #1e1e1e;
  color: #f0f0f0;
  border-color: #444;
}

.theme-dark .select2-results__option--highlighted {
  background-color: #333;
  color: #fff;
}

.theme-dark .select2-results__option--selected {
  background-color: #2d2d2d;
  color: #fff;
}

body.nav-open .nav-backdrop {
  opacity: 1;
  pointer-events: auto;
}


/* SIDEBAR DROPDOWN FIXES */
.accordion-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  padding-right: 0.5rem;
  cursor: pointer;
  user-select: none;
}

/* rotate arrow when open */
details[open] > summary .arrow-icon {
  transform: rotate(90deg);
}

/* spacing between dropdown links */
.sub-links a {
  display: block;
  font-size: 0.92rem;
  padding: 0.4rem 0 0.4rem 1.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* prevent summary from wrapping onto multiple lines */
.accordion-section summary {
  list-style: none; /* hide default triangle */
  padding: 0.5rem 1rem;
  font-weight: bold;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* ✅ Sub-dropdown headings (like Fees and Invoicing inside Work & Billing) */
.sub-dropdown summary {
  font-size: 0.85rem;
  font-weight: 500;
  padding-left: 1.75rem;
  color: var(--text-color);
  background-color: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.sub-dropdown summary:hover {
  text-decoration: underline;
  background: none;
}

.sub-dropdown summary::before {
  content: '▸';

  margin-right: 6px;
  transform: rotate(0deg);
  transition: transform 0.2s ease;
}

.sub-dropdown[open] summary::before {
  transform: rotate(90deg);
}

.sub-links a {
  font-size: 0.82rem;
  padding-left: 2.25rem;
  position: relative;
  color: var(--text-color);
}

.sub-links a::before {
  content: '–';
  position: absolute;
  left: 1.5rem;
  color: var(--accent-color);
}

.sub-links a:hover {
  background-color: var(--accent-color);
  color: white;
}


/* 🔽 Arrow & toggle style */
.submenu-toggle {
  font-size: 0.95rem;
  padding: 6px 24px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-color);
}

.submenu-toggle:hover {
  background-color: var(--sidebar-bg);
}

.submenu-toggle .arrow {
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}

/* When toggled, rotate arrow */
.collapsible-submenu.show-submenu ~ .submenu-toggle .arrow {
  transform: rotate(90deg);
}

/* Hidden by default */
.collapsible-submenu {
  display: none;
  flex-direction: column;
  margin-left: 10px;
  padding-left: 10px;
}

.collapsible-submenu.show-submenu {
  display: flex;
}

.collapsible-submenu a {
  font-size: 0.85rem;
  padding-left: 2rem;
  position: relative;
}

.collapsible-submenu a::before {
  content: '–';
  position: absolute;
  left: 1.5rem;
  color: var(--accent-color);
}

/* 🔧 General table header fix */
.table th {
  background-color: var(--header-bg);
  color: var(--text-color);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}

/* 🌓 Fix for dark mode */
.theme-dark .table th {
  background-color: #2e2e2e;  /* or var(--header-bg) */
  color: #f0f0f0;
  border-color: #444;
}

dialog.modal {
  border: none;
  border-radius: 8px;
  padding: 2rem;
  max-width: 800px;
  width: 100%;
  margin: auto;
  background: var(--bg-color, #1e1e1e);
  color: var(--text-color, #fff);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

:root {
  --btn-bg: #2563eb;        /* accessible blue */
  --btn-text: #ffffff;
  --btn-hover-bg: #1d4ed8;
  --btn-border: #1e3a8a;

  --btn-secondary-bg: #6b7280; /* grey */
  --btn-secondary-hover: #4b5563;
  --btn-danger-bg: #dc2626;
  --btn-danger-hover: #b91c1c;
}

.theme-dark .btn {
  background: var(--btn-bg);
  color: var(--btn-text);
  border: 1px solid var(--btn-border);
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 600;
}
.theme-dark .btn:hover { background: var(--btn-hover-bg); }

.theme-dark .btn-secondary { background: var(--btn-secondary-bg); }
.theme-dark .btn-secondary:hover { background: var(--btn-secondary-hover); }

.theme-dark .btn-danger { background: var(--btn-danger-bg); }
.theme-dark .btn-danger:hover { background: var(--btn-danger-hover); }

/* Links that look like buttons */
.theme-dark a.btn { text-decoration: none;  }

/* ✅ Base button style (applies to both themes) */
.btn {

  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--btn-border, #1e3a8a);
  background: var(--btn-bg, #2563eb);
  color: var(--btn-text, #fff);
  cursor: pointer;
}
.btn:hover { background: var(--btn-hover-bg, #1d4ed8); }

/* ✅ Light-theme button overrides */
:root {
  --btn-bg: #2563eb;
  --btn-text: #ffffff;
  --btn-hover-bg: #1d4ed8;
  --btn-border: #1e3a8a;
}
.btn-secondary { background: var(--btn-secondary-bg, #6b7280); }
.btn-secondary:hover { background: var(--btn-secondary-hover, #4b5563); }
.btn-danger { background: var(--btn-danger-bg, #dc2626); }
.btn-danger:hover { background: var(--btn-danger-hover, #b91c1c); }

/* ✅ Dark-theme keeps your existing tokens (already in your file) */

/* ✅ Visible focus for keyboard users (meets WCAG) */
.btn:focus,
.nav-links a:focus,
.table a:focus {
  outline: 2px solid #22d3ee; /* cyan ring */
  outline-offset: 2px;
}

/* ✅ Active/selected nav link style */
.nav-links a.active {
  background-color: var(--accent-color);
  color: #fff;
  font-weight: 700;
}

/* ✅ Table row hover should respect theme */
.data-table tr:hover {
  background-color: var(--header-bg);
}

/* ✅ Links inside dark theme should be readable */
.theme-dark a { color: #93c5fd; }            /* soft blue */
.theme-dark a:hover { color: #bfdbfe; }

/* ✅ Make Select2 dropdown text always readable on dark */
.theme-dark .select2-results__option { color: #f0f0f0; }


/* MODAL POLISH — close button + select2 sizing */

/* File picker component (single UX: hide native input, use button label) */
.file-picker {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}

/* Visually hide native input but keep it accessible via label */
.file-picker__input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}


/* Safety: hide any native file input inside file-picker (even if class differs) */
.file-picker input[type="file"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.file-picker__name {
  opacity: .85;
  font-size: .9rem;
}

/* MODAL POLISH — close button + select2 sizing */
/* 1) Bring the top-right X down into alignment */
.popup-topbar {
  margin: 0 !important;
  padding: 0.25rem 0.25rem 0.0rem 0 !important;
}
.popup-close-x {
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 6px !important;
}

/* 2) Force identical control heights (inputs + selects + select2 single) */
.theme-dark input,
.theme-dark select,
.theme-dark textarea {
  height: 34px;
}

.theme-dark textarea {
  height: auto;
}

.theme-dark .select2-container--default .select2-selection--single {
  height: 34px !important;
  min-height: 34px !important;
  display: flex !important;
  align-items: center !important;
}

.theme-dark .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 34px !important;
  padding-left: 10px !important;
  padding-right: 34px !important;
}

/* 3) Make select2 arrow match the X accent colour */
.theme-dark .select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: rgba(78,140,255,0.95) transparent transparent transparent !important;
}


/* THEME-DARK INPUTS — MATCH SELECT2 (NO WHITE) */
/* Your Select2 is now styled dark/grey; force native inputs to match it in theme-dark. */
.theme-dark input:not([type="checkbox"]):not([type="radio"]),
.theme-dark select,
.theme-dark textarea {
  background: rgba(255,255,255,0.06) !important;
  color: rgba(255,255,255,0.92) !important;
  border: 1px solid rgba(255,255,255,0.16) !important;
}

.theme-dark input::placeholder,
.theme-dark textarea::placeholder {
  color: rgba(255,255,255,0.55) !important;
}


/* Responsive visibility helpers */
.mobile-only { display: none !important; }
.desktop-only { display: inline-flex !important; }

@media (max-width: 768px){
  .mobile-only { display: inline-flex !important; }
  .desktop-only { display: none !important; }
}


/* ========================================
   MOBILE SHELL FIX — off-canvas sidebar
   ======================================== */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
  }

  .app-layout {
    display: block;
    min-height: auto;
  }

  .report-header {
    padding: 10px 12px;
    gap: 10px;
    flex-wrap: nowrap;
  }

  .header-left {
    min-width: 0;
    flex: 1 1 auto;
  }

  .header-right {
    flex: 0 0 auto;
    margin-left: auto;
    gap: 0.5rem;
  }

  .org-name {
    font-size: 1.1rem;
    line-height: 1.2;
  }

  .logo {
    height: 28px;
    max-height: 28px;
  }

  /* Completely remove sidebar from layout on mobile */
  .sidebar {
    display: none;
  }

  /* Show only when nav-open */
  body.nav-open .sidebar {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(82vw, 320px);
    z-index: 700;
    background: var(--sidebar-bg);
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
  }

  .main-content {
    width: 100% !important;
    max-width: 100%;
    padding: 14px;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  .card {
    padding: 1rem;
  }

  .table-responsive,
  .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table,
  .table {
    min-width: 720px;
  }

  .btn {
    white-space: nowrap;
  }
}


/* MOBILE HEADER COMPACT FIX */
@media (max-width: 768px) {
  .report-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    padding: 10px 12px !important;
  }

  .header-left,
  .header-right {
    width: 100% !important;
    min-width: 0 !important;
  }

  .header-left {
    display: grid !important;
    grid-template-columns: auto auto 1fr !important;
    align-items: center !important;
    gap: 10px !important;
  }

  .header-right {
    display: inline-flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    width: auto !important;
    flex: 0 0 auto !important;
  }

  .org-name {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 1rem !important;
    line-height: 1.1 !important;
  }

  .user-greeting {
    min-width: 0 !important;
    max-width: 150px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 0.9rem !important;
  }

  .report-header .btn {
    padding: 8px 12px !important;
  }

  .nav-toggle {
    width: 44px !important;
    height: 44px !important;
    justify-content: center !important;
  }
}

@media (max-width: 430px) {
  .user-greeting {
    max-width: 120px !important;
  }

  .org-name {
    font-size: 0.95rem !important;
  }

  .report-header .btn {
    padding: 8px 10px !important;
  }
}


/* Hide greeting on mobile */
@media (max-width: 768px) {
  .user-greeting {
    display: none !important;
  }
}

