/* Modern Table Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Color palette */
  --primary: #4f46e5;
  --primary-light: #e0e7ff;
  --primary-dark: #4338ca;
  --secondary: #0ea5e9;
  --secondary-light: #e0f2fe;
  --secondary-dark: #0369a1;
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  
  /* Border radius */
  --radius-sm: 0.25rem;
  --radius: 0.5rem;
  --radius-md: 0.75rem;
  
  /* Transitions */
  --transition: all 0.2s ease-in-out;
}

/* Base table styles */
th {
  text-align: left;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
}

/* Info table - clean and minimal */
.info {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 1.5rem;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
}

.info th {
  padding: 1rem;
  color: var(--primary-dark);
  background-color: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  width: 0;
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.875rem;
}

.info td {
  padding: 1rem;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-700);
  font-size: 0.875rem;
}

.info tr:last-child th,
.info tr:last-child td {
  border-bottom: none;
}

/* Main data table */
.table {
  clear: both;
  width: 100%;
  margin: 0 0 1.5rem 0;
  border-spacing: 0;
  border-collapse: separate;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.875rem;
  box-shadow: var(--shadow-md);
  border-radius: var(--radius);
  overflow: hidden;
}

.table caption {
  padding: 0.5rem 0;
  width: 100%;
  font-style: italic;
  font-size: 0.875rem;
  text-align: right;
  color: var(--gray-600);
}

.table th {
  font-weight: 600;
  color: var(--gray-800);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: left;
  padding: 1rem;
  background: linear-gradient(to bottom, var(--gray-50), white);
  border-bottom: 2px solid var(--gray-200);
  position: relative;
  white-space: nowrap;
  font-size: 0.75rem;
}

.table th.first {
  border-top-left-radius: var(--radius);
}

.table th.nobg {
  background: none;
}

.table td {
  padding: 0.875rem 1rem;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-200);
  transition: var(--transition);
}

.table tbody tr:hover,
.table_report tbody tr:hover {
  background-color: var(--primary-light);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:last-child td:first-child {
  border-bottom-left-radius: var(--radius);
}

.table tbody tr:last-child td:last-child {
  border-bottom-right-radius: var(--radius);
}

.table td.alt {
  color: var(--gray-600);
  background-color: var(--gray-50);
}

/* Sorting indicators with modern icons */
.table th.sorting_asc,
.table th.sorting_desc,
.table th.sorting {
  cursor: pointer;
  padding-right: 2rem;
}

.table th.sorting_asc::after,
.table th.sorting_desc::after,
.table th.sorting::after {
  content: '';
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.875rem;
  height: 0.875rem;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.5;
  transition: var(--transition);
}


.table th.sorting_asc::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b5563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 15l-6-6-6 6'/%3E%3C/svg%3E");
  opacity: 1;
}

.table th.sorting_desc::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b5563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  opacity: 1;
}

.table th.sorting::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b5563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 15l-6-6-6 6'/%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

.table th:hover.sorting::after {
  opacity: 1;
}

.table th.sorting_asc_disabled::after,
.table th.sorting_desc_disabled::after {
  opacity: 0.2;
  cursor: not-allowed;
}

/* Solid table style */
.table_solid {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
}

.table_solid th {
  padding: 1rem;
  background: linear-gradient(to right, var(--primary), var(--primary-dark));
  color: white;
  font-weight: 600;
  text-align: left;
  border: none;
  font-size: 0.875rem;
}

.table_solid td {
  padding: 0.875rem 1rem;
  border-top: 1px solid var(--gray-200);
  color: var(--gray-700);
  font-size: 0.875rem;
}

.table_solid tr:nth-child(even) td {
  background-color: var(--gray-50);
}

.table_solid tr:hover td {
  background-color: var(--primary-light);
}

