/* medical-records — app-specific styles.
   Shared tokens + chrome (body, .container, .content, .btn, .auth-screen,
   .google-btn, masthead, beta notice) come from theme.css. This app is wide,
   so it overrides the container width below. */

:root {
  /* This app's tables are wide — widen the shared container. */
  --container-max: 1400px;
}

.auth-container {
  text-align: center;
  padding: 60px 20px;
}

.auth-container h2 {
  margin-bottom: 20px;
  color: #333;
}

.auth-container p {
  margin-bottom: 30px;
  color: #666;
}

.info-bar {
  background: #f8f9fa;
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.controls {
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.search-box, .filter-select {
  padding: 10px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
}

.search-box {
  flex: 1;
  min-width: 200px;
}

.role-filters {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  align-items: center;
  padding: 10px 15px;
  background: #f8f9fa;
  border-radius: 6px;
}

.role-filters label {
  font-weight: bold;
  margin-right: 5px;
}

.role-filter-option {
  display: flex;
  align-items: center;
  gap: 5px;
}

.role-filter-option input[type="checkbox"] {
  cursor: pointer;
}

.role-filter-option label {
  cursor: pointer;
  font-size: 14px;
  font-weight: normal;
  color: #555;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  background: #f8f9fa;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 2px solid #e0e0e0;
  cursor: pointer;
  position: relative;
  min-width: 80px;
}

/* Column resize handle */
th .resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 5px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  z-index: 1;
}

th .resize-handle:hover {
  background: #02133e;
}

th.resizing {
  user-select: none;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
}

.status-current {
  background-color: #d4edda !important;
}

.status-expiringsoon {
  background-color: #fff3cd !important;
}

.status-expired, .status-missing {
  background-color: #f8d7da !important;
}

.loading {
  text-align: center;
  padding: 60px 20px;
}

.error {
  background: #f8d7da;
  color: #721c24;
  padding: 20px;
  border-radius: 8px;
  margin: 20px 0;
}

.editable-date {
  cursor: pointer;
  background: #fffef0;
  border: 1px solid transparent;
}

.editable-date:hover {
  background: #fff9c4;
  border: 1px solid #ffc107;
}

.date-input {
  width: 100%;
  padding: 4px;
  border: 2px solid #02133e;
  border-radius: 4px;
  font-size: 14px;
}

.saving {
  background: #e3f2fd;
  font-style: italic;
}

.audit-info {
  font-size: 11px;
  color: #666;
  font-style: italic;
}

.edit-badge {
  background: #ff9800;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  margin-left: 10px;
}

/* Tab Navigation */
.tabs {
  display: flex;
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 20px;
}

.tab-btn {
  padding: 12px 24px;
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  font-weight: 500;
  color: #666;
  font-size: 15px;
}

.tab-btn.active {
  color: #02133e;
  border-bottom-color: #02133e;
}

.tab-btn:hover:not(.active) {
  background: #f8f9fa;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Horizontal scrolling for detailed table */
.table-wrapper {
  overflow-x: auto;
  margin-bottom: 20px;
}

/* Column visibility controls */
.column-controls {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 15px;
}

.column-controls-header {
  font-weight: bold;
  margin-bottom: 10px;
  color: #333;
}

.column-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.column-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
}

.column-toggle input[type="checkbox"] {
  cursor: pointer;
}

.column-toggle label {
  cursor: pointer;
  font-size: 14px;
  color: #555;
}

/* Hide columns */
.hide-column {
  display: none;
}
