:root {
  --header-height: 72px;
  --nav-width: 248px;
  --color-gray: #f3f5f7;
  --color-gray-dark: #dce2e7;
  --color-red: #b8000a;
  --color-red-dark: #940008;
  --color-black: #171a20;
  --color-text: #20252d;
  --color-text-muted: #53606e;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 2px 8px rgb(24 36 49 / .055);
  --shadow-lg: 0 12px 34px rgb(24 36 49 / .09);
}

body {
  background: #f3f5f7;
  line-height: 1.55;
}

body::before {
  position: fixed;
  z-index: 2;
  inset: var(--header-height) 0 0;
  content: "";
  pointer-events: none;
  background: url("/assets/images/rechnungslogo.jpg") center / min(78vw, 760px) auto no-repeat;
  mix-blend-mode: multiply;
  opacity: .075;
}

main {
  position: relative;
  z-index: 1;
  padding: clamp(18px, 3vw, 36px);
}

main > h2,
main > section > h2 {
  margin: 0 0 8px;
  font-size: clamp(1.42rem, 2.4vw, 2rem);
  line-height: 1.2;
  letter-spacing: -.025em;
}

.app-header {
  background: #fff;
  box-shadow: 0 2px 12px rgb(24 36 49 / .06);
}
.header-container { padding-inline: clamp(10px, 2.5vw, 28px); gap: 10px; }
.brand { flex-shrink: 1; min-width: 0; }
.brand-logo { display: block; width: clamp(126px, 39vw, 194px); max-width: 100%; height: auto; max-height: 51px; object-fit: contain; }
.brand-text { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.nav-toggle { position: relative; width: 46px; min-width: 46px; height: 46px; padding: 0; }
.nav-hamburger, .nav-hamburger::before, .nav-hamburger::after {
  position: absolute;
  display: block;
  width: 28px;
  height: 2.5px;
  border-radius: 99px;
  background: currentColor;
}
.nav-hamburger { left: 9px; top: 22px; }
.nav-hamburger::before, .nav-hamburger::after { content: ""; left: 0; }
.nav-hamburger::before { top: -8px; }
.nav-hamburger::after { top: 8px; }

.header-actions { flex-shrink: 0; gap: 10px; }
.header-actions .btn {
  position: relative;
  min-height: 34px;
  padding: 3px 8px;
  line-height: 1.2;
  font-size: .72rem;
  background: #fff;
  color: var(--color-red);
  border: 1px solid #e5c2c5;
}
.header-actions .btn::after { position: absolute; inset: -5px 0; content: ""; }
.header-actions .btn:hover, .header-actions .btn:focus-visible { background: #fff2f2; }
.user-info { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.app-nav { background: #171a20; }
.nav-item { padding: 12px 16px; border-color: rgb(255 255 255 / .08); }
.nav-item.active { background: #38262d; box-shadow: inset 3px 0 var(--color-red); color: white; }
.nav-footer { padding: 14px 16px; }
.card, .kpi-card, .auth-card { background: rgb(255 255 255 / .92); }
.card { border-color: #e1e6ec; }
.btn, .form-group input, .form-group select, .form-group textarea { border-radius: var(--radius); }
.btn-primary { background: var(--color-red); }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--color-red-dark); }
.btn-outline { border-width: 1px; border-color: #aab5c0; color: #28343f; }
.btn-outline:hover, .btn-outline:focus-visible { background: #eef1f5; color: #171a20; }
.btn-danger { background: #a40009; }
.table { background: rgb(255 255 255 / .92); }
.table th { color: #303944; }
.app-footer { position: relative; z-index: 1; background: #171a20; }
.auth-card { border: 1px solid #e0e5eb; }
.is-guest .app-nav, .is-guest .nav-toggle, .is-guest .header-actions { display: none; }
.is-guest main { margin-inline: auto; }

.montech-welcome {
  position: relative;
  display: flex;
  align-items: flex-end;
  isolation: isolate;
  min-height: clamp(140px, 21vw, 280px);
  margin: 0 0 22px;
  overflow: hidden;
  border-radius: 18px;
  color: white;
  background: #3a302a;
  box-shadow: var(--shadow-lg);
}
.montech-welcome::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, rgb(19 15 13 / .84), rgb(19 15 13 / .35) 56%, transparent 86%);
}
.montech-welcome img {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 57%;
  animation: montech-kitchen-slide 1.05s cubic-bezier(.18,.72,.24,1) both;
}
.montech-welcome-copy { padding: clamp(16px, 3vw, 36px); }
.montech-welcome h2 { color: white; font-size: clamp(1.45rem, 3.4vw, 2.6rem); line-height: 1.1; letter-spacing: -.025em; overflow-wrap: anywhere; }
.montech-welcome p { margin-top: 5px; font-weight: 600; color: #fff; overflow-wrap: anywhere; }
@keyframes montech-kitchen-slide {
  from { transform: translateX(13%) scale(1.13); opacity: .55; }
  to { transform: translateX(0) scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .montech-welcome img { animation: none; }
}

@media (min-width: 768px) {
  .app-nav { position: fixed; top: var(--header-height); bottom: 0; height: auto; float: none; }
  body:not(.is-guest) .app-footer { margin-left: var(--nav-width); }
}
@media (max-width: 767px) {
  :root { --header-height: 60px; }
  main { padding: 12px; }
  .brand-logo { width: clamp(118px, 42vw, 175px); max-height: 42px; }
  .header-actions .btn { min-height: 34px; padding: 3px 7px; }
  .header-actions .user-info { display: none; }
  .nav-toggle { display: block; }
  .card-header { gap: 8px; }
  .montech-welcome { border-radius: 14px; margin-bottom: 16px; }
}
