/* ==============================================================
   FLN System - Base / Reset / Typography
============================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  background: var(--bg-body);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 { font-weight: 700; color: var(--text-main); }

a { text-decoration: none; transition: color var(--transition-fast); }

/* Scrollbar polish (webkit browsers) */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c7d2db; border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: #a9b8c5; }

/* Focus visibility for accessibility, without ugly default outline everywhere */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--brand-primary-light);
  outline-offset: 2px;
}

/* Simple entrance animation used on freshly-loaded content panels.
   IMPORTANT: opacity-only, no transform/filter/perspective here - any of those on an
   ancestor would create a new CSS "containing block" and break position:fixed children
   (like Bootstrap modals) rendered inside it, trapping them behind the modal backdrop. */
@keyframes flnFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.fade-in { animation: flnFadeIn var(--transition-slow) both; }

@keyframes flnPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.pop { animation: flnPop 0.3s ease; }

/* Skeleton loading shimmer (optional use) */
@keyframes flnShimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, #eef1f4 25%, #f7f9fb 37%, #eef1f4 63%);
  background-size: 800px 100%;
  animation: flnShimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}

/* Print: hide chrome, show only the report content */
@media print {
  .app-topbar, .app-sidebar, .sidebar-backdrop, .export-toolbar, .entry-action-bar,
  .no-print, form button, .btn { display: none !important; }
  .main-content { padding: 0 !important; margin: 0 !important; }
  body { background: #fff !important; }
  .card { box-shadow: none !important; border: 1px solid #ccc !important; }
  /* Same reasoning as the PDF export: a solid dark header background often prints as
     heavy black ink (or vanishes to white-on-white if the browser skips background
     colors), so swap to a light tint + dark bold text specifically for print. */
  .table-report thead th {
    background: #dbe9ec !important;
    color: #0f3947 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
