/* BaufiKlar design-system component layer.
   Tailwind (via CDN) handles layout/utilities; this file holds the small set of
   reusable component classes referenced across views, plus print/scrollbar/motion rules. */

:root {
  --bk-navy: #0B1F3A;
  --bk-blue: #2F6FED;
  --bk-blue-dark: #1E4FBE;
  --bk-green: #16A34A;
  --bk-amber: #D97706;
  --bk-red: #DC2626;
  color-scheme: light;
}
html.dark { color-scheme: dark; }

* { -webkit-tap-highlight-color: transparent; }
body { background: #F5F7FA; }
html.dark body { background: #0B1220; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(11,31,58,0.18); border-radius: 999px; }
html.dark ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.16); }

:focus-visible {
  outline: 2px solid var(--bk-blue);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; font-weight: 600; font-size: 0.875rem; padding: 0.6rem 1.1rem; border-radius: 0.6rem; transition: background-color .15s ease, box-shadow .15s ease, transform .1s ease; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--bk-blue); color: #fff; }
.btn-primary:hover { background: var(--bk-blue-dark); }
.btn-secondary { background: #fff; color: var(--bk-navy); border: 1px solid #D8DFEA; }
.btn-secondary:hover { background: #F5F7FA; }
html.dark .btn-secondary { background: #131C2E; color: #E7ECF6; border-color: #263248; }
html.dark .btn-secondary:hover { background: #182338; }
.btn-danger { background: #fff; color: var(--bk-red); border: 1px solid #F3C7C7; }
.btn-danger:hover { background: var(--bk-red); color: #fff; }
.btn-ghost { background: transparent; color: var(--bk-navy); }
.btn-ghost:hover { background: rgba(11,31,58,0.06); }
html.dark .btn-ghost { color: #E7ECF6; }
html.dark .btn-ghost:hover { background: rgba(255,255,255,0.08); }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8125rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Cards */
.card { background: #fff; border: 1px solid #E7EBF3; border-radius: 0.9rem; box-shadow: 0 1px 2px 0 rgba(11,31,58,0.05); }
html.dark .card { background: #101A2C; border-color: #1E2A42; }
.card-hover { transition: box-shadow .18s ease, transform .18s ease; }
.card-hover:hover { box-shadow: 0 8px 20px -6px rgba(11,31,58,0.16); transform: translateY(-1px); }

/* Inputs */
.field-label { display: block; font-size: 0.8125rem; font-weight: 600; color: #334158; margin-bottom: 0.35rem; }
html.dark .field-label { color: #C7D0E0; }
.input, select.input, textarea.input { width: 100%; border: 1px solid #D8DFEA; border-radius: 0.6rem; padding: 0.6rem 0.75rem; font-size: 0.9rem; background: #fff; color: #0B1F3A; transition: border-color .15s ease, box-shadow .15s ease; }
.input:focus { border-color: var(--bk-blue); box-shadow: 0 0 0 3px rgba(47,111,237,0.15); outline: none; }
html.dark .input, html.dark select.input, html.dark textarea.input { background: #0E1728; border-color: #263248; color: #E7ECF6; }
.field-hint { font-size: 0.78rem; color: #6B7A94; margin-top: 0.3rem; }
.field-error { font-size: 0.78rem; color: var(--bk-red); margin-top: 0.3rem; }

/* Badges / status pills */
.badge { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.72rem; font-weight: 600; padding: 0.22rem 0.6rem; border-radius: 999px; letter-spacing: 0.01em; }
.badge-blue { background: #EAF1FF; color: #1E4FBE; }
.badge-green { background: #E9F9F0; color: #15803D; }
.badge-amber { background: #FDF3E3; color: #B45309; }
.badge-red { background: #FDEAEA; color: #B91C1C; }
.badge-slate { background: #EEF1F6; color: #475569; }
html.dark .badge-blue { background: #16233E; color: #8FB4FF; }
html.dark .badge-green { background: #0F2A1C; color: #6FDE9E; }
html.dark .badge-amber { background: #2E220C; color: #F3B564; }
html.dark .badge-red { background: #2E1414; color: #F29B9B; }
html.dark .badge-slate { background: #1B2536; color: #A9B6CB; }

/* Progress */
.progress-track { width: 100%; height: 0.5rem; border-radius: 999px; background: #E7EBF3; overflow: hidden; }
html.dark .progress-track { background: #1E2A42; }
.progress-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--bk-blue), #6C9BFF); transition: width .4s ease; }

/* Skeleton loader */
.skeleton { background: linear-gradient(90deg, #EEF1F6 25%, #E4E9F2 37%, #EEF1F6 63%); background-size: 400% 100%; animation: skeleton-shine 1.4s ease infinite; border-radius: 0.5rem; }
html.dark .skeleton { background: linear-gradient(90deg, #17233A 25%, #1E2C46 37%, #17233A 63%); background-size: 400% 100%; }
@keyframes skeleton-shine { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* Toast */
.toast { animation: fade-in .2s ease-out; }

/* Table density */
.table-clean th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: #6B7A94; font-weight: 600; padding: 0.6rem 0.9rem; border-bottom: 1px solid #E7EBF3; }
.table-clean td { padding: 0.75rem 0.9rem; border-bottom: 1px solid #EEF1F6; font-size: 0.875rem; }
html.dark .table-clean th { color: #8B96AB; border-color: #1E2A42; }
html.dark .table-clean td { border-color: #182338; }
.table-clean tbody tr { transition: background-color .12s ease; }
.table-clean tbody tr:hover { background: #F7F9FC; }
html.dark .table-clean tbody tr:hover { background: #101A2C; }

/* Print (application package) */
@media print {
  .no-print { display: none !important; }
  body { background: #fff !important; }
  .print-area { box-shadow: none !important; border: none !important; }
  a[href]::after { content: none !important; }
}
