/* Audit Scheduling – calendar and schedule form */
.audit-scheduling-page {
  padding: 2rem 3rem;
  max-width: 1200px;
  margin: 0 auto;
}

.audit-scheduling-header {
  margin-bottom: 1.5rem;
}

.audit-scheduling-header h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  color: var(--neutral-800, #4d4d4f);
}

.audit-scheduling-subtitle {
  margin: 0 0 1rem;
  color: var(--neutral-600, #4d4d4f);
  font-size: 0.95rem;
}

.audit-scheduling-btn-primary {
  padding: 0.5rem 1.25rem;
  background: var(--primary-500, #f21b23);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
}

.audit-scheduling-btn-primary:hover {
  background: var(--primary-600, #d91820);
}

.audit-scheduling-btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.audit-scheduling-error {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #c2151d;
}

.audit-scheduling-success {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  color: #047857;
}

.audit-scheduling-loading {
  padding: 2rem;
  text-align: center;
  color: var(--neutral-500);
}

/* Form */
.audit-scheduling-form {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--neutral-200, #e5e5e5);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.audit-scheduling-form h2 {
  margin: 0 0 1.25rem;
  font-size: 1.25rem;
  color: var(--neutral-800);
}

.audit-scheduling-form-row {
  margin-bottom: 1rem;
}

.audit-scheduling-form-row label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
  color: var(--neutral-700);
  font-size: 0.9rem;
}

.audit-scheduling-form-row input,
.audit-scheduling-form-row select {
  width: 100%;
  max-width: 400px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--neutral-300);
  border-radius: 6px;
  font-size: 1rem;
}

.audit-scheduling-form-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: var(--neutral-500, #737373);
}

.audit-scheduling-form-actions {
  margin-top: 1.25rem;
}

/* Calendar */
.audit-scheduling-calendar-section {
  margin-bottom: 2rem;
}

.audit-scheduling-calendar-section h2 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  color: var(--neutral-800);
}

.audit-scheduling-calendar-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.audit-scheduling-calendar-nav button {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--neutral-300);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 1rem;
}

.audit-scheduling-calendar-nav button:hover {
  background: var(--neutral-50);
}

.audit-scheduling-calendar-title {
  font-weight: 600;
  min-width: 180px;
  text-align: center;
}

.audit-scheduling-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  max-width: 560px;
  border: 1px solid var(--neutral-200);
  border-radius: 8px;
  overflow: hidden;
  background: var(--neutral-200);
}

.audit-scheduling-calendar-weekday {
  padding: 0.5rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--neutral-600);
  background: var(--neutral-100);
}

.audit-scheduling-calendar-day {
  padding: 0.5rem;
  min-height: 40px;
  text-align: center;
  background: #fff;
  font-size: 0.9rem;
}

.audit-scheduling-calendar-day.empty {
  background: var(--neutral-50);
  visibility: hidden;
}

.audit-scheduling-calendar-day.scheduled {
  background: #fef2f2;
  color: var(--primary-600, #d91820);
  font-weight: 600;
}

.audit-scheduling-calendar-day.clickable {
  cursor: pointer;
}

.audit-scheduling-calendar-day.clickable:hover {
  background: #fecaca;
  outline: 2px solid var(--primary-500);
  outline-offset: -2px;
}

.audit-scheduling-legend {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--neutral-500);
}

/* List */
.audit-scheduling-list-section h2 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  color: var(--neutral-800);
}

.audit-scheduling-empty {
  color: var(--neutral-500);
  font-style: italic;
}

.audit-scheduling-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.audit-scheduling-list-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--neutral-200);
  border-radius: 8px;
  background: #fff;
}

.audit-scheduling-list-main {
  flex: 1;
  min-width: 200px;
}

.audit-scheduling-list-main strong {
  margin-right: 0.25rem;
}

.audit-scheduling-recurrence {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.2rem 0.5rem;
  background: var(--neutral-100);
  border-radius: 4px;
  font-size: 0.85rem;
}

.audit-scheduling-list-actions {
  display: flex;
  gap: 0.5rem;
}

