/* Medical Table View Styles - Reusable for all medical pages */

/* Updated Controls Layout */
.medical-page-controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 2rem;
  gap: 1rem;
}

.controls-left {
  justify-self: start;
}

.controls-center {
  justify-self: center;
}

.controls-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* View Toggle Controls */
.view-toggle-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.view-toggle {
  display: flex;
  background: var(--color-bg-primary, white);
  border: 2px solid var(--color-border-light, #e9ecef);
  border-radius: var(--border-radius-md, 5px);
  overflow: hidden;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.1));
}

.view-toggle-btn {
  background: transparent;
  border: none;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 500;
  color: var(--color-text-secondary, #6c757d);
  transition: var(--transition-all, all 0.3s ease);
  border-right: 1px solid var(--color-border-light, #e9ecef);
}

.view-toggle-btn:last-child {
  border-right: none;
}

.view-toggle-btn:hover {
  background: var(--color-bg-secondary, #f8f9fa);
  color: var(--color-text-primary, #333);
}

.view-toggle-btn.active {
  background: var(--color-primary, #667eea);
  color: var(--color-text-light, white);
}

.print-button {
  background: var(--color-info, #17a2b8);
  color: var(--color-text-light, white);
  border: none;
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius-md, 5px);
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition-all, all 0.3s ease);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(23, 162, 184, 0.3));
}

.print-button:hover {
  background: var(--color-info-dark, #138496);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md, 0 2px 8px rgba(23, 162, 184, 0.4));
}

/* Table Layout for Medical Data */
.medications-table-container {
  background: var(--color-bg-primary, white);
  border-radius: var(--border-radius-lg, 8px);
  box-shadow: var(--shadow-lg, 0 5px 15px rgba(0, 0, 0, 0.08));
  overflow: hidden;
  border: 1px solid var(--color-border-light, #e9ecef);
}

.print-header {
  padding: 1.5rem 2rem;
  background: var(--color-bg-secondary, #f8f9fa);
  border-bottom: 2px solid var(--color-border-light, #e9ecef);
  text-align: center;
}

.print-header h2 {
  margin: 0 0 0.5rem 0;
  color: var(--color-text-primary, #333);
  font-size: 1.5rem;
}

.print-header p {
  margin: 0;
  color: var(--color-text-secondary, #6c757d);
  font-size: 0.9rem;
}

.medications-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.medications-table th {
  background: var(--color-primary, #667eea);
  color: var(--color-text-light, white);
  padding: 1rem 0.75rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--color-primary-dark, #5a6fd8);
  white-space: nowrap;
}

.medications-table th:first-child {
  padding-left: 1.5rem;
}

.medications-table th:last-child {
  padding-right: 1.5rem;
}

.medications-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--color-border-light, #e9ecef);
  vertical-align: top;
  word-wrap: break-word;
  max-width: 200px;
}

.medications-table td:first-child {
  padding-left: 1.5rem;
}

.medications-table td:last-child {
  padding-right: 1.5rem;
}

.medications-table tbody tr:hover {
  background: var(--color-bg-secondary, #f8f9fa);
}

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

.medication-name,
.primary-field {
  font-weight: 600;
  color: var(--color-text-primary, #333);
  min-width: 150px;
}

.status-badge-small {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: var(--border-radius-sm, 3px);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}

.table-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  white-space: nowrap;
}

.edit-button-small,
.delete-button-small,
.view-button-small {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--border-radius-sm, 3px);
  transition: var(--transition-all, all 0.2s ease);
  font-size: 1rem;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-button-small:hover {
  background: var(--color-info-light, rgba(23, 162, 184, 0.1));
}

.edit-button-small:hover {
  background: var(--color-warning-light, rgba(255, 193, 7, 0.1));
}

.delete-button-small:hover {
  background: var(--color-danger-light, rgba(220, 53, 69, 0.1));
}

/* File indicator styling for lab results */
.file-indicator {
  color: var(--color-success, #28a745);
  font-weight: 500;
}

.no-files {
  color: var(--color-text-secondary, #6c757d);
  font-style: italic;
}

/* Responsive Table */


/* Print Styles */
@page {
  size: landscape;
  margin: 0.5in;
}


/* Filtering Section Styles */
.medical-page-filters {
  background: var(--color-bg-light, #f8f9fa);
  border: 1px solid var(--color-border-light, #e9ecef);
  border-radius: var(--border-radius-md, 8px);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.1));
}

.filters-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}



.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-group label {
  font-weight: 600;
  color: var(--color-text-primary, #2c3e50);
  font-size: 0.9rem;
}

.search-input {
  padding: 0.75rem 1rem;
  border: 2px solid var(--color-border-light, #e9ecef);
  border-radius: var(--border-radius-sm, 5px);
  font-size: 1rem;
  transition: var(--transition-all, all 0.3s ease);
  background: white;
}

.search-input:focus {
  outline: none;
  border-color: var(--color-primary, #3498db);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.filter-select {
  padding: 0.75rem 1rem;
  border: 2px solid var(--color-border-light, #e9ecef);
  border-radius: var(--border-radius-sm, 5px);
  font-size: 1rem;
  background: white;
  transition: var(--transition-all, all 0.3s ease);
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: var(--color-primary, #3498db);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.clear-filters-btn {
  background: var(--color-secondary, #95a5a6);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius-sm, 5px);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-all, all 0.3s ease);
  height: fit-content;
}

.clear-filters-btn:hover {
  background: var(--color-secondary-dark, #7f8c8d);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md, 0 4px 8px rgba(0, 0, 0, 0.15));
}

.filter-summary {
  text-align: center;
  color: var(--color-text-secondary, #6c757d);
  font-size: 0.9rem;
  font-style: italic;
  padding: 0.5rem;
  background: white;
  border-radius: var(--border-radius-sm, 4px);
  border: 1px solid var(--color-border-light, #e9ecef);
}

.active-filters-indicator {
  color: var(--color-primary, #3498db);
  font-weight: 600;
  font-style: normal;
}

/* Print-specific styles */
