:root {
  color-scheme: light dark;
  --pg-blue: #010d6e;
  --pg-cyan: #00b2fe;
  --pg-magenta: #d4004b;
  --pg-offwhite: #f6f3ee;

  --bg: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --card: rgba(246, 243, 238, 0.9);
  --border: rgba(1, 13, 110, 0.18);
  --shadow: 0 10px 25px rgba(1, 13, 110, 0.15);
}

* {
  box-sizing: border-box;
}

body.app-body {
  margin: 0.3rem;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app-root {
  width: 100%;
  max-width: 1850px;
  margin: 0 auto;
  padding: 0 2px 32px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-main {
  padding: 0 5px 5px;
  flex: 1 0 auto;
}

.app-footer {
  margin-top: auto;
  padding: 0 14px 24px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.app-footer-link {
  color: inherit;
  text-decoration: none;
}

.app-footer-link:hover {
  color: var(--pg-blue);
  text-decoration: underline;
}

.top-nav {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin: 0.75rem auto 1rem;
  padding: 0.75rem 1rem;
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 10px 25px rgba(1, 13, 110, 0.18);
  backdrop-filter: blur(12px);
}

.top-nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  text-decoration: none;
}

.top-nav-logo {
  height: 2.5rem;
  width: auto;
}

.top-nav-title {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--pg-blue);
}

.top-nav-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.top-nav-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}


.top-nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.top-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  color: var(--pg-blue);
  text-decoration: none;
  border: 1px solid transparent;
}

.top-nav-link:hover {
  border-color: rgba(0, 178, 254, 0.4);
}

.top-nav-link--active {
  background: var(--pg-cyan);
  color: #ffffff;
  font-weight: 600;
}

.top-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.top-nav-actions form {
  margin: 0;
}

.top-nav-actions .btn {
  margin-top: 0;
  min-height: 2.55rem;
  padding: 0.35rem 0.9rem;
  font-size: 0.9rem;
}

.user-pill {
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  background: rgba(0, 178, 254, 0.15);
  color: var(--pg-blue);
  font-size: 0.85rem;
  font-weight: 600;
}


.theme-toggle {
  min-width: 7.2rem;
}


/* Hamburger menu for mobile/tablet */
.top-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.35rem;
  width: 2.2rem;
  height: 2.2rem;
  background: #ffffff;
  border: 2px solid var(--pg-cyan);
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  flex: 0 0 2.2rem;
  z-index: 10;
  transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.top-nav-toggle:hover {
  background-color: rgba(0, 178, 254, 0.1);
  border-color: var(--pg-cyan);
}

.top-nav-toggle-bar {
  width: 1.1rem;
  height: 0.12rem;
  background: var(--pg-cyan);
  border-radius: 999px;
  transition: all 0.3s linear;
  position: relative;
}

/* Mobile navigation - overlay style */
.top-nav-mobile {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  pointer-events: none;
  transition: all 0.3s ease;
}

.top-nav-mobile[aria-hidden="false"] {
  pointer-events: auto;
}

.top-nav-mobile-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(1, 13, 110, 0.4);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.top-nav-mobile[aria-hidden="false"] .top-nav-mobile-backdrop {
  opacity: 1;
}

.top-nav-mobile-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 320px;
  background: #ffffff;
  box-shadow: -4px 0 16px rgba(1, 13, 110, 0.25);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.top-nav-mobile[aria-hidden="false"] .top-nav-mobile-panel {
  transform: translateX(0);
}

.top-nav-mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(1, 13, 110, 0.1);
}

.top-nav-mobile-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--pg-blue);
}

.top-nav-mobile-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: transparent;
  border: 2px solid var(--pg-blue);
  border-radius: 50%;
  cursor: pointer;
  color: var(--pg-blue);
  transition: background-color 0.2s, border-color 0.2s;
}

.top-nav-mobile-close:hover {
  background-color: rgba(0, 178, 254, 0.1);
  border-color: var(--pg-cyan);
}

.top-nav-mobile-section {
  padding: 1.5rem 1.5rem 0;
}

.top-nav-mobile-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.top-nav-mobile-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.top-nav-mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.top-nav-mobile-action-pill {
  justify-content: center;
  text-align: center;
  width: 100%;
}

.top-nav-mobile-action-form {
  width: 100%;
}

.top-nav-mobile-action-button {
  width: 100%;
}

.top-nav-mobile-link {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 1rem;
  color: var(--pg-blue);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s;
  text-align: left;
}

.top-nav-mobile-link--button {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
}

.top-nav-mobile-link:hover {
  border-color: rgba(0, 178, 254, 0.4);
  background: rgba(0, 178, 254, 0.05);
}

.top-nav-mobile-link--active {
  background: var(--pg-cyan);
  color: #ffffff;
  font-weight: 600;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  color: var(--pg-blue);
}

.page-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.text-muted {
  color: var(--text-muted);
}

.card {
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  padding: 1rem 1rem;
  margin-bottom: 1.25rem;
  background: #ffffff;
}

.card-header {
  margin-bottom: 0.75rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  color: var(--pg-blue);
}

.card-subtitle {
  font-size: 0.9rem;
  margin: 0;
  color: var(--text-muted);
}

.card-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--pg-blue);
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.table-wrapper {
  overflow-x: auto;
}

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

.table thead tr {
  background: #e2ecf9;
}

.table th,
.table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.table th {
  font-weight: 600;
  color: var(--pg-blue);
}

.table tbody tr:nth-child(even) {
  background: rgba(246, 243, 238, 0.7);
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--pg-blue);
  margin-bottom: 0.25rem;
}

.form-input,
.form-textarea,
form input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]),
form select,
form textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 0.75rem;
  border: 1px solid #c5d1e1;
  background: #e2e8f3;
  font-size: 1rem;
  color: #0f172a;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
form input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
form select:focus,
form textarea:focus {
  border-color: var(--pg-cyan);
  box-shadow: 0 0 0 3px rgba(0, 178, 254, 0.15);
  background: #e2e8f3;
}

.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus,
.form-input:-webkit-autofill:active,
form input:-webkit-autofill,
form input:-webkit-autofill:hover,
form input:-webkit-autofill:focus,
form input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--text);
  transition: background-color 9999s ease-in-out 0s;
  box-shadow: 0 0 0 1000px var(--bg) inset !important;
  -webkit-box-shadow: 0 0 0 1000px var(--bg) inset !important;
}

