/* TCTIPA Contact — shared app styles */
:root {
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}
body { margin: 0; padding: 0.75rem 1rem; }
#app-nav { margin-bottom: 0.75rem; padding: 0.25rem 0; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 0.25rem; }
#app-nav a, #app-nav button { margin-right: 0.35rem; }

#app-nav .nav-btn {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  color: inherit;
  text-decoration: none;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 0.2rem;
  cursor: pointer;
}
#app-nav .nav-btn:hover {
  background: #e5e7eb;
  border-color: #d1d5db;
}
#app-nav .nav-btn:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}
main { max-width: 60rem; }

#app-footer {
  margin-top: 2rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e5e7eb;
  font-size: 0.875rem;
  color: #6b7280;
}

/* Admin UI (Step 13 + Phase 2.2 polish) */
.admin-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  padding: 0.25rem 0;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.25rem;
}
.admin-subnav a {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  color: inherit;
  text-decoration: none;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 0.2rem;
}
.admin-subnav a:hover { background: #e5e7eb; border-color: #d1d5db; }
.admin-subnav a.active {
  background: #3b82f6;
  border-color: #2563eb;
  color: #fff;
}
.admin-section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}
.admin-section-tabs .admin-section-tab {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  color: #4b5563;
  text-decoration: none;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.2rem;
}
.admin-section-tabs .admin-section-tab:hover { background: #f3f4f6; color: #111; }
.admin-section-tabs .admin-section-tab.active {
  background: #3b82f6;
  border-color: #2563eb;
  color: #fff;
}
.admin-help-wrap { margin-bottom: 0.5rem; }
.admin-help-link {
  font-size: 0.8125rem;
  color: #6b7280;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.admin-help-link:hover { color: #374151; }
.admin-help-panel {
  margin-top: 0.35rem;
  padding: 0.5rem 0.75rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  color: #4b5563;
}
.admin-help-panel p { margin: 0.25rem 0; }
.admin-card,
.admin-form-card {
  padding: 0.75rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.25rem;
  background: #fff;
  margin-bottom: 0.75rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.admin-card-header {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #e5e7eb;
}
.admin-card-collapsed .admin-card-body { display: none; }
.admin-card-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  padding: 0.25rem 0;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.admin-card-toggle:hover { color: #111; }
.admin-card-toggle::before { content: ''; display: inline-block; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid currentColor; transition: transform 0.15s; }
.admin-card.expanded .admin-card-toggle::before { transform: rotate(0deg); }
.admin-card:not(.expanded) .admin-card-toggle::before { transform: rotate(-90deg); }
.admin-inline-error { color: #b91c1c; font-size: 0.875rem; margin-top: 0.25rem; }
.admin-form-row-deemph { opacity: 0.85; }
.admin-form-row-deemph label { color: #6b7280; }
.admin-roster-grid-wrap { overflow-x: auto; margin: 0.5rem 0; }
.admin-roster-grid .roster-cell { width: 100%; min-width: 4rem; padding: 0.2rem; font-size: 0.875rem; }
.admin-roster-grid .roster-cell[data-col="email"] { max-width: 12rem; overflow-wrap: break-word; word-break: break-word; box-sizing: border-box; }
.admin-roster-grid input[type="checkbox"] { margin: 0; }
.error-banner {
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.25rem;
  color: #b91c1c;
}
.success-banner {
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 0.25rem;
  color: #15803d;
}
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th,
.admin-table td { padding: 0.35rem 0.5rem; text-align: left; border-bottom: 1px solid #e5e7eb; }
.admin-table th { font-weight: 600; background: #f9fafb; }
.admin-table tbody tr:nth-child(even) { background: #f9fafb; }
.admin-table tbody tr:hover { background: #f3f4f6; }
.admin-table:not(.admin-roster-grid) td:last-child { text-align: right; }
.admin-table:not(.admin-roster-grid) td:last-child button,
.admin-table:not(.admin-roster-grid) td:last-child a { margin-left: 0.25rem; }
.admin-action-btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  color: inherit;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 0.2rem;
  cursor: pointer;
}
.admin-action-btn:hover { background: #e5e7eb; border-color: #d1d5db; }
.admin-th-sort {
  background: none;
  border: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  text-align: left;
  color: inherit;
}
.admin-th-sort:hover { color: #2563eb; }
.admin-form-row { margin-bottom: 0.75rem; }
.admin-form-row label { display: inline-block; min-width: 8rem; }
.admin-form-row input,
.admin-form-row select { padding: 0.35rem; font: inherit; }
.admin-actions { margin-top: 0.75rem; }
.admin-actions button,
.admin-actions .btn {
  padding: 0.35rem 0.75rem;
  margin-right: 0.5rem;
  font: inherit;
  cursor: pointer;
  background: #e5e7eb;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
}
.admin-actions button:hover { background: #d1d5db; }
.admin-actions button.primary { background: #3b82f6; border-color: #2563eb; color: #fff; }
.admin-actions button.primary:hover { background: #2563eb; }
.admin-section-title { margin-top: 1.25rem; margin-bottom: 0.5rem; font-size: 1rem; font-weight: 600; }
.admin-note { font-size: 0.875rem; color: #6b7280; margin-bottom: 0.75rem; }
.muted { font-size: 0.8125rem; color: #9ca3af; }
.admin-muted { font-size: 0.75rem; color: #9ca3af; font-weight: normal; }

/* Admin modal (e.g. Edit Student) */
.admin-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.admin-modal[hidden] { display: none; }
.admin-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.4); cursor: pointer; }
.admin-modal-content { position: relative; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); padding: 1.25rem; min-width: 18rem; max-width: 24rem; }
.admin-modal-content h3 { margin: 0 0 1rem 0; font-size: 1.1rem; }
.admin-modal-content .admin-form-row { margin-bottom: 0.5rem; }
.admin-modal-content .admin-actions { margin-top: 1rem; }
.admin-modal-content .admin-actions button { margin-right: 0.5rem; }

/* Roster table: fixed layout so email column respects max-width */
.admin-roster-table { table-layout: fixed; width: 100%; }
.admin-roster-table .roster-th-email { width: 12rem; max-width: 12rem; }
/* Roster email column: wrap cleanly so text is not cut off mid-line */
.admin-roster-table .roster-email-cell {
  max-width: 12rem;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
}

/* Button-styled link (no underline, looks like button) */
.admin-link-btn { background: none; border: none; color: #2563eb; cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.admin-link-btn:hover { color: #1d4ed8; }

/* Class detail sub-panels */
.session-detail-panel { margin-top: 0.5rem; }

/* Roster CSV import dropzone */
.dropzone { border: 2px dashed #d1d5db; border-radius: 0.25rem; padding: 1rem; transition: border-color 0.15s, background-color 0.15s; }
.dropzone.dropzone-dragover { border-color: #3b82f6; background-color: #eff6ff; }
