:root {
  --lipoti-yellow: #f2c94c;
  --lipoti-yellow-soft: #fff8dc;
  --service-brown: #3d2f24;
  --service-ink: #25221f;
  --service-muted: #6f6a64;
  --app-sidebar-width: 15rem;
}
html { font-size: 14px; min-height: 100%; }
@media (min-width: 768px) { html { font-size: 16px; } }
body { background: #f6f5f2; color: var(--service-ink); }
footer a { color: inherit; }
.brand-mark { display: inline-grid; place-items: center; width: 2rem; height: 2rem; margin-right: .35rem; border-radius: 50%; background: var(--lipoti-yellow); color: var(--service-brown); }
.page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-header h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.2rem); }
.card { border: 0; box-shadow: 0 .2rem .9rem rgba(48, 41, 34, .08); }
.metric-card { border-left: .35rem solid var(--lipoti-yellow); }
.metric-value { font-size: 2rem; font-weight: 700; }
.table thead th { background: #ece8e2; color: #4f4943; white-space: nowrap; }
.table-responsive { border-radius: .5rem; }
.btn-primary { --bs-btn-bg: #5b4635; --bs-btn-border-color: #5b4635; --bs-btn-hover-bg: #3d2f24; --bs-btn-hover-border-color: #3d2f24; }
.btn-warning { --bs-btn-bg: var(--lipoti-yellow); --bs-btn-border-color: #ddb43f; }
.form-label { font-weight: 600; }
.required-note { color: var(--service-muted); font-size: .875rem; }
.status-pill { display: inline-flex; padding: .25rem .55rem; border-radius: 999px; background: #ece8e2; font-size: .8rem; font-weight: 600; }
.signature-pad { width: 100%; max-width: 720px; height: 220px; touch-action: none; border: 2px dashed #aaa097; border-radius: .5rem; background: white; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.detail-item { padding: .8rem 1rem; border-radius: .5rem; background: #f7f3ec; }
.detail-item small { display: block; color: var(--service-muted); margin-bottom: .2rem; }
.empty-state { padding: 3rem 1rem; text-align: center; color: var(--service-muted); }
.text-bg-warranty { background: #d8f3dc; color: #1b4332; }
.text-bg-billable { background: #ffe5d9; color: #7f2d12; }
.text-bg-review { background: var(--lipoti-yellow-soft); color: #6b5200; }
input[type="date"], input[type="month"] { min-height: 2.4rem; }

/* Oldalváz és főmenü.
   Kis képernyőn (992 px alatt) felül van a menüsáv, a menü lenyíló lista.
   992 px-től a menü a BAL oldali oszlopban áll, görgetés közben is a helyén marad.
   A fejléc a HTML-ben a tartalom előtt van, így a bejárási sorrend megegyezik a képernyőn láthatóval.
   A nem belépett felhasználó (belépő oldal) mindig csak a felső márkasávot kapja. */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }
.app-content { flex: 1 0 auto; display: flex; flex-direction: column; min-width: 0; }
.app-content > main { flex: 1 0 auto; }
.app-content > footer { flex-shrink: 0; }

.app-nav { background: var(--service-brown); color: #fff; box-shadow: 0 .125rem .5rem rgba(0, 0, 0, .15); }
.app-nav-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 1rem; }
.app-brand { display: inline-flex; align-items: center; gap: .55rem; font-size: 1.2rem; font-weight: 700; color: #fff; text-decoration: none; }
.app-brand:hover, .app-brand:focus-visible { color: #fff; }
.app-brand .brand-mark { flex: none; margin-right: 0; }
.app-nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem; padding: 0; border: 1px solid rgba(255, 255, 255, .35); border-radius: .5rem; background: transparent; }
.app-nav-toggle:hover { background: rgba(255, 255, 255, .1); }
.app-nav-toggle-icon { width: 1.5rem; height: 1.5rem; background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") center / 100% no-repeat; }
.app-nav-menu { padding: .25rem 1rem 1rem; }
.app-nav-list { display: flex; flex-direction: column; gap: .15rem; margin: 0; padding: 0; list-style: none; }
.app-nav-link { display: block; padding: .65rem .9rem; border-radius: .5rem; color: rgba(255, 255, 255, .8); text-decoration: none; }
.app-nav-link:hover, .app-nav-link:focus-visible { background: rgba(255, 255, 255, .09); color: #fff; }
.app-nav-link.active { background: rgba(242, 201, 76, .16); color: var(--lipoti-yellow); font-weight: 600; box-shadow: inset .25rem 0 0 var(--lipoti-yellow); }
.app-nav a:focus-visible, .app-nav button:focus-visible { outline: 2px solid var(--lipoti-yellow); outline-offset: 2px; }
.app-nav-user { display: flex; flex-direction: column; gap: .6rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, .15); }
.app-nav-user-name { font-size: .875rem; color: rgba(255, 255, 255, .75); overflow-wrap: anywhere; }

@media (min-width: 992px) {
  .app-shell-guest .app-nav-bar { padding: .6rem 1.5rem; }

  .app-shell:not(.app-shell-guest) { flex-direction: row; }
  /* Egymás mellett a tartalom a menü melletti teljes szélességet kapja; a hosszú táblák ne tolják ki a menüt (a táblák maguk görgethetők). */
  .app-shell:not(.app-shell-guest) > .app-content { flex: 1 1 0%; }
  .app-shell:not(.app-shell-guest) > .app-nav { display: flex; flex-direction: column; flex: 0 0 var(--app-sidebar-width); align-self: flex-start; position: sticky; top: 0; width: var(--app-sidebar-width); height: 100vh; overflow-y: auto; box-shadow: .25rem 0 1rem rgba(48, 41, 34, .15); }
  .app-shell:not(.app-shell-guest) .app-nav-bar { padding: 1.4rem 1.25rem 1rem; }
  .app-shell:not(.app-shell-guest) .app-nav-toggle { display: none; }
  /* Nagy képernyőn a menü mindig látszik: a Bootstrap „collapse” elrejtését itt felülírjuk. */
  .app-shell:not(.app-shell-guest) .app-nav-menu,
  .app-shell:not(.app-shell-guest) .app-nav-menu.collapse:not(.show) { display: flex; flex-direction: column; flex: 1 1 auto; padding: .25rem 1rem 1.25rem; }
  .app-shell:not(.app-shell-guest) .app-nav-user { margin-top: auto; }
  /* Ha a menü magasabb a böngészőablaknál, saját, vékony görgetősávval görgethető. */
  .app-shell:not(.app-shell-guest) > .app-nav { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .3) transparent; }
}

/* Alacsony ablakban (például kis laptop) kompaktabb menü, hogy görgetés nélkül elférjen. */
@media (min-width: 992px) and (max-height: 680px) {
  .app-shell:not(.app-shell-guest) .app-nav-bar { padding-top: .9rem; padding-bottom: .5rem; }
  .app-shell:not(.app-shell-guest) .app-nav-link { padding-top: .45rem; padding-bottom: .45rem; }
  .app-shell:not(.app-shell-guest) .app-nav-user { margin-top: .6rem; padding-top: .6rem; }
}