.form-select {
  width: 100%;
  height: 52px;
  padding: 0.45rem 2.5rem 0.45rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #c5d1e1;
  background-color: #e2e8f3;
  color: #0f172a;
  font-size: 1rem;
  appearance: none;
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.change-filter-search-field {
  position: relative;
}

.change-filter-search-input {
  padding-right: 2.25rem;
}

.change-filter-search-clear {
  position: absolute;
  top: 50%;
  right: 0.6rem;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #7b8794;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.change-filter-search-clear:hover {
  color: #364152;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  padding-bottom: 8px;
  padding-top: 8px;
}

.parent-profile-section {
  margin-bottom: 1.5rem;
}

.appointment-highlight {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0.4rem 0 1.2rem;
  padding: 0.75rem 1.25rem;
  border-radius: 0.9rem;
  background: var(--pg-blue);
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 18px rgba(1, 13, 110, 0.25);
}

.user-overview {
  margin-top: 1.5rem;
}

.user-edit-card {
  margin: 1.5rem 0;
}

.user-edit-meta {
  margin-bottom: 1rem;
}

.user-edit-actions form {
  margin: 0;
}

.user-search {
  margin-top: 0.5rem;
}

.user-search-input {
  min-height: 52px;
  padding: 0.7rem 0.9rem;
  font-size: 1rem;
  border-radius: 1rem;
  background: #ffffff;
}

.import-card-header {
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.import-panel {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(220px, 300px);
  gap: 1.5rem;
  align-items: start;
}

.file-upload {
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: rgba(246, 243, 238, 0.95);
  cursor: pointer;
  flex-wrap: wrap;
}

.file-upload input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.file-upload__name {
  font-size: 0.9rem;
}

.import-requirements {
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1rem;
  background: #ffffff;
}

.import-requirements h3 {
  margin-top: 0;
  color: var(--pg-blue);
}

.import-requirements ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
  display: grid;
  gap: 0.35rem;
}

.inline-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
  font-size: 0.85rem;
}

.elections-table td.changed {
  background: #fef3c7;
}

/* Draft change highlighting in dashboard */
.row-has-draft-change {
  background: transparent !important;
}

.dashboard-row--changed {
  background: rgba(0, 178, 254, 0.12) !important;
}

.form-select--draft {
  border-color: var(--pg-cyan);
  border-width: 2px;
}


.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  padding: 0.45rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  margin-top: 0.8rem;
  text-decoration: none;
  transition: transform 0.1s, box-shadow 0.1s, background 0.1s, color 0.1s, border 0.1s;
}

.btn-primary {
  background: var(--pg-cyan);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 178, 254, 0.35);
}

.btn-primary:hover {
  background: #0195d6;
  box-shadow: 0 6px 16px rgba(0, 178, 254, 0.45);
}

.btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 3px 8px rgba(0, 178, 254, 0.35);
}

.btn-secondary {
  background: var(--pg-blue);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(1, 13, 110, 0.3);
}

.btn-lightblue {
  background: #8ddcff;
  color: var(--pg-blue);
  box-shadow: 0 4px 12px rgba(0, 178, 254, 0.28);
}

.btn-lightblue:hover {
  background: #6bcfff;
  box-shadow: 0 6px 16px rgba(0, 178, 254, 0.36);
}

.btn-danger {
  background: var(--pg-magenta);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(212, 0, 75, 0.35);
}

.btn-danger:hover {
  background: #b4003f;
  box-shadow: 0 6px 16px rgba(212, 0, 75, 0.45);
}

.settings-save-button {
  margin-top: 0.9rem;
}

.settings-delete-section {
  margin-top: 1.15rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(15, 23, 42, 0.22);
}

.password-rules {
  margin: 0.2rem 0 0.9rem;
  padding-left: 1.2rem;
  color: var(--text-muted);
  display: grid;
  gap: 0.2rem;
}

.password-rules li {
  font-size: 0.92rem;
}

.password-rules li::marker {
  content: "○ ";
}

.password-rules .password-rule--met {
  color: #059669;
}

.password-rules .password-rule--met::marker {
  content: "✓ ";
}

.btn-outline {
  background: transparent;
  color: var(--pg-blue);
  border: 1px solid rgba(1, 13, 110, 0.35);
}

.slots-day-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 0.75rem;
}

.slots-day-column {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.55rem 0.65rem;
  background: #fff;
  overflow: hidden;
}

.slots-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.slots-day-header h3 {
  margin: 0;
  color: var(--pg-blue);
}

.slots-day-list {
  display: grid;
  gap: 0.35rem;
}

.slot-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto auto;
  align-items: center;
  gap: 0.3rem 0.5rem;
  border-top: 1px solid rgba(1, 13, 110, 0.08);
  padding-top: 0.35rem;
}

.slot-row:first-child {
  border-top: none;
  padding-top: 0;
}

.slot-row-controls {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.3rem;
  min-height: 1.4rem;
}

.slot-row-controls--toggles {
  justify-content: flex-start;
}

.slot-row-controls--delete {
  justify-content: flex-start;
}

.slot-inline-form {
  margin: 0;
  display: inline-flex;
  align-items: center;
}

.slot-switch {
  position: relative;
  display: inline-flex;
  width: 1.9rem;
  height: 1.08rem;
  cursor: pointer;
}

.slot-switch-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.slot-switch-track {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  background: rgba(100, 116, 139, 0.45);
  transition: background-color 0.2s;
}

.slot-switch-track::after {
  content: "";
  position: absolute;
  top: 0.09rem;
  left: 0.09rem;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.2s;
}

.slot-switch-input:checked + .slot-switch-track {
  background: var(--pg-blue);
}

.slot-switch-input:checked + .slot-switch-track::after {
  transform: translateX(0.82rem);
}

.slot-switch-input:focus-visible + .slot-switch-track {
  outline: 2px solid var(--pg-cyan);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.slot-row .btn-icon.btn-danger {
  width: 1.45rem;
  height: 1.45rem;
  font-size: 0.72rem;
}

.slot-day-delete-button,
.slot-delete-button {
  box-shadow: none;
}

.slot-day-delete-button:hover,
.slot-delete-button:hover {
  box-shadow: none;
}

.slot-create-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  align-items: end;
}

