/* Premium Design System for IBSC Student Statistics Dashboard */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Sarabun:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  /* Color Palette (Morning Butter & Blue Grey Theme) */
  --morning-butter: #F3D98F;
  --morning-butter-hover: #e2c575;
  --morning-butter-dark: #b8983d;
  --morning-butter-light: #fdf5df;
  
  --blue-grey: #7298C7;
  --blue-grey-hover: #577fa9;
  --blue-grey-light: #e3ecf5;
  
  --bg-primary: #0f172a; /* slate-900 */
  --bg-secondary: #1e293b; /* slate-800 */
  --bg-card: rgba(30, 41, 59, 0.95);
  --border-color: rgba(114, 152, 199, 0.2); /* soft blue-grey border */
  
  --text-primary: #f8fafc; /* slate-50 */
  --text-secondary: #cbd5e1; /* slate-300 */
  --text-muted: #94a3b8; /* slate-400 */
  
  --success: #10b981;
  --danger: #ef4444;
  --info: var(--blue-grey);
  
  --card-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.5);
  --transition-speed: 0.3s;
}

/* Light Theme Variables - OPTIMIZED FOR HIGH CONTRAST AND COHESIVENESS */
[data-theme="light"] {
  --bg-primary: #f1f5f9; /* slate-100 */
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --border-color: #cbd5e1; /* slate-300 */
  
  --text-primary: #0f172a; /* slate-900 */
  --text-secondary: #1e293b; /* slate-800 */
  --text-muted: #475569; /* slate-600 */
  
  --card-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
}

/* Base Styles with Sarabun Integration for Uniform Proportions */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  /* Using Sarabun as primary font for perfect uniform proportions of Thai & English */
  font-family: 'Sarabun', 'Outfit', sans-serif;
  font-size: 16px; /* standard clean web size */
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  transition: background-color var(--transition-speed), color var(--transition-speed);
  padding-bottom: 4rem;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

