/* Custom styles for American Authorship Dashboard */

:root {
  /* Refined accessible palette - enhanced sophistication while maintaining WCAG AA compliance */
  --color-bg: #f7fafc;
  --color-surface: #ffffff;
  --color-muted: #e5e7eb;
  --color-text: #1f2937;      /* slate-800 */
  --color-text-muted: #4b5563;/* slate-600 */

  /* Primary Palette - Navy Blue (brand) */
  --color-primary: #1e3a5f;   /* deep muted blue */
  --color-primary-600: #2a4365;
  --color-primary-700: #14293f; /* darker navy for depth */
  --color-primary-50: #e8eef5;  /* very light blue-gray */
  --color-primary-contrast: #ffffff;

  /* Secondary Palette - Refined Supporting Colors */
  --color-secondary-teal: #0d5e57;      /* deeper, more muted teal */
  --color-secondary-sage: #3f5f4a;      /* sage green - analytics/data */
  --color-secondary-slate: #475569;     /* warm slate - neutral emphasis */
  --color-secondary-aubergine: #5b3a70; /* muted purple - insights/special */

  /* Accent Palette - Sophisticated Highlights */
  --color-accent-amber: #92582e;        /* muted amber - warnings */
  --color-accent-terracotta: #8b4a3a;   /* terracotta - important/danger */
  --color-accent-gold: #8b7355;         /* muted gold - highlights */

  /* Legacy accent for backward compatibility */
  --color-accent: #0d5e57;    /* refined teal */

  /* Focus Rings - Enhanced Accessibility */
  --focus-ring: 0 0 0 3px rgba(30,58,95,0.35);
  --focus-ring-secondary: 0 0 0 3px rgba(13,94,87,0.35); /* teal variant */

  /* Enhanced dropdown typography variables for better accessibility */
  --dropdown-trigger-font-size: 1.4rem;  /* triggers/buttons - increased from 1.35rem */
  --dropdown-menu-font-size: 1.3rem;     /* option lists - increased from 1.25rem */
  --dropdown-label-font-size: 1.25rem;   /* labels above controls - increased from 1.20rem */
  --dropdown-search-font-size: 1.35rem;  /* search inputs inside menus - increased from 1.30rem */
}

html { font-size: 18px; } /* Increased from 17px for better accessibility */
body {
  color: var(--color-text);
  background: var(--color-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
}

/* Improved base typography and spacing for accessibility */
h1, h2, h3, .box-title { color: var(--color-text); font-weight: 650; }
p { font-size: 1.1rem; line-height: 1.6; color: var(--color-text-muted); } /* Increased from 1rem */
label { font-weight: 600; color: var(--color-text); font-size: var(--dropdown-label-font-size); }


/* Larger, clearer headings across the site - enhanced for senior users */
h1 { font-size: 2.3rem; line-height: 1.25; margin: 12px 0 6px; } /* Increased from 2.2rem */
h2 { font-size: 2.0rem; line-height: 1.3;  margin: 10px 0 6px; } /* Increased from 1.9rem */
h3 { font-size: 1.7rem; line-height: 1.35; margin: 8px 0 4px; } /* Increased from 1.6rem */

/* Make module description paragraphs (immediately following h3) larger for better readability */
.content-wrapper h3 + p { font-size: 1.6rem; line-height: 1.7; } /* Increased from 1.5rem */

/* Bigger box header titles for improved accessibility */
.box .box-header .box-title { font-size: 1.3rem !important; letter-spacing: 0.2px; } /* Increased from 1.2rem */

@media (max-width: 768px) {
  h1 { font-size: 2.1rem; } /* Increased from 2.0rem */
  h2 { font-size: 1.8rem; } /* Increased from 1.7rem */
  h3 { font-size: 1.55rem; } /* Increased from 1.45rem */
  .box .box-header .box-title { font-size: 1.15rem !important; } /* Increased from 1.08rem */
  .content-wrapper h3 + p { font-size: 1.2rem; } /* Increased from 1.1rem */
}

/* Enlarge About tab paragraphs for better accessibility */
#shiny-tab-about .box p {
  font-size: 1.4rem; /* Increased from 1.3rem */
  line-height: 1.75;
}

#shiny-tab-about .box li {
  font-size: 1.4rem; /* Increased from 1.3rem */
  line-height: 1.75;
}