.slot-create-form__submit {
  margin-top: 0.8rem;
  justify-self: start;
}

@media (max-width: 1100px) {
  .slot-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .slot-create-form__submit {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .slot-create-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .slots-day-grid {
    grid-template-columns: 1fr;
  }

  .slot-row {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert.error {
  background: rgba(212, 0, 75, 0.1);
  color: var(--pg-magenta);
}

.alert.success {
  background: rgba(0, 178, 254, 0.12);
  color: #00335a;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  background: rgba(212, 0, 75, 0.12);
  color: var(--pg-magenta);
  font-size: 0.8rem;
  font-weight: 600;
}

/* Status badge variants */
.badge-status {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-status--draft {
  background: rgba(100, 116, 139, 0.12);
  color: var(--text-muted);
}

.badge-status--pending {
  background: rgba(0, 178, 254, 0.12);
  color: var(--pg-cyan);
}

.badge-status--approved {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.badge-status--rejected {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.change-note-row td {
  padding-top: 0;
}

.change-note-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.change-note-controls .form-input {
  flex: 1;
}

/* Window status badges */
.badge-window-open {
  background: rgba(0, 178, 254, 0.12);
  color: var(--pg-cyan);
}

.badge-window-closed {
  background: rgba(100, 116, 139, 0.12);
  color: var(--text-muted);
}

/* Text utilities */
.text-muted {
  color: var(--text-muted);
}

.code-block {
  background: rgba(15, 23, 42, 0.08);
  border-radius: 0.75rem;
  padding: 0.75rem;
  overflow-x: auto;
  font-size: 0.85rem;
}

a {
  color: var(--pg-cyan);
}

/* Accordion Component */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.accordion-item {
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  background: #ffffff;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.accordion-item:hover {
  box-shadow: 0 12px 30px rgba(1, 13, 110, 0.2);
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  gap: 1rem;
  user-select: none;
  transition: background 0.2s;
  cursor: pointer;
  position: relative;
}

.accordion-header::after {
  content: '▼';
  font-size: 1rem;
  color: var(--pg-cyan);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.accordion-header[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.accordion-header:hover {
  background: rgba(0, 178, 254, 0.05);
}

.accordion-header-content {
  flex: 1;
  min-width: 0;
}

.accordion-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  color: var(--pg-blue);
}

.accordion-description {
  font-size: 0.9rem;
  margin: 0;
  color: var(--text-muted);
}

.accordion-toggle {
  display: none;
}

.accordion-body {
  padding: 0 1.5rem 1.5rem;
}

.accordion-body[hidden] {
  display: none;
}

.accordion-subsection {
  border: 1px solid #e2e8f0;
  border-radius: 1.1rem;
  padding: 0.75rem 1rem;
  background: #ffffff;
}

.accordion-subsection + .accordion-subsection {
  margin-top: 1rem;
}

.accordion-subsection-summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  color: var(--pg-blue);
  list-style: none;
}

.accordion-subsection-summary .section-title {
  margin: 0;
}

.accordion-subsection-summary::marker {
  content: "";
}

.accordion-subsection-summary::after {
  content: "▾";
  font-size: 0.9rem;
  color: var(--pg-blue);
  transition: transform 0.2s ease;
}

.accordion-subsection[open] .accordion-subsection-summary::after {
  transform: rotate(180deg);
}

.accordion-subsection-body {
  padding-top: 1rem;
}

/* Section titles and separators */
.section-title {
  margin-bottom: 1rem;
}

.section-separator {
  margin: 2rem 0;
  border: none;
  border-top: 1px solid #e2e8f0;
}

/* ========================================
   Login Page Specific Styles
   ======================================== */

/* Login Page Layout */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Login Card */
.login-card {
  width: 100%;
  max-width: 640px;
  background: #f8fafc;
  border-radius: 2rem;
  border: 1px solid #dbe4f0;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
  padding: 1.2rem 1.2rem 1.1rem;
  backdrop-filter: blur(10px);
}

.entry-card {
  width: 100%;
  max-width: 640px;
  min-width: 320px;
}

.entry-section + .entry-section {
  border-top: 1px solid #e2e8f0;
  padding-top: 0.7rem;
  margin-top: 0.7rem;
}

.entry-section h2 {
  margin: 0 0 0.55rem;
  font-size: 1.2rem;
  color: var(--pg-blue);
}

.entry-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 0.85rem;
  margin-bottom: 0.5rem;
}

.entry-form-grid--single {
  grid-template-columns: 1fr;
}

.entry-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.84rem;
  color: #475569;
  font-weight: 600;
}

/* Login Header */
.login-header {
  text-align: center;
  margin-bottom: 0.7rem;
}

.login-logo {
  height: 2.8rem;
  width: auto;
  margin-bottom: 0.6rem;
}

.login-title {
  font-size: 1.48rem;
  font-weight: 700;
  color: var(--pg-blue);
  margin: 0;
}

.compact-create-form {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
}

.user-management-tabs {
  margin-top: 0.25rem;
}

.user-admin-page__header {
  margin-bottom: 0.7rem;
}

.user-admin-page__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.5rem, 2vw, 2rem);
  color: var(--pg-magenta);
}

.user-admin-page__subtitle {
  margin: 0;
  color: #3e4c95;
  font-size: 1.02rem;
}

.tabs {
  display: flex;
  gap: 0.35rem;
  border-bottom: 1px solid #dbe4f0;
  margin-bottom: 1.1rem;
}

.tabs__tab {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0.55rem 0.7rem;
  font-size: 1.05rem;
  line-height: 1.2;
  color: #64748b;
  border-bottom: 3px solid transparent;
  cursor: pointer;
}

.tabs__tab:hover {
  color: var(--pg-blue);
}

.tabs__tab[aria-selected="true"] {
  color: var(--pg-cyan);
  border-bottom-color: var(--pg-cyan);
}

.tabs__tab:focus-visible {
  outline: 2px solid var(--pg-cyan);
  outline-offset: 2px;
  border-radius: 0.4rem;
}

.tab-panel[hidden] {
  display: none;
}

.user-management-section + .user-management-section {
  margin-top: 1.1rem;
}

.user-search-panel {
  margin: 0.5rem 0 0.85rem;
  display: grid;
  gap: 0.4rem;
}

.parents-search-panel {
  margin: 0.5rem 0 0.85rem;
  display: grid;
  gap: 0.4rem;
}

.user-search-panel__count,
.parents-search-panel__count {
  margin: 0;
  font-weight: 500;
  color: #52609f;
}

.user-search-panel__label,
.parents-search-panel__label {
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.82rem;
  color: #4a5596;
  font-weight: 700;
}

.user-search-panel__input,
.parents-search-panel__input {
  width: min(100%, 44rem);
  min-height: 44px;
  padding: 0.85rem 1rem;
  border-radius: 1.2rem;
}

.user-overview-card {
  background: #f6f8fc;
  border: 1px solid #e1e8f4;
  border-radius: 1.05rem;
  padding: 0.85rem;
}

.user-overview-card__top h2 {
  margin: 0;
  color: var(--pg-blue);
}

.user-overview-card__top .text-muted {
  margin: 0.25rem 0 0;
}

.user-overview-toolbar {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.55rem;
  grid-template-columns: auto auto minmax(180px, auto) minmax(220px, 1fr);
  align-items: end;
}

.user-overview-btn {
  margin-top: 0;
}

.user-overview-count {
  margin: 0;
  font-weight: 500;
  color: #52609f;
}

.user-overview-search {
  display: grid;
  gap: 0.2rem;
  margin-left: auto;
  width: 100%;
}

.user-overview-search span {
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.82rem;
  color: #4a5596;
  font-weight: 700;
}

.user-overview-search input {
  background: #f1f5fb;
}

@media (max-width: 980px) {
  .user-overview-toolbar {
    grid-template-columns: 1fr;
  }

  .user-overview-search {
    margin-left: 0;
  }
}

.table-wrapper--compact {
  margin-top: 0.4rem;
  border-radius: 0.95rem;
  overflow: auto;
}

.compact-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 1100px;
}

.compact-table thead {
  background: rgba(0, 178, 254, 0.1);
}

.compact-table thead th {
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: #010d6e;
  text-align: left;
}

.compact-table tbody {
  background: rgba(255, 255, 255, 0.8);
}

.compact-table tbody tr {
  border-top: 1px solid #e2e8f0;
  transition: background 0.15s ease;
}

.compact-table tbody tr:hover {
  background: rgba(0, 178, 254, 0.06);
}

.compact-table td {
  padding: 0.75rem 1rem;
  color: rgba(1, 13, 110, 0.85);
  white-space: nowrap;
}

.compact-table__action-cell {
  white-space: nowrap;
}

.compact-table__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.compact-table__save-btn {
  border-radius: 0.5rem;
  border: 1px solid rgba(1, 13, 110, 0.2);
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #010d6e;
  background: transparent;
  margin: 0;
}

.compact-table__save-btn:hover {
  border-color: rgba(1, 13, 110, 0.4);
}

.compact-table__delete-form {
  margin: 0;
}

.compact-table__delete-btn {
  border-radius: 0.5rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: #ef4444;
  color: #fff;
  border: none;
  margin: 0;
}

.compact-table__delete-btn:hover {
  background: #dc2626;
}

.user-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #e7f9ee;
  color: #1c7f45;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.25rem 0.55rem;
}

