/* Uebergangs-Kompatibilitaet fuer App-Templates ohne Tabler */

.container-xl {
  width: 100%;
  max-width: 80rem;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.page-header {
  margin-bottom: 1.5rem;
}

.page-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--sa-ink);
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin-left: -0.5rem;
  margin-right: -0.5rem;
}

.row > * {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.row-cards,
.row-deck {
  row-gap: 1rem;
}

.g-2 { gap: 0.5rem; }
.g-3 { gap: 1rem; }
.mb-0 { margin-bottom: 0; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.ms-auto { margin-left: auto; }
.me-1 { margin-right: 0.25rem; }

.col,
.col-auto,
.col-12,
.col-sm-6,
.col-lg-3,
.col-lg-5,
.col-lg-7,
.col-lg-9,
.col-lg-auto,
.col-md-6 {
  flex: 0 0 auto;
  width: 100%;
}

.col-auto,
.col-lg-auto { width: auto; }

@media (min-width: 576px) {
  .col-sm-6 { width: 50%; }
}

@media (min-width: 768px) {
  .col-md-6 { width: 50%; }
}

@media (min-width: 992px) {
  .col-lg-3 { width: 25%; }
  .col-lg-5 { width: 41.666667%; }
  .col-lg-7 { width: 58.333333%; }
  .col-lg-9 { width: 75%; }
}

.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-none { display: none; }
.d-print-none { display: block; }
.flex-wrap { flex-wrap: wrap; }
.flex-column { flex-direction: column; }
.flex-grow-1 { flex-grow: 1; }
.align-items-center { align-items: center; }
.align-items-end { align-items: flex-end; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.justify-content-end { justify-content: flex-end; }
.gap-2 { gap: 0.5rem; }
.text-center { text-align: center; }
.text-secondary { color: var(--sa-muted); }
.text-reset { color: inherit; }
.text-decoration-none { text-decoration: none; }
.small { font-size: 0.875rem; }
.fw-bold { font-weight: 700; }
.w-100 { width: 100%; }
.position-relative { position: relative; }

@media (min-width: 1200px) {
  .d-xl-block { display: block; }
}

@media (min-width: 768px) {
  .d-md-none { display: none; }
  .d-md-flex { display: flex; }
}

@media print {
  .d-print-none { display: none !important; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  border-radius: 0.625rem;
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-sm {
  padding: 0.3125rem 0.625rem;
  font-size: 0.8125rem;
}

.btn-primary {
  background: var(--sa-primary);
  border-color: var(--sa-primary);
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary.active {
  background: var(--sa-primary-hover);
  border-color: var(--sa-primary-hover);
  color: #fff;
}

.btn-outline-primary {
  background: var(--sa-secondary-soft);
  border-color: #86b2b1;
  color: #3f5f61;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary.active {
  background: #e5f0f0;
  border-color: var(--sa-secondary);
  color: var(--sa-ink-muted);
}

.btn-outline-secondary {
  background: transparent;
  border-color: var(--sa-border);
  color: var(--sa-body-color);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  background: var(--sa-surface-muted);
}

.btn-outline-info {
  background: transparent;
  border-color: #67e8f9;
  color: #0891b2;
}

.btn-outline-danger {
  background: transparent;
  border-color: #fca5a5;
  color: #dc2626;
}

.btn-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card {
  border: 1px solid var(--sa-border);
  border-radius: 1rem;
  background: var(--sa-surface);
  box-shadow: 0 10px 30px -20px rgba(15, 23, 42, 0.25);
}

.card-header,
.card-body,
.card-footer {
  padding: 1rem 1.25rem;
}

.card-header {
  border-bottom: 1px solid var(--sa-border);
}

.card-footer {
  border-top: 1px solid var(--sa-border);
}

.card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--sa-ink);
}

.card-subtitle {
  margin: 0.25rem 0 0;
  color: var(--sa-muted);
  font-size: 0.875rem;
}

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

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

.table th,
.table td {
  padding: 0.75rem 0.875rem;
  border-bottom: 1px solid var(--sa-border);
  text-align: left;
  vertical-align: middle;
}

.table thead th {
  font-weight: 600;
  color: var(--sa-muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.bg-red,
.bg-danger {
  background: #ef4444;
  color: #fff;
}

.alert {
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid transparent;
  font-size: 0.875rem;
}

.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info { background: #ecfeff; border-color: #a5f3fc; color: #155e75; }

.alert-dismissible {
  position: relative;
  padding-right: 2.5rem;
}

.btn-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 1rem;
  height: 1rem;
  border: none;
  background: transparent;
  opacity: 0.6;
  cursor: pointer;
}

.btn-close::before {
  content: "×";
  font-size: 1.125rem;
  line-height: 1;
}

.form-control,
.form-select,
textarea.form-control {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--sa-border);
  border-radius: 0.625rem;
  background: var(--sa-surface);
  color: var(--sa-body-color);
  font-size: 0.875rem;
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--sa-primary);
  box-shadow: 0 0 0 3px rgba(68, 207, 197, 0.15);
}

.form-label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Breadcrumb: siehe sa-components.css (.sa-breadcrumb / .breadcrumb) */

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background: var(--sa-secondary-soft);
  color: var(--sa-ink-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.avatar-sm {
  width: 2rem;
  height: 2rem;
  font-size: 0.75rem;
}

.avatar-xl {
  width: 4rem;
  height: 4rem;
  font-size: 1.125rem;
}

.bg-transparent { background: transparent; }

[data-bs-theme="dark"] .btn-outline-primary {
  background: rgba(104, 151, 151, 0.12);
  color: #cbd5e1;
}

[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background: #0f172a;
  color: #e2e8f0;
}