.audit-scheduling-btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  border: 1px solid var(--neutral-300);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.audit-scheduling-btn-sm:hover {
  background: var(--neutral-50);
}

.audit-scheduling-btn-sm:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.audit-scheduling-btn-danger {
  border-color: #fecaca;
  color: var(--primary-600);
}

.audit-scheduling-btn-danger:hover {
  background: #fef2f2;
}

/* Date detail page (users scheduled on a date) */
.audit-scheduling-back {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.35rem 0;
  background: none;
  border: none;
  color: var(--primary-600);
  font-size: 0.95rem;
  cursor: pointer;
}

.audit-scheduling-back:hover {
  text-decoration: underline;
}

.audit-scheduling-date-detail-list {
  margin-top: 0;
}

.audit-scheduling-user-list {
  max-width: 640px;
}

.audit-scheduling-user-card {
  flex-direction: column;
  align-items: stretch;
}

.audit-scheduling-user-card-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.audit-scheduling-user-name {
  font-size: 1.1rem;
}

.audit-scheduling-user-email {
  font-size: 0.9rem;
  color: var(--neutral-600);
}

.audit-scheduling-user-audit {
  font-size: 0.95rem;
  color: var(--neutral-700);
}

/* Date detail – full audit schedule info cards (all audits on same date shown) */
.audit-scheduling-date-detail-list .audit-scheduling-list {
  overflow: visible;
}

.audit-scheduling-detail-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 640px;
  overflow: visible;
}

.audit-scheduling-detail-card {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--neutral-200);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.06);
}

.audit-scheduling-detail-card-title {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  color: var(--neutral-800);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--neutral-200);
}

.audit-scheduling-detail-card-dl {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.audit-scheduling-detail-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.75rem;
  align-items: baseline;
}

.audit-scheduling-detail-row dt {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--neutral-600);
}

.audit-scheduling-detail-row dd {
  margin: 0;
  font-size: 0.95rem;
  color: var(--neutral-800);
}

.audit-scheduling-detail-name {
  font-weight: 500;
}

.audit-scheduling-detail-email {
  color: var(--neutral-600);
  font-size: 0.9rem;
}

/* ========== Dark theme – Audit Scheduling ========== */
body.night-mode .audit-scheduling-header h1,
.night-mode .audit-scheduling-header h1 {
  color: rgba(255, 255, 255, 0.98);
}

body.night-mode .audit-scheduling-subtitle,
.night-mode .audit-scheduling-subtitle {
  color: rgba(255, 255, 255, 0.75);
}

body.night-mode .audit-scheduling-error,
.night-mode .audit-scheduling-error {
  background: rgba(248, 113, 113, 0.2);
  border-color: rgba(248, 113, 113, 0.5);
  color: #fca5a5;
}

body.night-mode .audit-scheduling-loading,
.night-mode .audit-scheduling-loading {
  color: rgba(255, 255, 255, 0.8);
}

body.night-mode .audit-scheduling-form,
.night-mode .audit-scheduling-form {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

body.night-mode .audit-scheduling-form h2,
.night-mode .audit-scheduling-form h2 {
  color: rgba(255, 255, 255, 0.95);
}

body.night-mode .audit-scheduling-form-row label,
.night-mode .audit-scheduling-form-row label {
  color: rgba(255, 255, 255, 0.85);
}

body.night-mode .audit-scheduling-form-row input,
body.night-mode .audit-scheduling-form-row select,
.night-mode .audit-scheduling-form-row input,
.night-mode .audit-scheduling-form-row select {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.95);
}

body.night-mode .audit-scheduling-calendar-section h2,
body.night-mode .audit-scheduling-list-section h2,
.night-mode .audit-scheduling-calendar-section h2,
.night-mode .audit-scheduling-list-section h2 {
  color: rgba(255, 255, 255, 0.95);
}

body.night-mode .audit-scheduling-calendar-nav button,
.night-mode .audit-scheduling-calendar-nav button {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.95);
}