@media (prefers-color-scheme: dark) {
  .compact-table thead {
    background: rgba(0, 178, 254, 0.2);
  }

  .compact-table thead th {
    color: #e2e8f0;
  }

  .compact-table tbody {
    background: rgba(15, 23, 42, 0.6);
  }

  .compact-table tbody tr {
    border-top: 1px solid #334155;
  }

  .compact-table tbody tr:hover {
    background: rgba(0, 178, 254, 0.12);
  }

  .compact-table td {
    color: #cbd5f5;
  }

  .compact-table__save-btn {
    border-color: #475569;
    color: #e2e8f0;
  }

  .compact-table__delete-btn {
    background: #dc2626;
  }
}

/* Login Form */
.login-form {
  margin-bottom: 0.7rem;
}

.forgot-form {
  display: grid;
  gap: 0.4rem;
}

.forgot-form .btn {
  width: 100%;
}

.login-card .form-group {
  margin-bottom: 1.25rem;
}

.login-card .form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--pg-blue);
  margin-bottom: 0.5rem;
}

.login-card .form-input {
  width: 100%;
  padding: 0.45rem 0.9rem;
  border-radius: 0.75rem;
  border: 1px solid #c5d1e1;
  background: #e2e8f3;
  font-size: 1rem;
  color: #0f172a;
  outline: none;
  transition: all 0.2s ease;
}

.login-card .form-input:focus {
  border-color: var(--pg-cyan);
  box-shadow: 0 0 0 3px rgba(0, 178, 254, 0.15);
  background: #e2e8f3;
}

/* Password Field with Toggle */
.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  width: 100%;
  padding-right: 3rem;
}

.password-field .form-input {
  padding-right: 3rem;
}

.password-field--compact {
  width: 100%;
}

.password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: color 0.2s ease;
  outline: none;
}

.password-toggle:hover {
  color: var(--pg-blue);
}

.password-toggle:focus {
  color: var(--pg-cyan);
}

.password-toggle-icon {
  width: 20px;
  height: 20px;
}

.password-toggle .eye-closed {
  display: none;
}

.password-field--visible .password-toggle .eye-open {
  display: none;
}

.password-field--visible .password-toggle .eye-closed {
  display: inline;
}

/* Alert Styles in Login Context */
.login-card .alert {
  padding: 0.65rem 0.8rem;
  border-radius: 0.75rem;
  margin-bottom: 0.85rem;
  font-size: 0.84rem;
  font-weight: 500;
}

.login-card .alert-error {
  background: rgba(212, 0, 75, 0.1);
  color: #b8003d;
  border: 1px solid rgba(212, 0, 75, 0.2);
}

.login-card .alert-success {
  background: rgba(0, 178, 254, 0.1);
  color: #006d94;
  border: 1px solid rgba(0, 178, 254, 0.2);
}

/* Button Styles in Login Context */
.login-card .btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  outline: none;
}

.login-card .btn-primary {
  background: var(--pg-cyan);
  color: #ffffff;
  box-shadow: none;
}