/* Accessible focus styles - primary blue focus ring */
a:focus, button:focus, .btn:focus, .form-control:focus, .selectize-input.focus,
.bootstrap-select .dropdown-toggle:focus {
  outline: none !important;
  box-shadow: var(--focus-ring) !important;
}

/* Secondary teal focus ring for sidebar and navigation elements */
.sidebar-menu a:focus,
.treeview-menu a:focus,
.navbar a:focus {
  outline: none !important;
  box-shadow: var(--focus-ring-secondary) !important;
}


/* Main layout improvements */
.content-wrapper {
  background-color: var(--color-bg) !important;
}
.main-header .logo, .main-header .navbar {
  background: #e8eef5 !important; /* Light blue-gray background for better logo visibility */
  border-bottom: 1px solid #dee2e6;
}
.main-header .logo {
  color: var(--color-text) !important; /* Dark text on light background */
  font-size: 20px; /* Increased from 18px for better readability */
  border-right: 1px solid #dee2e6;
}
/* Sidebar styling - light theme for consistency */
.skin-blue .main-sidebar {
  background-color: #f4f6f9 !important;
  border-right: 1px solid #dee2e6;
  box-shadow: 2px 0 5px rgba(0,0,0,0.05);
}

/* Treeview menu arrow/chevron styling */
.skin-blue .sidebar-menu .treeview-menu>li>a>.fa-angle-left,
.skin-blue .sidebar-menu .treeview-menu>li>a>.pull-right-container>.fa-angle-left {
  color: var(--color-text-muted) !important;
}

.skin-blue .sidebar-menu>li>a>.pull-right-container>.fa-angle-left {
  color: var(--color-text-muted) !important;
}

.skin-blue .sidebar-menu>li.active>a,
.skin-blue .sidebar-menu>li:hover>a {
  background: linear-gradient(90deg,
    rgba(13,94,87,0.12) 0%,
    rgba(13,94,87,0.06) 100%
  ) !important;
  color: var(--color-secondary-teal) !important;
  border-left: 3px solid var(--color-secondary-teal);
}

.skin-blue .sidebar-menu>li>a {
  color: var(--color-text) !important;
  border-left: 3px solid transparent;
}
.skin-blue .main-header .navbar .sidebar-toggle:hover{
  background: rgba(30,58,95,0.1) !important;
}
.skin-blue .main-header .navbar .sidebar-toggle {
  color: var(--color-text) !important;
}

/* Box styling - enhanced with blue-tinted shadows for depth */
.box {
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08),
              0 1px 2px rgba(30,58,95,0.05);
  margin-bottom: 22px;
  background: var(--color-surface);
}
.box-header {
  border-bottom: 1px solid var(--color-muted);
}
.box-header.with-border .box-title { font-size: 1.05rem; }
.box-primary>.box-header { background: transparent; }
.box-primary { border-top-color: var(--color-primary) !important; }

/* Semantic box header colors - differentiated for visual hierarchy and meaning */
.box.box-solid.box-primary > .box-header {
  background-color: var(--color-primary) !important;
  transition: background-color 0.3s ease, transform 0.2s ease;
}
.box.box-solid.box-success > .box-header {
  background-color: var(--color-secondary-sage) !important;  /* Sage green for analytics/data */
  transition: background-color 0.3s ease, transform 0.2s ease;
}
.box.box-solid.box-info > .box-header {
  background-color: var(--color-secondary-aubergine) !important;  /* Aubergine for insights/special */
  transition: background-color 0.3s ease, transform 0.2s ease;
}
.box.box-solid.box-warning > .box-header {
  background-color: var(--color-accent-amber) !important;  /* Amber for important/action items */
  transition: background-color 0.3s ease, transform 0.2s ease;
}
.box.box-solid.box-danger > .box-header {
  background-color: var(--color-accent-terracotta) !important;  /* Terracotta for critical/danger */
  transition: background-color 0.3s ease, transform 0.2s ease;
}