/* Print table style */
.table_print {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.table_print th {
  padding: 0.75rem;
  background-color: var(--gray-100);
  border: 1px solid var(--gray-300);
  text-align: center;
  font-weight: 600;
  color: var(--gray-800);
  font-size: 0.875rem;
}

.table_print td {
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
  font-size: 0.875rem;
}

/* Form table style */
.table_form {
  width: 98%;
  margin: 0 auto 1.5rem auto;
  border-collapse: separate;
  border-spacing: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.table_form th {
  padding: 0.75rem 1rem;
  text-align: right;
  vertical-align: top;
  width: 30%;
  color: var(--gray-700);
  font-weight: 600;
  font-size: 0.875rem;
}

.table_form td {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Report table style */
.table_report {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 1.5rem;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
}

.table_report th {
  padding: 1rem;
  text-align: center;
  background: linear-gradient(to bottom, var(--gray-100), white);
  border-bottom: 2px solid var(--gray-300);
  color: var(--gray-800);
  font-weight: 600;
  position: relative;
  font-size: 0.875rem;
}

.table_report td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-700);
  font-size: 0.875rem;
}

.table_report tbody tr:last-child td {
  border-bottom: none;
}

.table_report tbody tr:hover {
  background-color: var(--primary-light);
}

/* Report table sorting indicators */
.table_report th.sorting_asc,
.table_report th.sorting_desc,
.table_report th.sorting {
  cursor: pointer;
  padding-right: 2rem;
}


.table_report th.sorting_asc::after,
.table_report th.sorting_desc::after,
.table_report th.sorting::after {
  content: '';
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.875rem;
  height: 0.875rem;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.5;
  transition: var(--transition);
}

.table_report th.sorting_asc::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b5563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 15l-6-6-6 6'/%3E%3C/svg%3E");
  opacity: 1;
}

.table_report th.sorting_desc::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b5563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  opacity: 1;
}

.table_report th.sorting::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b5563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 15l-6-6-6 6'/%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

/* Print document container */
.print_doc {
  width: 100%;
  max-width: 890px;
  margin: 0 auto;
  background: white;
  font-size: 1rem;
  padding: 2rem;
  box-shadow: var(--shadow-md);
  border-radius: var(--radius);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.print_doc #btnDisappearPrint {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.print_doc #btnDisappearPrint:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .table, .table_solid, .table_print, .table_report {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .info th, .info td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
  
  .info th {
    border-bottom: none;
    padding-bottom: 0;
  }
  
  .table_form th, .table_form td {
    display: block;
    width: 100%;
    text-align: left;
    box-sizing: border-box;
  }
  
  .table_form th {
    padding-bottom: 0.25rem;
  }
  
  .table_form td {
    padding-top: 0.25rem;
  }
  
  .print_doc {
    padding: 1rem;
  }
}

/* Zebra striping for better readability */
.table tbody tr:nth-child(even),
.table_report tbody tr:nth-child(even) {
  background-color: var(--gray-50);
}

.table tbody tr:nth-child(even):hover,
.table_report tbody tr:nth-child(even):hover {
  background-color: var(--primary-light);
}

/* Utility classes for table cells */
.cell-center {
  text-align: center;
}

.cell-right {
  text-align: right;
}

.cell-highlight {
  font-weight: 600;
  color: var(--primary-dark);
}

.cell-success {
  color: var(--success);
}

.cell-warning {
  color: var(--warning);
}

.cell-danger {
  color: var(--danger);
}

/* Status badges for tables */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
}

.status-badge.success {
  background-color: var(--success-light);
  color: var(--success);
}

.status-badge.warning {
  background-color: var(--warning-light);
  color: var(--warning);
}

.status-badge.danger {
  background-color: var(--danger-light);
  color: var(--danger);
}

/* Animation for row hover */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.2);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(79, 70, 229, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
  }
}


.table tr:hover td:first-child,
.table_report tr:hover td:first-child {
  position: relative;
}

.table tr:hover td:first-child::before,
.table_report tr:hover td:first-child::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background-color: var(--primary);
  animation: pulse 1.5s infinite;
}
