/* App layer on top of the vendored Modernist DS. modernist.css stays verbatim;
   everything brand-energy lives here. */

/* ── Motion layer ──────────────────────────────────────────────────────────
   The DS ships with zero transitions; a marketing agency's tool should react.
   Fast (120-160ms), architectural (no bounce), and off for reduced-motion. */
button, a, .btn, .tag, .input, [role="button"], .nav a {
  transition: background-color 140ms ease-out, color 140ms ease-out,
    border-color 140ms ease-out, transform 120ms ease-out, box-shadow 140ms ease-out;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary:hover { background: #c9280f; border-color: #c9280f; }
[role="button"]:hover { box-shadow: 4px 4px 0 var(--color-neutral-400); transform: translate(-1px, -1px); }
[role="button"]:active { box-shadow: none; transform: translate(0, 0); }
table tbody tr { transition: background-color 120ms ease-out; }
table tbody tr:hover { background: rgba(29, 29, 27, 0.035); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ── Auth poster energy ────────────────────────────────────────────────────
   Red geometry drifts once (8s) then rests; the copy settles in on load;
   a signature stripe block signs the poster like a print mark. */
.poster-geometry {
  position: absolute;
  top: -120px;
  right: -160px;
  width: 420px;
  height: 420px;
  background: var(--color-accent);
  transform: rotate(45deg) translateY(0);
  opacity: 0.92;
  animation: poster-drift 8s ease-in-out 1 forwards;
}
@keyframes poster-drift {
  from { transform: rotate(45deg) translateY(-40px); }
  to { transform: rotate(45deg) translateY(0); }
}
.poster-copy { animation: settle 400ms ease-out both; }
.poster-stripes {
  width: 120px;
  height: 24px;
  background: repeating-linear-gradient(135deg, var(--color-accent) 0 8px, transparent 8px 16px);
}
@keyframes settle {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Masthead energy ───────────────────────────────────────────────────────
   Screen-header kickers get a red anchor mark; screens settle in on route
   change (180ms, once per mount). */
main div:has(> h2) > .card-kicker::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 8px;
  margin-right: 8px;
  background: var(--color-accent);
  vertical-align: baseline;
}
.app-shell main > div:last-child { animation: settle 180ms ease-out both; }

/* Load/metric bars draw to their value on mount (Dispatch, Analytics). */
.bar-fill {
  transform-origin: left center;
  animation: bar-draw 400ms ease-out both;
}
@keyframes bar-draw {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* Brand marks: red text selection + a 3px brand stripe along the top edge. */
::selection { background: var(--color-accent); color: #fff; }
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-accent);
  z-index: 60;
  pointer-events: none;
}

/* ── Ink sidebar ───────────────────────────────────────────────────────────
   The login poster's ink+red language carried into the workspace: the brand is
   present all day, and the active section is a red block, not a gray whisper. */
.app-aside {
  background: var(--color-text);
  color: var(--color-bg);
  border-right: none !important;
}
.app-aside nav a:not(.active):hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
  transform: translateX(2px);
}
.app-aside .btn-ghost { color: var(--color-bg); }
.app-aside .btn-ghost:hover { color: var(--color-accent); }

/* App-level responsive fallback. The Modernist DS (vendored verbatim) is
   desktop-only by design; below tablet width we stack the shell so the app
   degrades to a scrollable single column instead of overflowing. */
/* Print only the open payslip (Payroll › View › Print / Save PDF). */
@media print {
  body * { visibility: hidden; }
  .payslip-print, .payslip-print * { visibility: visible; }
  .payslip-print { position: absolute; inset: 0; width: 100% !important; box-shadow: none; }
  .payslip-print .dialog-actions { display: none; }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .app-aside {
    position: static !important;
    height: auto !important;
    border-right: none !important;
    border-bottom: 2px solid var(--color-divider);
  }
  .app-aside nav {
    flex-direction: row !important;
    flex-wrap: wrap;
  }
}