/* Premium Header Banner */
header {
  background: var(--bg-secondary);
  border-bottom: 3px solid var(--morning-butter); /* elegant Morning Butter bottom border */
  padding: 1.2rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] header {
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.title-section h1 {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.title-section p {
  font-size: 0.9rem;
  color: var(--blue-grey);
  font-weight: 600;
  margin-top: 0.1rem;
}

[data-theme="dark"] .title-section p {
  color: var(--morning-butter);
}

.controls-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.4rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  border: 2px solid transparent;
}

.btn-primary {
  background-color: var(--blue-grey);
  color: #ffffff;
}

[data-theme="dark"] .btn-primary {
  background-color: var(--morning-butter);
  color: #0f172a;
}

.btn-primary:hover {
  background-color: var(--blue-grey-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(114, 152, 199, 0.3);
}

[data-theme="dark"] .btn-primary:hover {
  background-color: var(--morning-butter-hover);
  box-shadow: 0 4px 12px rgba(243, 217, 143, 0.3);
}

.btn-outline {
  background-color: transparent;
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

.btn-outline:hover {
  background-color: var(--bg-secondary);
  border-color: var(--blue-grey);
}

.btn-theme {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background-color: var(--bg-secondary);
  border: 2px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-speed);
}

.btn-theme:hover {
  background-color: var(--bg-primary);
  border-color: var(--blue-grey);
  transform: scale(1.05);
}

/* Tabs Navigation */
.tabs-container {
  display: flex;
  justify-content: center;
  margin: 1.5rem 0 2.5rem 0;
  background: var(--bg-secondary);
  padding: 0.4rem;
  border-radius: 12px;
  border: 2px solid var(--border-color);
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: var(--card-shadow);
}

.tab-btn {
  flex: 1;
  padding: 0.75rem 1.5rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border-radius: 8px;
  transition: all var(--transition-speed);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

[data-theme="light"] .tab-btn {
  color: #475569;
}

.tab-btn.active {
  background-color: var(--blue-grey);
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(114, 152, 199, 0.2);
}

[data-theme="dark"] .tab-btn.active {
  background-color: var(--morning-butter);
  color: #0f172a !important;
  box-shadow: 0 4px 12px rgba(243, 217, 143, 0.2);
}

/* Hero Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-top: 4px solid var(--blue-grey); /* top brand color border line */
  padding: 1.5rem 1.75rem;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

[data-theme="dark"] .stat-card {
  border-top-color: var(--morning-butter);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.2);
  border-color: var(--blue-grey);
}

[data-theme="dark"] .stat-card:hover {
  border-color: var(--morning-butter);
}

.stat-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #ffffff;
  flex-shrink: 0;
}

/* Match the exact blue-grey and morning-butter color tone */
.icon-total { background: linear-gradient(135deg, var(--blue-grey), var(--blue-grey-hover)); }
.icon-clergy { background: linear-gradient(135deg, var(--morning-butter-dark), var(--morning-butter)); color: #0f172a; } 
.icon-laity { background: linear-gradient(135deg, var(--blue-grey), var(--blue-grey-hover)); } 
.icon-thai { background: linear-gradient(135deg, var(--morning-butter-dark), var(--morning-butter)); color: #0f172a; } 
.icon-foreign { background: linear-gradient(135deg, var(--blue-grey), var(--blue-grey-hover)); } 

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-top: 0.1rem;
}

.stat-percentage {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
  font-weight: 600;
}

/* Charts Grid */
.charts-grid-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 992px) {
  .charts-grid-main {
    grid-template-columns: 1fr;
  }
}

.charts-grid-sub {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 992px) {
  .charts-grid-sub {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-top: 4px solid var(--blue-grey);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
}

[data-theme="dark"] .chart-card {
  border-top-color: var(--morning-butter);
}

.chart-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.chart-title span.badge {
  font-size: 0.8rem;
  background-color: var(--bg-secondary);
  color: var(--blue-grey);
  padding: 0.2rem 0.8rem;
  border-radius: 20px;
  border: 2px solid var(--border-color);
  font-weight: 700;
}

[data-theme="dark"] .chart-title span.badge {
  color: var(--morning-butter);
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 330px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Tables Section */
.data-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-top: 4px solid var(--blue-grey);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: var(--card-shadow);
  margin-bottom: 2.5rem;
}

[data-theme="dark"] .data-card {
  border-top-color: var(--morning-butter);
}

.table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 2px solid var(--border-color);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

th {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 700;
  padding: 1rem;
  border-bottom: 3px solid var(--border-color);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-weight: 500;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background-color: rgba(114, 152, 199, 0.06) !important;
  color: var(--text-primary);
}

/* Summary Table Specific */
.table-summary th:nth-child(n+3), 
.table-summary td:nth-child(n+3) {
  text-align: center;
}

.highlight-row {
  font-weight: 700;
  background-color: var(--bg-secondary) !important;
}

.highlight-row td {
  color: var(--blue-grey) !important;
  font-weight: 700;
  border-top: 2px solid var(--border-color);
}

[data-theme="dark"] .highlight-row td {
  color: var(--morning-butter) !important;
}

/* Directory Section controls */
.directory-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 1.2rem;
}

@media (max-width: 992px) {
  .directory-controls {
    flex-direction: column;
    align-items: stretch;
  }
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  max-width: 450px;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.8rem;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all var(--transition-speed);
}

.search-input:focus {
  outline: none;
  border-color: var(--blue-grey);
  box-shadow: 0 0 0 3px rgba(114, 152, 199, 0.15);
}

[data-theme="dark"] .search-input:focus {
  border-color: var(--morning-butter);
  box-shadow: 0 0 0 3px rgba(243, 217, 143, 0.15);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.filter-selects {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

@media (max-width: 576px) {
  .filter-selects {
    flex-direction: column;
  }
}

.select-filter {
  padding: 0.75rem 2rem 0.75rem 1rem;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-speed);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 0.9rem;
}

[data-theme="light"] .select-filter {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231e293b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.select-filter:focus {
  outline: none;
  border-color: var(--blue-grey);
}

/* Badge tags in list */
.badge-status {
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-block;
  text-align: center;
}

.badge-clergy {
  background-color: rgba(243, 217, 143, 0.15); /* Morning Butter background */
  color: var(--morning-butter);
  border: 1.5px solid rgba(243, 217, 143, 0.3);
}

[data-theme="light"] .badge-clergy {
  background-color: rgba(243, 217, 143, 0.12);
  color: #a2832c; /* darker butter for visibility */
  border-color: rgba(243, 217, 143, 0.4);
}

.badge-laity {
  background-color: rgba(114, 152, 199, 0.15); /* Blue Grey background */
  color: #9ac2f0;
  border: 1.5px solid rgba(114, 152, 199, 0.3);
}

[data-theme="light"] .badge-laity {
  background-color: rgba(114, 152, 199, 0.1);
  color: #3b6695; /* darker blue-grey for readability */
  border-color: rgba(114, 152, 199, 0.4);
}

.badge-thai {
  background-color: rgba(243, 217, 143, 0.15);
  color: var(--morning-butter);
  border: 1.5px solid rgba(243, 217, 143, 0.3);
}

[data-theme="light"] .badge-thai {
  background-color: rgba(243, 217, 143, 0.12);
  color: #a2832c;
  border-color: rgba(243, 217, 143, 0.4);
}

.badge-foreign {
  background-color: rgba(114, 152, 199, 0.15);
  color: #9ac2f0;
  border: 1.5px solid rgba(114, 152, 199, 0.3);
}

[data-theme="light"] .badge-foreign {
  background-color: rgba(114, 152, 199, 0.1);
  color: #3b6695;
  border-color: rgba(114, 152, 199, 0.4);
}

.badge-year {
  background-color: var(--blue-grey-light);
  color: #3b6695;
  font-weight: 700;
  border: 1px solid rgba(114, 152, 199, 0.4);
}

[data-theme="dark"] .badge-year {
  background-color: rgba(243, 217, 143, 0.15);
  color: var(--morning-butter);
  border: 1px solid rgba(243, 217, 143, 0.3);
}

/* Country flag helper in tables */
.flag-icon {
  margin-right: 0.5rem;
  font-size: 1.25rem;
  vertical-align: middle;
  display: inline-block;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.pagination-buttons {
  display: flex;
  gap: 0.5rem;
}

/* Country list tables side-by-side */
.country-list-tables {
  display: flex;
  gap: 1.2rem;
  width: 100%;
}

@media (max-width: 992px) {
  .country-list-tables {
    flex-direction: column;
    gap: 1rem;
  }
}

.table-country-col {
  flex: 1;
  border-collapse: collapse;
  font-size: 0.9rem;
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(114, 152, 199, 0.03);
}

.table-country-col th {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 700;
  padding: 0.5rem 0.6rem;
  border-bottom: 2px solid var(--border-color);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.table-country-col td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-country-col tr:last-child td {
  border-bottom: none;
}

.table-country-col tr:hover td {
  background-color: rgba(114, 152, 199, 0.08);
}

.country-text-span {
  display: inline-block;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Print Stylesheet Integration */
@media print {
  :root {
    --bg-primary: #ffffff !important;
    --bg-secondary: #ffffff !important;
    --bg-card: #ffffff !important;
    --border-color: #cbd5e1 !important;
    
    --text-primary: #0f172a !important;
    --text-secondary: #1e293b !important;
    --text-muted: #475569 !important;
  }

  @page {
    size: A4 portrait;
    margin: 1.2cm 1cm 1.2cm 1cm;
  }
  
  body {
    background-color: #ffffff !important;
    color: #000000 !important;
    padding-bottom: 0 !important;
    font-size: 9.5pt !important;
  }
  
  .container {
    max-width: 100% !important;
    padding: 0 !important;
  }
  
  header,
  .tabs-container,
  .controls-section,
  .directory-controls,
  .pagination,
  .btn-theme,
  .btn,
  .search-input-wrapper,
  .filter-selects,
  #directoryCard,
  .data-card {
    display: none !important;
  }
  
  .stats-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 0.5cm !important;
    margin-bottom: 1cm !important;
  }
  
  .stat-card {
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    box-shadow: none !important;
    padding: 0.4cm !important;
    border-radius: 8px !important;
    page-break-inside: avoid;
  }
  
  .stat-icon {
    width: 38px !important;
    height: 38px !important;
    font-size: 1.1rem !important;
  }
  
  .stat-value {
    font-size: 1.4rem !important;
  }
  
  .charts-grid-main {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.8cm !important;
    margin-bottom: 0.8cm !important;
  }
  
  .charts-grid-sub {
    grid-template-columns: 1fr !important;
    gap: 0.8cm !important;
    margin-bottom: 0.8cm !important;
  }
  
  .charts-grid-sub > div {
    grid-column: span 1 !important;
    page-break-inside: avoid;
  }

  .country-list-tables {
    display: flex !important;
    flex-direction: row !important;
    gap: 0.3cm !important;
    width: 100% !important;
  }
  
  .table-country-col {
    font-size: 8pt !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    border-radius: 6px !important;
  }
  
  .table-country-col th {
    background-color: #f8fafc !important;
    color: #000000 !important;
    border-bottom: 1.5px solid #cbd5e1 !important;
    padding: 0.15cm 0.2cm !important;
    font-size: 7.5pt !important;
  }
  
  .table-country-col td {
    padding: 0.12cm 0.2cm !important;
    border-bottom: 1px solid #cbd5e1 !important;
    color: #1e293b !important;
  }
  
  .country-text-span {
    max-width: 85px !important;
  }
  
  .chart-card,
  .data-card {
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    box-shadow: none !important;
    padding: 0.5cm !important;
    border-radius: 8px !important;
    page-break-inside: avoid;
    margin-bottom: 0.8cm !important;
  }
  
  .chart-wrapper {
    height: 250px !important;
  }
  
  .table-wrapper {
    border: 1.5px solid #cbd5e1 !important;
  }
  
  table {
    font-size: 9pt !important;
  }
  
  th {
    background-color: #f8fafc !important;
    color: #000000 !important;
    border-bottom: 2.5px solid #94a3b8 !important;
    padding: 0.25cm 0.3cm !important;
  }
  
  td {
    color: #1e293b !important;
    border-bottom: 1.5px solid #cbd5e1 !important;
    padding: 0.25cm 0.3cm !important;
  }
  
  .highlight-row {
    background-color: #f8fafc !important;
  }
  
  .highlight-row td {
    color: #577fa9 !important;
  }
  
  .print-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px double #7298C7;
    padding-bottom: 0.4cm;
    margin-bottom: 0.8cm;
  }
  
  .print-header-title {
    text-align: left;
  }
  
  .print-header-title h1 {
    font-size: 1.7rem;
    font-weight: 700;
    color: #000000;
  }
  
  .print-header-title p {
    font-size: 0.95rem;
    color: #577fa9;
    font-weight: 600;
    margin-top: 0.1cm;
  }
  
  .print-date {
    font-size: 0.85rem;
    color: #475569;
    text-align: right;
  }
}

.print-header {
  display: none;
}

/* Mobile & Tablet Responsive Styles */
@media (max-width: 768px) {
  header {
    padding: 1rem 1.25rem;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    text-align: center;
    position: relative; /* Remove sticky on mobile to save screen space */
  }
  
  .logo-section {
    flex-direction: column;
    gap: 0.6rem;
    text-align: center;
  }
  
  .title-section h1 {
    font-size: 1.35rem;
  }
  
  .title-section p {
    font-size: 0.8rem;
  }
  
  .controls-section {
    width: 100%;
    justify-content: center;
    gap: 0.75rem;
  }
  
  .container {
    padding: 1rem 0.5rem;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .stat-card {
    padding: 1rem;
    gap: 0.75rem;
    border-radius: 12px;
  }
  
  .stat-icon {
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
  }
  
  .stat-label {
    font-size: 0.75rem;
  }
  
  .stat-value {
    font-size: 1.4rem;
  }
  
  .stat-percentage {
    font-size: 0.7rem;
  }
  
  .chart-card, .data-card {
    padding: 1rem;
    border-radius: 12px;
  }
  
  .chart-title {
    font-size: 1rem;
    margin-bottom: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .chart-wrapper {
    height: 260px;
  }
  
  .tabs-container {
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
    margin: 1rem auto;
    padding: 0.35rem;
  }
  
  .tab-btn {
    padding: 0.55rem;
    font-size: 0.85rem;
  }
  
  .directory-controls {
    gap: 0.85rem;
  }
  
  .filter-selects {
    gap: 0.5rem;
  }
  
  .select-filter {
    padding: 0.6rem 1.8rem 0.6rem 0.75rem;
    font-size: 0.85rem;
    width: 100%;
  }
  
  .search-input {
    padding: 0.6rem 1rem 0.6rem 2.4rem;
    font-size: 0.85rem;
  }
  
  .search-icon {
    left: 0.85rem;
  }
  
  .pagination {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  #printReportBtn span {
    display: none; /* Hide print button text on very small screens to save space */
  }
  
  #printReportBtn {
    padding: 0.6rem;
  }
}
