/**
 * Basketball League Manager - CSS Styles
 * Professional styling for the basketball league management system
 */

/* CSS Variables for Theming */
:root {
  /* The 5 theme roles. --primary/--primary-light/--primary-dark below are only the
     fallback (pre-config-load) values - the admin's actual chosen brand color
     (league_config.theme_primary_color, Color Configuration modal, 3 presets or a
     custom pick) overrides all three via a <style> block index.php injects into
     <head> after this file loads, with the light/dark shades computed from it (see
     hex_lighten()/hex_darken() there). --success/--warning/--danger/--info are NOT
     admin-configurable - they're fixed, conventional status colors so their meaning
     stays consistent regardless of branding. This "gold" default only shows up
     before the very first Color Configuration save (or for a request where that
     injection failed to load for some reason).
     scorer/index.html and scorer/display.html define their OWN separate --primary
     (orange), which is intentionally NOT tied to this - there it means "home team"
     (paired with --info for "visiting"), not brand color; see the league_config
     table comment in config/database.php for the full reasoning. */
  --primary: #9c8757;
  --primary-light: #b8a375;
  --primary-dark: #7d6c43;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  /* Background Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f5f4f2;
  --bg-tertiary: #ece9e4;

  /* Text Colors */
  --text-primary: #1e1e1e;
  --text-secondary: #86888b;
  --text-tertiary: #a7a9ac;

  /* Border Colors */
  --border-primary: #c7c9cc;
  --border-secondary: #a7a9ac;
  --border-tertiary: #e5e4e2;

  /* Card Styling */
  --card-bg: #ffffff;
  --card-border: #c7c9cc;

  /* Modal Styling */
  --modal-bg: #ffffff;
  --modal-overlay: rgba(30, 30, 30, 0.5);
}

/* Dark Mode Theme */
[data-theme="dark"] {
  --primary: #9c8757;
  --primary-light: #b8a375;
  --primary-dark: #7d6c43;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  --bg-primary: #0f0f0f;
  --bg-secondary: #1e1e1e;
  --bg-tertiary: #333333;

  --text-primary: #ffffff;
  --text-secondary: #c7c9cc;
  --text-tertiary: #a7a9ac;

  --border-primary: #333333;
  --border-secondary: #86888b;
  --border-tertiary: #a7a9ac;

  --card-bg: #1e1e1e;
  --card-border: #333333;

  --modal-bg: #1e1e1e;
  --modal-overlay: rgba(15, 15, 15, 0.7);
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
}

/* App Layout */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Navigation */
.topnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-primary);
  height: 60px;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: var(--card-bg);
  border-right: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
}