body.night-mode .audit-scheduling-calendar-nav button:hover,
.night-mode .audit-scheduling-calendar-nav button:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(248, 113, 113, 0.4);
  color: #fca5a5;
}

body.night-mode .audit-scheduling-calendar-title,
.night-mode .audit-scheduling-calendar-title {
  color: rgba(255, 255, 255, 0.95);
}

body.night-mode .audit-scheduling-calendar,
.night-mode .audit-scheduling-calendar {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.12);
}

body.night-mode .audit-scheduling-calendar-weekday,
.night-mode .audit-scheduling-calendar-weekday {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

body.night-mode .audit-scheduling-calendar-day,
.night-mode .audit-scheduling-calendar-day {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.9);
}

body.night-mode .audit-scheduling-calendar-day.empty,
.night-mode .audit-scheduling-calendar-day.empty {
  background: rgba(255, 255, 255, 0.02);
}

body.night-mode .audit-scheduling-calendar-day.scheduled,
.night-mode .audit-scheduling-calendar-day.scheduled {
  background: rgba(248, 113, 113, 0.25);
  color: #fca5a5;
}

body.night-mode .audit-scheduling-calendar-day.clickable:hover,
.night-mode .audit-scheduling-calendar-day.clickable:hover {
  background: rgba(248, 113, 113, 0.35);
  outline-color: rgba(248, 113, 113, 0.8);
}

body.night-mode .audit-scheduling-legend,
.night-mode .audit-scheduling-legend {
  color: rgba(255, 255, 255, 0.65);
}

body.night-mode .audit-scheduling-empty,
.night-mode .audit-scheduling-empty {
  color: rgba(255, 255, 255, 0.65);
}

body.night-mode .audit-scheduling-list-item,
.night-mode .audit-scheduling-list-item {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
}

body.night-mode .audit-scheduling-list-item strong,
.night-mode .audit-scheduling-list-item strong {
  color: rgba(255, 255, 255, 0.95);
}

body.night-mode .audit-scheduling-recurrence,
.night-mode .audit-scheduling-recurrence {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
}

body.night-mode .audit-scheduling-btn-sm,
.night-mode .audit-scheduling-btn-sm {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.95);
}

body.night-mode .audit-scheduling-btn-sm:hover,
.night-mode .audit-scheduling-btn-sm:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(248, 113, 113, 0.4);
  color: #fca5a5;
}

body.night-mode .audit-scheduling-btn-danger,
.night-mode .audit-scheduling-btn-danger {
  border-color: rgba(248, 113, 113, 0.5);
  color: #f87171;
}

body.night-mode .audit-scheduling-btn-danger:hover,
.night-mode .audit-scheduling-btn-danger:hover {
  background: rgba(248, 113, 113, 0.2);
  border-color: rgba(248, 113, 113, 0.6);
}

body.night-mode .audit-scheduling-back,
.night-mode .audit-scheduling-back {
  color: #f87171;
}

body.night-mode .audit-scheduling-back:hover,
.night-mode .audit-scheduling-back:hover {
  color: #fca5a5;
}

body.night-mode .audit-scheduling-user-email,
body.night-mode .audit-scheduling-user-audit,
.night-mode .audit-scheduling-user-email,
.night-mode .audit-scheduling-user-audit {
  color: rgba(255, 255, 255, 0.8);
}

body.night-mode .audit-scheduling-detail-card,
.night-mode .audit-scheduling-detail-card {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

body.night-mode .audit-scheduling-detail-card-title,
.night-mode .audit-scheduling-detail-card-title {
  color: rgba(255, 255, 255, 0.95);
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

body.night-mode .audit-scheduling-detail-row dt,
.night-mode .audit-scheduling-detail-row dt {
  color: rgba(255, 255, 255, 0.75);
}

body.night-mode .audit-scheduling-detail-row dd,
.night-mode .audit-scheduling-detail-row dd {
  color: rgba(255, 255, 255, 0.9);
}

body.night-mode .audit-scheduling-detail-email,
.night-mode .audit-scheduling-detail-email {
  color: rgba(255, 255, 255, 0.7);
}