.login-card .btn-primary:hover {
  background: #0195d6;
  box-shadow: none;
  transform: translateY(-1px);
}

.login-card .btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 178, 254, 0.4);
}

.login-card .btn-full {
  width: 100%;
}

/* Login Links */
.login-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.login-link {
  font-size: 0.9rem;
  color: var(--pg-cyan);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.login-link:hover {
  color: #0195d6;
  text-decoration: underline;
}

.login-link-muted {
  color: var(--text-muted);
  font-weight: 400;
}

.login-link-muted:hover {
  color: var(--text);
}

/* Subject row coloring */
.subject-row {
  background-color: var(--subject-bg, transparent);
  color: var(--subject-text, inherit);
}

.subject-row td {
  background-color: var(--subject-bg, transparent);
  color: var(--subject-text, inherit);
}

.subject-row a {
  color: var(--subject-text, inherit);
  text-decoration: underline;
}

.subject-row .badge-status,
.subject-row .form-select {
  background-color: rgba(255, 255, 255, 0.9);
  color: var(--text);
  border: 1px solid var(--border);
}

.subject-row .text-muted {
  color: var(--subject-text, var(--text-muted));
  opacity: 0.7;
}

/* Forgot: Input + Button wie im Rest der App */
.forgot-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  gap: 1.25rem;
}

.forgot-row .form-input {
  flex: 1;
  min-width: 220px;
}

.combobox {
  position: relative;
}

.combobox-input-wrapper {
  position: relative;
}

.combobox-clear {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: #888;
}

.combobox-clear:hover {
  color: #000;
}

.combobox-list {
  position: absolute;
  z-index: 20;
  width: 100%;
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ccc;
  margin-top: 0.25rem;
  padding: 0;
  list-style: none;
}

.combobox-list li {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
}

.combobox-list li.is-active,
.combobox-list li:hover {
  background: #f0f0f0;
}

/* Scroll-Container für breite + hohe Tabellen */
.table-wrapper {
  width: 100%;
  overflow: auto; /* horizontal + vertikal */
  -webkit-overflow-scrolling: touch;
  border-radius: 1rem;

  max-height: 70vh; /* oder z.B. 520px */
}

/* Tabelle bleibt breit genug für horizontales Scrollen */
.table {
  min-width: 1100px; /* ggf. anpassen */
  border-collapse: collapse;
}

/* Standard: nicht umbrechen -> besser für horizontalen Scroll */
.table th,
.table td {
  white-space: nowrap;
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 2; /* über den Zellen */
}

/* Optional: E-Mail darf umbrechen, damit nicht ALLES extrem breit wird */
.user-overview-table td:nth-child(5) {
  white-space: normal;
  word-break: break-word;
}

.table thead th {
  background: #e2ecf9;
}


/* Standard: helles Logo sichtbar */
.login-logo--dark {
  display: none;
}

/* Standard: helles Logo sichtbar */
.top-nav-logo--dark {
  display: none;
}





















.card--danger {
  border: 2px solid #dc3545;
  background-color: #fff5f5;
}



@media (max-width: 1024px) {
    .table-wrapper--user-overview{
        max-height: none !important;
        height: 48vH;
    }
}


/* =========================
   Responsive: max-width
   ========================= */

@media (max-width: 1500px) {
  .top-nav-right {
    display: none;
  }

  .top-nav-toggle {
    display: flex;
  }

  .top-nav-mobile {
    display: block;
  }
}

@media (max-width: 1200px) {
  .entry-card {
    max-width: 580px;
  }
}

@media (max-width: 900px) {
  .entry-card {
    width: 100%;
    min-width: 0;
  }

  .import-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .forgot-row {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
  }

  .forgot-row .btn {
    width: 100%;
    margin-top: 0.5rem; /* mehr Platz oberhalb */
    margin-bottom: 0.25rem; /* mehr Platz unterhalb */
  }
}