.slink {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.slink:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.slink.active {
  background: var(--bg-tertiary);
  color: var(--primary);
  border-left-color: var(--primary);
}

.sfooter {
  margin-top: auto;
  padding: 1rem 1.5rem;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  background: var(--bg-primary);
}

/* Print support - hides the app chrome (top nav/sidebar) so any view's own
   content prints cleanly on its own page, full width (removing .sidebar from the
   flex row lets .main-content's flex:1 fill the space automatically - no separate
   width override needed). .screen-only/.print-only let a view swap in
   print-specific content (e.g. team-player-stats.php's Print button vs. its
   "Printed on" line) without needing per-view print CSS. */
.print-only { display: none; }
@media print {
  .topnav, .sidebar, .screen-only { display: none !important; }
  .print-only { display: block; }
  .main-content { padding: 0; overflow: visible; }
  body { background: #fff; color: #000; }
}

/* Typography */
.page-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-secondary);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-orange {
  background: #f97316;
  color: white;
  border-color: #f97316;
}

.btn-orange:hover {
  background: #ea580c;
  border-color: #ea580c;
}

.btn-sm {
  padding: 0.5rem 0.75rem;
  font-size: 12px;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Forms */
.form-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 1fr;
}

.form-field {
  display: flex;
  flex-direction: column;
}

.form-field.form-full {
  grid-column: 1 / -1;
}

.form-label {
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.form-input {
  padding: 0.75rem;
  border: 1px solid var(--border-secondary);
  border-radius: 6px;
  font-size: 14px;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: border-color 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.form-input.field-valid {
  border-color: var(--success);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23198754'%3e%3cpath d='M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem 1rem;
  padding-right: 3rem;
}

.form-input.field-invalid {
  border-color: var(--danger);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23dc3545'%3e%3cpath d='M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem 1rem;
  padding-right: 3rem;
}

/* Native color-picker swatch (Team Details' Home/Visiting Color fields) - the
   text-input padding/background rules above make sense for typed values, but
   just get in the way of a swatch, so this trims it down to a small, square,
   clickable block instead of a full-width text field. */
.form-input.color-input {
  padding: 0.25rem;
  width: 4.5rem;
  height: 2.75rem;
  cursor: pointer;
}

/* Color Configuration modal's preset tiles + the "Custom" tile - see
   openColorConfigModal() in script.js. Selection is a fixed --info ring rather than
   --primary itself, since --primary is literally the value being chosen here and
   using it to highlight its own picker would be confusing (and wouldn't reflect the
   in-progress choice until after a save+reload anyway). */
.theme-swatch {
  padding: 1rem;
  border: 1px solid var(--border-secondary);
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
}
.theme-swatch.selected {
  border-color: var(--info);
  box-shadow: 0 0 0 2px var(--info);
}
.theme-swatch-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin: 0 auto 0.5rem;
  border: 2px solid var(--border-secondary);
}
.theme-swatch-custom {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--modal-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: var(--modal-bg);
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-secondary);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Team Cards */
.team-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.team-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.team-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.team-meta {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
}

.age-badge {
  background: var(--primary);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Game Cards */
.game-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.2s ease;
}

.game-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.game-matchup {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.game-team {
  color: var(--text-primary);
}

.game-team-color {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 400;
  font-style: italic;
  color: var(--text-secondary);
}

.game-team-color-swatch {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  border: 1px solid var(--border-primary);
  flex-shrink: 0;
}

.game-vs {
  color: var(--text-secondary);
  font-weight: 400;
}

.game-meta {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.game-status {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
}

.game-status.scheduled {
  background: #e0e7ff;
  color: #3730a3;
}

.game-status.live {
  background: #dcfce7;
  color: #166534;
}

.game-status.finished {
  background: #f3f4f6;
  color: #374151;
}

/* Organization Management Styles */
.organization-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.organization-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.organization-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.organization-details {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.organization-detail {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.organization-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-tertiary);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.organization-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.organization-actions {
  display: flex;
  gap: 0.5rem;
}

.organization-filters {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 2rem;
}

.filter-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  min-width: 150px;
}

.filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-select {
  padding: 0.5rem;
  border: 1px solid var(--border-secondary);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.875rem;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.search-input {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-secondary);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.875rem;
  min-width: 200px;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.filter-stats {
  margin-left: auto;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Game Creation Styles */
.game-creation-form {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.game-form-section {
  margin-bottom: 2rem;
}

.game-form-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.team-selector {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  margin: 1rem 0;
}

.team-select-card {
  background: var(--bg-secondary);
  border: 2px solid var(--border-secondary);
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.team-select-card:hover {
  border-color: var(--primary);
  background: var(--bg-tertiary);
}

.team-select-card.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.team-select-card.empty {
  border-style: dashed;
  color: var(--text-secondary);
}

.vs-divider {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-row-full {
  grid-column: 1 / -1;
}

.game-format-selector {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.format-option {
  flex: 1;
  padding: 0.75rem;
  border: 2px solid var(--border-secondary);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.format-option:hover {
  border-color: var(--primary);
}

.format-option.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

/* Deletion and Data Management Styles */
.delete-button {
  background: var(--danger);
  color: white;
  border: none;
  padding: 0.375rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.delete-button:hover {
  background: #b91c1c;
  transform: scale(1.05);
}

.confirmation-modal {
  background: var(--modal-overlay);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.confirmation-dialog {
  background: var(--modal-bg);
  border-radius: 12px;
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.confirmation-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--danger);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.confirmation-message {
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.confirmation-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 400px;
}

.toast {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideInRight 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--danger);
}

.toast.info {
  background: var(--info);
}

.toast.warning {
  background: var(--warning);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Live Scoresheet Styles */
.scoresheet-header-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
}

.scoreboard-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.5rem;
  align-items: center;
}

.scoreboard-team {
  text-align: center;
}

.scoreboard-team-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.scoreboard-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.scoreboard-score {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 0.75rem;
}

.score-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.scoreboard-center {
  text-align: center;
  min-width: 180px;
}

.scoreboard-period {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.scoreboard-clock {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  margin: 0.25rem 0;
}

.team-fouls-badge {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.roster-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.roster-table th {
  text-align: left;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 0.5rem;
  border-bottom: 1px solid var(--border-primary);
}

.roster-table td {
  padding: 0.5rem;
  border-bottom: 1px solid var(--border-tertiary);
  color: var(--text-primary);
}

.foul-count {
  font-weight: 700;
}

.foul-count.fouled-out {
  color: var(--danger);
}

.running-score-log {
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.running-score-entry {
  display: grid;
  grid-template-columns: 50px 1fr 1fr 90px;
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border-tertiary);
  font-size: 0.875rem;
}

.rs-period {
  font-weight: 700;
  color: var(--text-secondary);
}

.rs-team.home {
  color: var(--primary);
  font-weight: 600;
}

.rs-team.visiting {
  color: var(--info);
  font-weight: 600;
}

.rs-detail {
  color: var(--text-primary);
}

.rs-running {
  text-align: right;
  font-weight: 600;
  color: var(--text-secondary);
}

.officials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.final-score-table {
  width: 100%;
  border-collapse: collapse;
}

.final-score-table th,
.final-score-table td {
  padding: 0.6rem;
  text-align: center;
  border: 1px solid var(--border-primary);
}

.final-score-table th:first-child,
.final-score-table td:first-child {
  text-align: left;
}

@media (max-width: 900px) {
  .scoresheet-header-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .officials-grid {
    grid-template-columns: 1fr;
  }

  .scoreboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .sidebar {
    width: 200px;
  }
  
  .form-grid,
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .team-selector {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .vs-divider {
    order: 2;
    font-size: 1.25rem;
  }
  
  .organization-filters .filter-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-group {
    min-width: auto;
  }
  
  .filter-stats {
    margin-left: 0;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .sidebar {
    display: none;
  }
  
  .main-content {
    padding: 1rem;
  }
  
  .topnav {
    padding: 0.75rem 1rem;
  }
  
  .page-title {
    font-size: 1.5rem;
  }
  
  .card {
    margin-bottom: 1rem;
  }
}

/* Auth Screens (login / forced password change) - standalone pages with no app shell */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  padding: 1rem;
}

.auth-box {
  width: 100%;
  max-width: 380px;
  padding: 2rem;
}

.auth-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 1.5rem;
}

.auth-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 6px;
  padding: 0.6rem 0.85rem;
  font-size: 14px;
  margin-bottom: 1rem;
}

/* Roles & Permissions checkbox grid */
.permission-group {
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.permission-group-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.permission-actions {
  margin-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.permission-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 14px;
}