/* Hover states for box headers - subtle polish */
.box.box-solid.box-primary > .box-header:hover {
  background-color: var(--color-primary-600) !important;
}
.box.box-solid.box-success > .box-header:hover {
  background-color: #4a7159 !important;  /* Slightly lighter sage */
}
.box.box-solid.box-info > .box-header:hover {
  background-color: #6b4680 !important;  /* Slightly lighter aubergine */
}
.box.box-solid.box-warning > .box-header:hover {
  background-color: #a86838 !important;  /* Slightly lighter amber */
}
.box.box-solid.box-danger > .box-header:hover {
  background-color: #9f5a4a !important;  /* Slightly lighter terracotta */
}

/* Harmonize solid box border colors to match their header colors */
.box.box-solid.box-primary {
  border: 1px solid var(--color-primary) !important;
}
.box.box-solid.box-success {
  border: 1px solid var(--color-secondary-sage) !important;
}
.box.box-solid.box-info {
  border: 1px solid var(--color-secondary-aubergine) !important;
}
.box.box-solid.box-warning {
  border: 1px solid var(--color-accent-amber) !important;
}
.box.box-solid.box-danger {
  border: 1px solid var(--color-accent-terracotta) !important;
}



/* Summary banner and info tiles use a muted primary background */
.box .callout, .callout.info, .info-box, .small-box.bg-aqua, .bg-aqua {
  background-color: #2a4365 !important; /* dark muted blue */
  color: #ffffff !important;
}
.info-box .progress, .small-box .icon { opacity: 0.65; }

.box-info { border-top-color: var(--color-secondary-aubergine) !important; }
.box-success { border-top-color: var(--color-secondary-sage) !important; }
.box-warning { border-top-color: var(--color-accent-amber) !important; }
.box-danger  { border-top-color: var(--color-accent-terracotta) !important; }

/* Ensure solid box headers keep high-contrast white titles on dark backgrounds */
.box.box-solid.box-primary > .box-header,
.box.box-solid.box-info > .box-header,
.box.box-solid.box-success > .box-header,
.box.box-solid.box-warning > .box-header,
.box.box-solid.box-danger > .box-header {
  color: #ffffff !important;
}
.box.box-solid.box-primary > .box-header .box-title,
.box.box-solid.box-info > .box-header .box-title,
.box.box-solid.box-success > .box-header .box-title,
.box.box-solid.box-warning > .box-header .box-title,
.box.box-solid.box-danger > .box-header .box-title {
  color: #ffffff !important;
}

