:root {
  color-scheme: light;
  --app-bg: #f4f7fb;
  --app-surface: rgba(255, 255, 255, 0.88);
  --app-border: rgba(148, 163, 184, 0.22);
  --app-text: #0f172a;
  --app-muted: #64748b;
  --app-primary: #2563eb;
  --app-primary-soft: #dbeafe;
  --app-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

body.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background:
    radial-gradient(
      circle at top left,
      rgba(37, 99, 235, 0.12),
      transparent 28%
    ),
    linear-gradient(180deg, #f8fbff 0%, var(--app-bg) 100%);
  color: var(--app-text);
}

.app-main-container {
  flex: 1 0 auto;
}

.app-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      circle at top right,
      rgba(59, 130, 246, 0.12),
      transparent 24%
    ),
    radial-gradient(
      circle at bottom left,
      rgba(125, 211, 252, 0.14),
      transparent 22%
    );
  z-index: -1;
}

.app-header,
.app-card {
  background: var(--app-surface);
  backdrop-filter: blur(10px);
  border: 1px solid var(--app-border);
  border-radius: 0.9rem;
  box-shadow: var(--app-shadow);
}

.app-header {
  border-radius: 0.85rem;
}

.icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
}

.icon-circle-sm {
  width: 1.8rem;
  height: 1.8rem;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.app-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.55rem;
  background: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.14);
}

.app-brand-mark-lg {
  width: 3.5rem;
  height: 3.5rem;
  font-size: 2rem;
}

.app-nav .nav-link {
  border-radius: 999px;
  color: var(--app-muted);
  background: #fff;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.84rem;
  line-height: 1.1;
  padding: 0.38rem 0.7rem;
}

.app-nav .nav-link:hover,
.app-nav .nav-link:focus {
  color: var(--app-primary);
  border-color: rgba(37, 99, 235, 0.16);
  background: #f8fbff;
}

.app-nav .nav-link.active {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: #fff;
  box-shadow: 0 6px 12px rgba(37, 99, 235, 0.16);
}

.app-session {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.app-table {
  --bs-table-bg: transparent;
  --bs-table-border-color: rgba(148, 163, 184, 0.2);
  margin-bottom: 0;
  font-size: 0.92rem;
}

.app-table thead th {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--app-muted);
  background: rgba(37, 99, 235, 0.04);
  border-bottom-width: 1px;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.app-table tbody td {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.app-table tbody tr:last-child > * {
  border-bottom-width: 0;
}

.app-card .card-body {
  padding: 0.9rem;
}

.app-card .form-control,
.app-card .form-select {
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: none;
  font-size: 0.9rem;
  padding-top: 0.42rem;
  padding-bottom: 0.42rem;
}

.app-card .form-label,
.app-card .form-check-label {
  font-size: 0.84rem;
  margin-bottom: 0.2rem;
}

.app-card .badge,
.app-header .badge {
  font-size: 0.72rem;
  font-weight: 600;
}

.app-card .btn,
.app-header .btn {
  font-size: 0.84rem;
  padding: 0.4rem 0.7rem;
}

.app-card .form-control:focus,
.app-card .form-select:focus {
  border-color: rgba(37, 99, 235, 0.42);
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.12);
}

.app-card .btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  border-color: #2563eb;
}

.app-card .btn-outline-primary {
  border-color: rgba(37, 99, 235, 0.24);
  color: var(--app-primary);
}

.app-card .btn-outline-primary:hover {
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.32);
}

.letter-spacing-1 {
  letter-spacing: 0.05em;
}

.app-table tbody tr.table-row-unmet {
  background-color: rgba(220, 38, 38, 0.12) !important;
}

.app-table tbody tr.table-row-unmet:hover {
  background-color: rgba(220, 38, 38, 0.18) !important;
}

.summary-progress {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.summary-progress-paid,
.summary-progress-target {
  min-width: 3.5rem;
}

.summary-progress-paid {
  display: inline-block;
  text-align: right;
}

.summary-progress-separator {
  padding-inline: 0.5rem;
}

.summary-progress-target {
  display: inline-block;
  text-align: left;
}

@media (max-width: 991.98px) {
  .app-nav .nav-link {
    text-align: center;
  }
}

/* Custom card header styling */
.card-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

/* Shadow utilities */
.shadow-sm {
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

.shadow-lg {
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}

.fs-xs {
  font-size: 0.7rem !important;
}

.fs-xxs {
  font-size: 0.65rem !important;
}

.app-toast-container {
  z-index: 1080;
}

.app-footer {
  margin-top: auto;
  font-size: 0.75rem;
}

.app-footer a:hover {
  color: var(--app-primary) !important;
  opacity: 1 !important;
}

.demo-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.2);
}

.form-control::placeholder {
  opacity: 0.5 !important;
}

/* Toggle Switch Styles */
.btn-group.w-100 .btn {
  border-width: 1.5px;
  font-weight: 600;
  transition: all 0.2s ease-in-out;
}

.btn-check:checked + .btn-outline-success {
  background-color: #198754;
  color: #fff;
  box-shadow: 0 4px 10px rgba(25, 135, 84, 0.25);
}

.btn-check:checked + .btn-outline-danger {
  background-color: #dc3545;
  color: #fff;
  box-shadow: 0 4px 10px rgba(220, 53, 69, 0.25);
}