@media (max-width: 480px) {
  .top-nav {
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
  }

  .top-nav-logo {
    height: 2rem;
  }

  .top-nav-title {
    display: block;
    font-size: 0.92rem;
    line-height: 1.15;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .top-nav-toggle {
    width: 2rem;
    height: 2rem;
    flex-basis: 2rem;
  }

  .top-nav-toggle-bar {
    width: 0.95rem;
  }

  .login-card {
    padding: 1.2rem 1rem;
  }

  .login-title {
    font-size: 1.68rem;
  }

  .login-logo {
    height: 2.4rem;
  }

  .entry-form-grid {
    grid-template-columns: 1fr;
  }

  .entry-section h2 {
    font-size: 1.55rem;
  }

  .compact-create-form {
    grid-template-columns: 1fr;
  }
}


/* =========================
   Dark mode: prefers-color-scheme
   ========================= */

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #020617;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --card: rgba(15, 23, 42, 0.88);
    --border: rgba(51, 65, 85, 0.7);
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.55);
  }

  body.app-body {
    background: #020617;
    color: #e2e8f0;
  }

  .top-nav {
    border-color: rgba(51, 65, 85, 0.6);
    background: rgba(15, 23, 42, 0.9);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.55);
  }

  .top-nav-title {
    color: var(--pg-offwhite);
  }

  .top-nav-subtitle {
    color: #cbd5f5;
  }

  .top-nav-link {
    color: #e2e8f0;
  }

  .top-nav-toggle-bar {
    background: var(--pg-offwhite);
  }

  .top-nav-toggle {
    background: rgba(15, 23, 42, 0.9); /* passend zur Top-Nav */
    border-color: var(--pg-offwhite);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  }

  .top-nav-toggle:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: var(--pg-cyan);
  }

  .top-nav-mobile-panel {
    background: rgba(15, 23, 42, 0.98);
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.55);
  }

  .top-nav-mobile-backdrop {
    background: rgba(0, 0, 0, 0.6);
  }

  .top-nav-mobile-header {
    border-bottom-color: rgba(51, 65, 85, 0.6);
  }

  .top-nav-mobile-title {
    color: var(--pg-offwhite);
  }

  .top-nav-mobile-close {
    border-color: var(--pg-offwhite);
    color: var(--pg-offwhite);
  }

  .top-nav-mobile-close:hover {
    border-color: var(--pg-cyan);
  }

  .top-nav-mobile-section-title {
    color: #cbd5f5;
  }

  .top-nav-mobile-link {
    color: #e2e8f0;
  }

  .top-nav-mobile-link:hover {
    background: rgba(0, 178, 254, 0.1);
  }

  .user-pill {
    background: rgba(0, 178, 254, 0.25);
    color: #e2e8f0;
  }

  .page-title {
    color: var(--pg-offwhite);
  }

  .page-subtitle {
    color: #cbd5f5;
  }

  .card {
    border-color: rgba(51, 65, 85, 0.7);
    background: rgba(15, 23, 42, 0.88);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.55);
  }

  .card-title {
    color: var(--pg-offwhite);
  }

  .card-subtitle {
    color: #cbd5f5;
  }

  .stat-value {
    color: var(--pg-offwhite);
  }

  .stat-label {
    color: #cbd5f5;
  }

  .table thead tr {
    background: #020617;
  }


  .table th,
  .table td {
    border-bottom-color: #334155;
  }

  .table th {
    color: var(--pg-offwhite);
  }

  .table tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.75);
  }

  .form-label {
    color: var(--pg-offwhite);
  }

  .form-input,
  .form-select,
  .form-textarea,
  form input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  form select,
  form textarea {
    border-color: #475569;
    background: rgba(15, 23, 42, 0.92);
    color: #e2e8f0;
  }

  .form-select,
  form select {
    background-color: #0f172a;
  }

  .form-input:focus,
  .form-select:focus,
  .form-textarea:focus,
  form input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
  form select:focus,
  form textarea:focus {
    background: rgba(15, 23, 42, 0.92);
    color: #e2e8f0;
  }

  .form-input:-webkit-autofill,
  .form-input:-webkit-autofill:hover,
  .form-input:-webkit-autofill:focus,
  .form-input:-webkit-autofill:active,
  form input:-webkit-autofill,
  form input:-webkit-autofill:hover,
  form input:-webkit-autofill:focus,
  form input:-webkit-autofill:active {
    -webkit-text-fill-color: #e2e8f0 !important;
    caret-color: #e2e8f0;
    box-shadow: 0 0 0 1000px #0f172a inset !important;
    -webkit-box-shadow: 0 0 0 1000px #0f172a inset !important;
    transition: background-color 9999s ease-in-out 0s;
  }

  .form-select option,
  .form-select optgroup {
    background-color: #0f172a;
    color: #e2e8f0;
  }

  .subject-row .badge-status,
  .subject-row .form-select {
    background-color: rgba(15, 23, 42, 0.7);
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.5);
  }

  .elections-table td.changed {
    background: rgba(234, 179, 8, 0.2);
  }

  .btn-outline {
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.5);
  }

  .code-block {
    background: rgba(15, 23, 42, 0.6);
    color: #e2e8f0;
  }

  a {
    color: #7dd3fc;
  }



  .tabs {
    border-bottom-color: rgba(148, 163, 184, 0.45);
    background: rgba(30, 41, 59, 0.86);
  }

  .tabs__tab {
    color: #cbd5e1;
    background: transparent;
    border-bottom-color: transparent;
  }

  .tabs__tab:hover {
    color: #e2e8f0;
  }

  .tabs__tab[aria-selected="true"] {
    color: #67d6ff;
    border-bottom-color: #22c4ff;
  }

  .user-admin-page__subtitle,
  .user-overview-count,
  .user-overview-search span {
    color: #cbd5f5;
  }

  .user-overview-card {
    background: rgba(15, 23, 42, 0.76);
    border-color: rgba(148, 163, 184, 0.3);
  }

  .user-overview-search input {
    background: rgba(15, 23, 42, 0.92);
  }
  .accordion-item {
    border-color: rgba(51, 65, 85, 0.7);
    background: rgba(15, 23, 42, 0.88);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.55);
  }

  .accordion-item:hover {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65);
  }

  .accordion-header:hover {
    background: rgba(0, 178, 254, 0.1);
  }

  .accordion-title {
    color: var(--pg-offwhite);
  }

  .accordion-description {
    color: #cbd5f5;
  }

  .badge-status--approved {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
  }

  .badge-status--rejected {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
  }

  .badge-status--draft {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
  }

  .badge-status--pending {
    background: rgba(0, 178, 254, 0.2);
    color: #7dd3fc;
  }

  .row-has-draft-change {
    background: transparent !important;
  }

  .dashboard-row--changed {
    background: rgba(0, 178, 254, 0.2) !important;
  }

  .term-active {
    background: rgba(0, 178, 254, 0.25);
  }

  /*.term-active-cell {
    background: rgba(0, 178, 254, 0.15) !important;
  }*/

  .cell-change--approved::after {
    background: #4ade80;
  }

  .cell-change--rejected::after {
    background: #f87171;
  }

  .cell-change--pending::after {
    background: #7dd3fc;
  }

  /* ========================================
     Dark Mode Support for Login Page
     ======================================== */

  .login-page {
    background: #020617;
  }

  .login-card {
    background: rgba(15, 23, 42, 0.95);
    border-color: rgba(51, 65, 85, 0.6);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  }

  .login-title {
    color: var(--pg-offwhite);
  }

  .entry-section h2 {
    color: var(--pg-offwhite);
  }

  .entry-field,
  .entry-field > span,
  .parent-profile-section label {
    color: var(--pg-offwhite);
  }

  .login-card .form-label {
    color: var(--pg-offwhite);
  }

  .login-card .form-input {
    background: rgba(15, 23, 42, 0.8);
    border-color: #475569;
    color: #e2e8f0;
  }

  .login-card .form-input:focus {
    background: rgba(15, 23, 42, 0.9);
    border-color: var(--pg-cyan);
    box-shadow: 0 0 0 3px rgba(0, 178, 254, 0.2);
  }

  .entry-field .form-input:-webkit-autofill,
  .entry-field .form-input:-webkit-autofill:hover,
  .entry-field .form-input:-webkit-autofill:focus,
  .parent-profile-section .form-input:-webkit-autofill,
  .parent-profile-section .form-input:-webkit-autofill:hover,
  .parent-profile-section .form-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #e2e8f0;
    box-shadow: 0 0 0 1000px #0f172a inset;
    transition: background-color 9999s ease-out 0s;
  }

  .password-toggle {
    color: #94a3b8;
  }

  .password-toggle:hover {
    color: #e2e8f0;
  }

  .password-toggle:focus {
    color: var(--pg-cyan);
  }

  .login-card .alert-error {
    background: rgba(212, 0, 75, 0.15);
    color: #ff6b9d;
    border-color: rgba(212, 0, 75, 0.3);
  }

  .login-card .alert-success {
    background: rgba(0, 178, 254, 0.15);
    color: #7dd3fc;
    border-color: rgba(0, 178, 254, 0.3);
  }

  .login-links {
    border-top-color: #334155;
  }

  .login-link {
    color: #7dd3fc;
  }

  .login-link:hover {
    color: #bae6fd;
  }

  .login-link-muted {
    color: #94a3b8;
  }

  .login-link-muted:hover {
    color: #cbd5e1;
  }

  /* ========================================
     Combobox – Dark Mode
     ======================================== */

  .combobox-clear {
    color: #94a3b8; /* slate-400 */
  }

  .combobox-clear:hover {
    color: #e2e8f0; /* slate-200 */
  }

  .combobox-list {
    background: rgba(15, 23, 42, 0.95); /* identisch zu Cards */
    border-color: #475569; /* slate-600 */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.55);
  }

  .combobox-list li {
    color: #e2e8f0; /* slate-200 */
  }

  .combobox-list li:hover,
  .combobox-list li.is-active {
    background: rgba(0, 178, 254, 0.18); /* pg-cyan soft */
    color: #ffffff;
  }

  .table-wrapper {
    border: 1px solid rgba(51, 65, 85, 0.7);
    background: rgba(15, 23, 42, 0.88);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.55);
  }

  .table {
    color: #e2e8f0;
    border-collapse: collapse;
  }

  .table thead tr {
    background: rgba(2, 6, 23, 0.95);
  }

  .table th,
  .table td {
    border-bottom-color: #334155;
    color: #e2e8f0;
  }

  .table tbody tr {
    background: rgba(15, 23, 42, 0.88);
  }

  .table tbody tr:nth-child(even) {
    background: rgba(30, 41, 59, 0.75);
  }

  .table tbody tr:hover {
    background: rgba(0, 178, 254, 0.12);
  }

  .table a {
    color: #7dd3fc;
  }

  .table-wrapper::-webkit-scrollbar {
    height: 10px;
  }

  .table-wrapper::-webkit-scrollbar-track {
    background: rgba(51, 65, 85, 0.4);
    border-radius: 999px;
  }

  .table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.55);
    border-radius: 999px;
  }

  .table-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.75);
  }

  .table thead th {
    background: rgba(2, 6, 23, 0.95);
  }

  .accordion-subsection-body {
    background: rgba(51, 65, 85, 0.4);
  }

  .accordion-subsection {
    background: rgba(51, 65, 85, 0.4);
    color: #e2e8f0;
  }

  .accordion-subsection-summary {
    background: rgba(51, 65, 85, 0.4);
    color: #e2e8f0;
  }

  .table thead th {
    background: rgba(2, 6, 23, 0.95);
  }

  .subject-row td {
    color: var(--subject-text, #e2e8f0);
  }

  .subject-row count {
    color: var(--subject-text, #e2e8f0);
  }

  table.elections-table tr.subject-row td,
  table.elections-table tr.subject-row th {
    color: inherit;
  }

  .file-upload {
    background: transparent !important;
  }

  /* Dark Mode per OS/Browser */
  .login-logo--light {
    display: none;
  }

  .login-logo--dark {
    display: inline-block;
  }

  /* Dark Mode per OS/Browser */
  .top-nav-logo--light {
    display: none;
  }

  .top-nav-logo--dark {
    display: inline-block;
  }

  .card--danger {
    border-color: rgba(248, 113, 113, 0.75); /* rot, aber softer */
    background-color: rgba(239, 68, 68, 0.12); /* dunkler Hintergrund */
  }
}
.btn-icon {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;

  border-radius: 50%;
  cursor: pointer;
}
.btn-icon--approve {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgb(16, 185, 129);
  color: rgb(16, 185, 129);
}

.btn-icon--approve:hover {
  background: rgb(16, 185, 129);
  color: #fff;
}

.btn-icon--reject {
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgb(220, 38, 38);
  color: rgb(220, 38, 38);
}

.btn-icon--reject:hover {
  background: rgb(220, 38, 38);
  color: #fff;
}



@media (max-width: 640px) {
  .btn-icon {
    width: 2rem;
    height: 2rem;
    font-size: 1.1rem;
  }
}


.signature-card {
  margin-top: 1.5rem;
  padding: 1.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.signature-card button {
  margin-top: 0.5rem;
}

.signature-status {
  margin-top: 0.25rem;
  font-size: 0.9rem;
  color: #6b7280;
}

.signature-status.is-ok {
  color: #16a34a;
  font-weight: 600;
}

.signature-status.is-error {
  color: #dc2626;
  font-weight: 600;
}

.error-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.error-overlay[hidden] {
  display: none !important;
}

.error-modal {
  background: #fff;
  padding: 1.5rem;
  max-width: 420px;
  width: 90%;
  border-radius: 0.75rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.error-modal h3 {
  margin-top: 0;
  color: #dc2626;
}

.submission-block {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  background: #fff;
}

.submission-header {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.submission-header-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-start;
}

.submission-header-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.submission-user {
  font-size: 0.95rem;
  color: #475569;
}

.submission-withdrawn {
  padding: 0.75rem 1rem;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  margin-bottom: 1rem;
  color: #9a3412;
}

.audit-json {
  background: #0f172a;
  color: #e2e8f0;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  overflow-x: auto;
}

.signature-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  align-items: start;
}

.signature-image {
  max-width: 100%;
  border: 1px solid #cbd5f5;
  border-radius: 8px;
  background: #fff;
}

.filter-bar .form-row {
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .submission-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

.signature-card label,
.signature-card canvas,
.signature-card .signature-status,
.signature-card button {
  display: block;
}


/* =========================================================
   System Dark Mode refinements (prefers-color-scheme)
   ========================================================= */

@media (prefers-color-scheme: dark) {
  .signature-image {
    border-color: rgba(51, 65, 85, 0.6);
    background: rgba(15, 23, 42, 0.9);
  }

  @media (max-width: 768px) {
    .card,
    .table-wrapper {
      background: rgba(15, 23, 42, 0.88);
    }

    .table--dashboard-changes tr {
      background: rgba(15, 23, 42, 0.88);
      color: #e2e8f0;
      border-color: rgba(51, 65, 85, 0.7);
    }

    .table--dashboard-elections tr {
      background: var(--subject-bg, rgba(15, 23, 42, 0.88)) !important;
      color: var(--subject-text, #e2e8f0);
      border: 1px solid rgba(51, 65, 85, 0.7);
    }

    .table--dashboard-changes td::before,
    .table--dashboard-elections td::before {
      color: #94a3b8;
    }

    .table--dashboard-elections td[data-label="Abifach"] {
      color: var(--subject-text, #e2e8f0);
      background: rgba(15, 23, 42, 0.65);
      box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.5);
    }
  }
}

.legal-card {
  max-width: 920px;
  margin-inline: auto;
}

.legal-content {
  color: var(--text);
  line-height: 1.65;
  font-size: 0.98rem;
}

.legal-content section + section {
  margin-top: 1.35rem;
}

.legal-content h2 {
  margin: 0 0 0.6rem;
  color: var(--pg-blue);
  font-size: 1.25rem;
  font-weight: 700;
}

.legal-content p {
  margin: 0 0 0.8rem;
}

.legal-content ul {
  margin: 0.35rem 0 0.95rem;
  padding-left: 1.25rem;
}

.legal-content li + li {
  margin-top: 0.25rem;
}

.legal-content hr {
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 1.25rem 0 0.9rem;
}



.legal-card {
  max-width: 920px;
  margin-inline: auto;
}

.legal-content {
  color: var(--text);
  line-height: 1.65;
  font-size: 0.98rem;
}

.legal-content section + section {
  margin-top: 1.35rem;
}

.legal-content h2 {
  margin: 0 0 0.6rem;
  color: var(--pg-blue);
  font-size: 1.25rem;
  font-weight: 700;
}

.legal-content p {
  margin: 0 0 0.8rem;
}

.legal-content ul {
  margin: 0.35rem 0 0.95rem;
  padding-left: 1.25rem;
}

.legal-content li + li {
  margin-top: 0.25rem;
}

.legal-content hr {
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 1.25rem 0 0.9rem;
}

.bookings-day-group {
  margin-top: 1.5rem;
}

.bookings-search {
  margin: 0.6rem 0 1rem;
}

.bookings-search-label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  color: var(--pg-blue);
}

.bookings-search-control {
  position: relative;
  width: min(100%, 420px);
}

.bookings-search-input {
  width: 100%;
  padding: 0.5rem;
  padding-right: 2.6rem;
  border-radius: 5px;
}

.bookings-search-clear {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  width: 1.8rem;
  height: 1.8rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(1, 13, 110, 0.25);
  background: #ffffff;
  color: var(--pg-blue);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.bookings-search-clear:hover {
  background: rgba(0, 178, 254, 0.1);
}

.bookings-search-empty {
  margin: 0.55rem 0 0;
  color: var(--text-muted);
}

.bookings-day-heading {
  margin: 0 0 0.45rem;
  color: var(--pg-blue);
}

.bookings-day-count {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.bookings-table th,
.bookings-table td {
  vertical-align: middle;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.bookings-actions {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
}

.bookings-actions-col {
  text-align: center;
  width: 8.5rem;
}

.bookings-presence-col {
  text-align: center;
  width: 9rem;
}

.btn-icon.bookings-edit-trigger {
  width: 1.65rem;
  height: 1.65rem;
  min-width: 1.65rem;
  min-height: 1.65rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.bookings-edit-icon {
  font-size: 0.8rem;
  line-height: 1;
  display: inline-block;
  transform: translateY(0.01rem);
}

.btn-icon {
  min-width: 2rem;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
  line-height: 1;
}

.presence-toggle-form {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.presence-toggle {
  min-width: 3.2rem;
  border: 1px solid rgba(1, 13, 110, 0.3);
  background: rgba(100, 116, 139, 0.15);
  color: var(--text);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.presence-toggle.is-active {
  background: rgba(22, 163, 74, 0.2);
  border-color: rgba(22, 163, 74, 0.55);
  color: #166534;
}

.rebook-overlay {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: none;
}

.rebook-overlay[aria-hidden="false"] {
  display: block;
}

.rebook-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.rebook-overlay-panel {
  position: relative;
  width: min(560px, calc(100% - 2rem));
  margin: 8vh auto 0;
  background: #ffffff;
  border-radius: 1rem;
  border: 1px solid rgba(1, 13, 110, 0.2);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.3);
  padding: 1rem;
}

.rebook-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.rebook-overlay-header h4 {
  margin: 0;
  color: var(--pg-blue);
}

.rebook-overlay-meta {
  margin: 0.8rem 0;
}

.rebook-overlay-form {
  display: grid;
  gap: 0.55rem;
}

.rebook-overlay-delete-form {
  margin-top: 0.85rem;
}

.rebook-overlay-delete-btn {
  width: 100%;
}

@media (prefers-color-scheme: dark) {
  .bookings-search-label,
  .bookings-day-heading {
    color: var(--pg-offwhite);
  }

  .bookings-search-clear {
    border-color: rgba(148, 163, 184, 0.45);
    background: #0f172a;
    color: #e2e8f0;
  }

  .bookings-search-clear:hover {
    background: rgba(0, 178, 254, 0.22);
  }

  .presence-toggle {
    border-color: rgba(148, 163, 184, 0.45);
    background: rgba(15, 23, 42, 0.92);
    color: #e2e8f0;
  }

  .presence-toggle.is-active {
    background: rgba(22, 163, 74, 0.24);
    border-color: rgba(74, 222, 128, 0.6);
    color: #86efac;
  }

  .rebook-overlay-panel {
    background: rgba(15, 23, 42, 0.98);
    border-color: rgba(71, 85, 105, 0.8);
    color: #e2e8f0;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  }

  .rebook-overlay-header h4,
  .rebook-overlay-meta,
  .rebook-overlay .form-label {
    color: var(--pg-offwhite);
  }

  .rebook-overlay-panel select,
  .rebook-overlay-panel option {
    background: #0f172a;
    border-color: #475569;
    color: #e2e8f0;
  }
}