/* Refined alert styles with sophisticated gradients and accent borders */
.alert-info {
  background: linear-gradient(135deg, #1e3a5f 0%, #2c5f7f 100%) !important;
  border-left: 4px solid #2c5f7f !important;
  border-top: 1px solid rgba(44, 95, 127, 0.3) !important;
  border-right: 1px solid rgba(44, 95, 127, 0.3) !important;
  border-bottom: 1px solid rgba(44, 95, 127, 0.3) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.alert-warning {
  background: linear-gradient(135deg, #92582e 0%, #a86838 100%) !important;
  border-left: 4px solid #c97a42 !important;
  border-top: 1px solid rgba(168, 104, 56, 0.3) !important;
  border-right: 1px solid rgba(168, 104, 56, 0.3) !important;
  border-bottom: 1px solid rgba(168, 104, 56, 0.3) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
/* Icons/controls inside headers */
.box.box-solid > .box-header .fa,
.box.box-solid > .box-header .glyphicon,
.box.box-solid > .box-header .ion,
.box.box-solid > .box-header a,
.box.box-solid > .box-header .btn {
  color: #ffffff !important;
}


.box-header {
  border-bottom: 1px solid #e9ecef;
}

/* Enhanced Value box styling - Sophisticated depth with blue-tinted shadows */
.small-box {
  border-radius: 8px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.12),
              0 1px 3px rgba(30,58,95,0.08);
  min-height: 140px !important;
  width: 100% !important;
  margin-bottom: 15px !important;
  overflow: hidden;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

/* Hover effect for value boxes - subtle lift */
.small-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(0,0,0,0.15),
              0 2px 6px rgba(30,58,95,0.12);
}

/* Ensure value box columns have adequate width */
.col-sm-6 {
  padding: 0 10px !important;
}

/* Improved text display - allow text wrapping for longer content */
.small-box h3 {
  font-size: 2.8rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  margin: 0 0 8px 0 !important;
  color: white !important;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
}

.small-box p {
  font-size: 15px !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  margin: 0 !important;
  color: rgba(255,255,255,0.95) !important;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  max-width: 75% !important;
}

.small-box .inner {
  padding: 20px 20px 25px 20px !important;
  position: relative;
  z-index: 10;
  min-height: 90px !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Improved icon positioning */
.small-box .icon {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 5;
  font-size: 60px !important;
  color: rgba(255,255,255,0.2) !important;
  text-shadow: none;
}

/* Enhanced footer styling */
.small-box .small-box-footer {
  position: relative;
  background: rgba(0,0,0,0.15);
  text-decoration: none;
  z-index: 10;
  padding: 10px 0;
  color: rgba(255,255,255,0.8);
  text-align: center;
  font-size: 14px;
  transition: background-color 0.3s ease;
}

.small-box .small-box-footer:hover {
  background: rgba(0,0,0,0.25);
  color: white;
}

/* Table styling */
.dataTables_wrapper {
  width: 100% !important;
  font-size: 16px;
  line-height: 1.6;
}

/* Ensure table stretches to full width */
.dataTables_wrapper table.dataTable {
  width: 100% !important;
}

/* Handle the scrollX wrapper that DataTables creates */
.dataTables_wrapper .dataTables_scroll {
  width: 100% !important;
}

.dataTables_wrapper .dataTables_scrollBody {
  width: 100% !important;
}

.dataTables_wrapper .dataTables_scrollHead,
.dataTables_wrapper .dataTables_scrollHeadInner {
  width: 100% !important;
}

.dataTables_wrapper .dataTables_scrollHeadInner table {
  width: 100% !important;
}

/* Remove any margin/padding that might prevent full width alignment */
.box-body .dataTables_wrapper {
  margin: 0 !important;
  padding: 0 !important;
}

/* Widget headings align with button color (primary) */
.box .box-header .box-title { color: var(--color-text); }
.box.box-solid .box-header .box-title { color: #ffffff; }

.dataTables_wrapper th {
  font-size: 17px;
  font-weight: 600;
  padding: 12px 8px;
}

.dataTables_wrapper td {
  font-size: 16px;
  padding: 10px 8px;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  margin-bottom: 15px;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  margin-top: 15px;
}

.table-striped > tbody > tr:nth-of-type(odd) {
  background-color: rgba(0,0,0,0.02);
}

/* Alert styling - enhanced with sophisticated design */
.alert {
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.12);
}

/* Plot container styling */
.plotly {
  border-radius: 5px;
}

/* Sidebar menu improvements - refined with teal accent */
.sidebar-menu > li.active > a {
  border-left: 3px solid var(--color-secondary-teal);
}

.sidebar-menu > li > a:hover {
  background: linear-gradient(90deg,
    rgba(13,94,87,0.10) 0%,
    rgba(13,94,87,0.05) 100%
  );
}

/* Submenu (treeview) styling */
.skin-blue .treeview-menu {
  background-color: #e8eef5 !important;
}

.skin-blue .treeview-menu>li>a {
  color: var(--color-text-muted) !important;
  font-size: 1.25rem;
}

.skin-blue .treeview-menu>li>a:hover,
.skin-blue .treeview-menu>li.active>a {
  color: var(--color-secondary-teal) !important;
  background-color: rgba(13,94,87,0.1) !important;
}

/* Sidebar icons */
.skin-blue .sidebar-menu>li>a>.fa,
.skin-blue .sidebar-menu>li>a>.glyphicon,
.skin-blue .sidebar-menu>li>a>.ion {
  color: var(--color-text-muted) !important;
}

.skin-blue .sidebar-menu>li.active>a>.fa,
.skin-blue .sidebar-menu>li.active>a>.glyphicon,
.skin-blue .sidebar-menu>li.active>a>.ion,
.skin-blue .sidebar-menu>li:hover>a>.fa,
.skin-blue .sidebar-menu>li:hover>a>.glyphicon,
.skin-blue .sidebar-menu>li:hover>a>.ion {
  color: var(--color-secondary-teal) !important;
}

/* Filter panel styling */
.form-group { margin-bottom: 14px; }

/* Harmonize status colors with refined gradients */
.bg-yellow, .label-warning {
  background: linear-gradient(135deg, #92582e 0%, #a86838 100%) !important;
  border-color: #92582e !important;
  color: #ffffff !important;
}
.bg-info, .callout.callout-info {
  background: linear-gradient(135deg, #1e3a5f 0%, #2c5f7f 100%) !important;
  border-left: 4px solid #2c5f7f !important;
  color: #ffffff !important;
}


.form-control, .selectize-input, .bootstrap-select .dropdown-toggle {
  border-radius: 6px !important;
  border: 1px solid #d1d5db !important;
  font-size: var(--dropdown-trigger-font-size);
  line-height: 1.35;
  padding: 12px 14px;
}
.selectize-control.single .selectize-input, .bootstrap-select .dropdown-toggle {
  min-height: 52px;
}
.selectize-input, .bootstrap-select .dropdown-toggle {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Larger text inside dropdown lists and search inputs */
/* Selectize menus and items */
.selectize-dropdown,
.selectize-dropdown .option,
.selectize-dropdown .optgroup-header {
  font-size: var(--dropdown-menu-font-size) !important;
}
.selectize-input { font-size: var(--dropdown-trigger-font-size) !important; }
.selectize-input > input { font-size: var(--dropdown-trigger-font-size) !important; }
.selectize-input .item { font-size: var(--dropdown-trigger-font-size) !important; }
.selectize-dropdown .option { padding: 12px 14px; }

/* Bootstrap and bootstrap-select menus */
.dropdown-menu,
.dropdown-menu > li > a,
.dropdown-menu .dropdown-item,
.dropdown-header { font-size: var(--dropdown-menu-font-size) !important; }
.bootstrap-select .dropdown-menu li a,
.bootstrap-select .dropdown-menu .text { font-size: var(--dropdown-menu-font-size) !important; }
.bootstrap-select .dropdown-menu li a { padding: 12px 16px; }
.bootstrap-select .filter-option-inner-inner { font-size: var(--dropdown-trigger-font-size) !important; line-height: 1.35; }

/* Search boxes inside menus */
.bs-searchbox input { font-size: var(--dropdown-search-font-size); height: 48px; }

/* Native select fallback (if selectize disabled) */
select.form-control option { font-size: var(--dropdown-menu-font-size); }

/* High-contrast and accessible states for dropdown options */
.selectize-dropdown .option:hover,
.selectize-dropdown .option.active {
  background-color: var(--color-primary);
  color: #ffffff;
}

/* Default text color inside menus for readability */
.selectize-dropdown, .dropdown-menu { color: var(--color-text); }

/* Bootstrap and bootstrap-select menu item states */
.bootstrap-select .dropdown-menu li a:hover,
.bootstrap-select .dropdown-menu li a:focus,
.bootstrap-select .dropdown-menu li.selected a,
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
  background-color: var(--color-primary);
  color: #ffffff;
}

/* Improve line-height and wrapping to avoid overflow */
.selectize-dropdown .option,
.bootstrap-select .dropdown-menu li a,
.dropdown-menu > li > a {
  line-height: 1.45;
  overflow-wrap: anywhere;
}

/* Multi-select chips in selectize controls */
.selectize-control.multi .selectize-input > div {
  font-size: var(--dropdown-trigger-font-size);
  line-height: 1.35;
}

/* Allow multi-select Selectize controls to wrap and show all selected items */
.selectize-control.multi .selectize-input {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  height: auto;
  min-height: 52px; /* match single-select height */
}
/* Add a little spacing so wrapped chips don't crowd */
.selectize-control.multi .selectize-input > div.item {
  margin-right: 6px;
  margin-bottom: 6px;
}

.form-control:focus, .selectize-input.focus, .bootstrap-select .dropdown-toggle:focus {
  border-color: var(--color-primary) !important;
  box-shadow: var(--focus-ring) !important;
}

/* Unify button colors to match dark primary palette for consistency */
.btn-info, .btn-success, .btn-warning {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: #ffffff !important;
}

/* Button styling */
.btn {
  border-radius: 6px;
  font-weight: 600;
  letter-spacing: .2px;
}

.btn-primary, .bg-light-blue, .bg-aqua {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: var(--color-primary-contrast) !important;
}
.btn-primary:hover { filter: brightness(0.95); }

/* Ensure filled buttons always have white text for readability */
.btn-primary, .btn-info, .btn-success, .btn-warning, .btn-danger {
  color: #ffffff !important;
  text-shadow: none !important;
}
.btn-primary.disabled, .btn-primary:disabled,
.btn-info.disabled, .btn-info:disabled,
.btn-success.disabled, .btn-success:disabled,
.btn-warning.disabled, .btn-warning:disabled,
.btn-danger.disabled, .btn-danger:disabled {
  color: #ffffff !important;
  opacity: 0.8;
}

/* Shiny adds `btn-default` by default; ensure primary/info/etc override its text color */
.btn-default.btn-primary,
.btn-default.btn-info,
.btn-default.btn-success,
.btn-default.btn-warning,
.btn-default.btn-danger,
.action-button.btn-default.btn-primary,
.action-button.btn-default.btn-info,
.action-button.btn-default.btn-success,
.action-button.btn-default.btn-warning,
.action-button.btn-default.btn-danger {
  color: #ffffff !important;
}

/* Also enforce on hover/focus/active states */
.btn-default.btn-primary:hover, .btn-default.btn-primary:focus, .btn-default.btn-primary:active,
.btn-default.btn-info:hover, .btn-default.btn-info:focus, .btn-default.btn-info:active,
.btn-default.btn-success:hover, .btn-default.btn-success:focus, .btn-default.btn-success:active,
.btn-default.btn-warning:hover, .btn-default.btn-warning:focus, .btn-default.btn-warning:active,
.btn-default.btn-danger:hover, .btn-default.btn-danger:focus, .btn-default.btn-danger:active {
  color: #ffffff !important;
}



.btn-warning {
  background-color: #9a3412;
  border-color: #9a3412;
}

.btn-warning:hover {
  filter: brightness(0.95);
}

/* Loading spinner */
.waiter-overlay {
  background-color: rgba(33, 37, 41, 0.85) !important;
}

/* Responsive improvements for wider value boxes */
@media (max-width: 768px) {
  .content-wrapper {
    padding: 10px;
  }

  .box {
    margin-bottom: 15px;
  }

  .small-box {
    min-height: 130px !important;
    margin-bottom: 20px !important;
  }

  .small-box .icon {
    font-size: 50px !important;
    top: 15px;
    right: 15px;
  }

  .small-box h3 {
    font-size: 2.2rem !important;
  }

  .small-box p {
    font-size: 16px !important; /* Increased from 14px for better accessibility */
  }

  .col-sm-6 {
    padding: 0 5px !important;
  }

  .small-box .inner {
    padding: 15px 15px 20px 15px !important;
  }
}

/* Stack value boxes vertically on small screens */
@media (max-width: 576px) {
  .small-box {
    min-height: 120px !important;
    margin-bottom: 15px !important;
  }

  .small-box h3 {
    font-size: 2.0rem !important;
  }

  .small-box p {
    font-size: 16px !important; /* Increased from 13px for better accessibility */
    max-width: 70% !important;
  }

  .small-box .inner {
    padding: 15px 15px 18px 15px !important;
  }

  .small-box .icon {
    font-size: 45px !important;
    top: 10px;
    right: 10px;
  }
}

/* Custom utility classes */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mb-20 {
  margin-bottom: 20px;
}

.mt-10 {
  margin-top: 10px;
}

/* Final override with refined gradients for info elements everywhere */
.alert.alert-info,
.callout.callout-info,
.bg-aqua, .bg-light-blue,
.label-info,
.small-box.bg-aqua,
.info-box.bg-aqua {
  background: linear-gradient(135deg, #1e3a5f 0%, #2c5f7f 100%) !important;
  border-color: #2c5f7f !important;
  color: #ffffff !important;
}

/* Ensure readable text inside dark info banners */
.alert.alert-info h1,
.alert.alert-info h2,
.alert.alert-info h3,
.alert.alert-info h4,
.alert.alert-info h5,
.alert.alert-info p,
.alert.alert-info span,
.alert.alert-info a {
  color: #ffffff !important;
}

/* Emphasized metric style used for key totals (e.g., Total sales) */
.metric-emphasis {
  font-size: 1.3rem !important; /* Increased from 1.2rem for better visibility */
  font-weight: 700 !important;
  line-height: 1.35 !important;
}

/* Final override with refined gradients for warning elements everywhere */
.alert.alert-warning,
.callout.callout-warning {
  background: linear-gradient(135deg, #92582e 0%, #a86838 100%) !important;
  border-left: 4px solid #c97a42 !important;
  border-top: 1px solid rgba(168, 104, 56, 0.3) !important;
  border-right: 1px solid rgba(168, 104, 56, 0.3) !important;
  border-bottom: 1px solid rgba(168, 104, 56, 0.3) !important;
  color: #ffffff !important;
}




/* Refined genre color indicators - harmonized with palette */
.genre-fiction { color: #8b4a3a; }      /* Muted terracotta */
.genre-nonfiction { color: #2c5f7f; }   /* Deep azure */
.genre-poetry { color: #5b3a70; }       /* Muted aubergine */
.genre-drama { color: #92582e; }        /* Muted amber */
.genre-juvenile { color: #3f5f4a; }     /* Sage green */
.genre-short { color: #0d5e57; }        /* Deep teal */
.genre-biography { color: #6b7280; }    /* Warm gray */

/* Refined gender color indicators - professional tones */
.gender-male { color: #2c5f7f; }        /* Deep azure */
.gender-female { color: #8b4a3a; }      /* Muted terracotta */

/* Logo styling for header and branding */
.header-logo-container {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 5px 15px;
  height: 50px;
  gap: 20px;
}

.header-logo {
  height: 35px;
  width: auto;
  object-fit: contain;
  transition: opacity 0.3s ease;
}

.header-logo:hover {
  opacity: 0.85;
}

/* Dashboard branding banner - sophisticated multi-stop gradient */
.dashboard-branding-banner {
  background: linear-gradient(135deg,
    #14293f 0%,      /* Darker navy for depth */
    #1e3a5f 40%,     /* Primary navy */
    #2a4365 70%,     /* Lighter navy */
    #2c5f7f 100%     /* Touch of azure for sophistication */
  );
  border-radius: 8px;
  padding: 25px 30px;
  margin-bottom: 25px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15), 0 1px 3px rgba(30,58,95,0.1);
  text-align: center;
}

.dashboard-branding-banner .banner-text {
  width: 100%;
}

.dashboard-branding-banner h2 {
  color: #ffffff;
  margin: 0 0 8px 0;
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.3;
}

.dashboard-branding-banner p {
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  font-size: 1.4rem;
  line-height: 1.5;
}

/* About page logo section - low profile */
.about-logos-section {
  text-align: center;
  padding: 20px 15px;
  background: #f8f9fa;
  border-radius: 6px;
  margin-bottom: 20px;
  border: 1px solid #e5e7eb;
}

.about-logos-section h4 {
  color: #6c757d;
  margin: 0 0 12px 0;
  font-size: 1.1rem;
  font-weight: 500;
}

.about-logos-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.about-logo {
  height: 50px;
  width: auto;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.8);
  padding: 8px 12px;
  border-radius: 4px;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

/* Make the Penn State CLA logo larger as it appears smaller */
.about-logo-cla {
  height: 90px;
  padding: 14px 20px;
}

.about-logo:hover {
  opacity: 1;
}

/* Responsive adjustments for logos */
@media (max-width: 768px) {
  .header-logo-container {
    justify-content: center;
    padding: 5px 10px;
    gap: 15px;
  }

  .header-logo {
    height: 28px;
  }

  .dashboard-branding-banner {
    padding: 20px;
  }

  .dashboard-branding-banner h2 {
    font-size: 2.0rem;
  }

  .dashboard-branding-banner p {
    font-size: 1.25rem;
  }

  .about-logos-section {
    padding: 15px 12px;
  }

  .about-logos-section h4 {
    font-size: 1rem;
  }

  .about-logos-container {
    gap: 15px;
  }

  .about-logo {
    height: 42px;
    padding: 6px 10px;
  }

  .about-logo-cla {
    height: 70px;
    padding: 12px 16px;
  }
}

@media (max-width: 576px) {
  .header-logo {
    height: 24px;
  }

  .dashboard-branding-banner {
    padding: 15px;
  }

  .dashboard-branding-banner h2 {
    font-size: 1.75rem;
  }

  .about-logo {
    height: 36px;
    padding: 5px 8px;
  }

  .about-logo-cla {
    height: 60px;
    padding: 10px 14px;
  }
}