/* YAA.hu – admin felület. Színvilág: a logó petrolkékje, sötétszürke, világos háttér. */
:root {
  --yaa-primary: #1c7191;
  --yaa-primary-dark: #165b75;
  --yaa-primary-soft: #e6f2f6;
  --yaa-ink: #2b2b2b;
  --yaa-bg: #e9ecef;
  --yaa-border: #dde2e6;
  --bs-primary: #1c7191;
  --bs-primary-rgb: 28, 113, 145;
  --bs-link-color: #1c7191;
  --bs-link-color-rgb: 28, 113, 145;
  --bs-link-hover-color: #165b75;
  --bs-link-hover-color-rgb: 23, 90, 114;
}

body { background: var(--yaa-bg); color: var(--yaa-ink); }

.btn-primary {
  --bs-btn-bg: #1c7191; --bs-btn-border-color: #1c7191;
  --bs-btn-hover-bg: #165b75; --bs-btn-hover-border-color: #165b75;
  --bs-btn-active-bg: #11485d; --bs-btn-active-border-color: #11485d;
  --bs-btn-disabled-bg: #1c7191; --bs-btn-disabled-border-color: #1c7191;
  --bs-btn-focus-shadow-rgb: 28, 113, 145;
}
.btn-outline-primary {
  --bs-btn-color: #1c7191; --bs-btn-border-color: #1c7191;
  --bs-btn-hover-bg: #1c7191; --bs-btn-hover-border-color: #1c7191;
  --bs-btn-active-bg: #165b75; --bs-btn-active-border-color: #165b75;
  --bs-btn-focus-shadow-rgb: 28, 113, 145;
}
.text-primary { color: var(--yaa-primary) !important; }
.form-control:focus, .form-select:focus, .form-check-input:focus {
  border-color: #7db4c9; box-shadow: 0 0 0 .2rem rgba(28, 113, 145, .2);
}
.form-check-input:checked { background-color: var(--yaa-primary); border-color: var(--yaa-primary); }
.form-label { font-weight: 500; margin-bottom: .3rem; }

/* ---------- Belépés, regisztráció, hibaoldal ---------- */
.auth-wrap {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2rem 1rem;
}
.auth-logo { width: 200px; height: auto; margin-bottom: .75rem; }
.auth-title { font-size: 2rem; font-weight: 400; margin-bottom: 1.25rem; }
.auth-card {
  width: 100%; max-width: 360px; background: #fff; border-radius: .5rem; padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}
.auth-card.wide { max-width: 720px; }
.auth-alert { width: 100%; max-width: 360px; }
.form-section { font-size: 1.15rem; font-weight: 500; color: var(--yaa-primary); margin-bottom: 1rem; }
.error-code { font-size: 3.5rem; font-weight: 700; color: var(--yaa-primary); line-height: 1; margin-bottom: .75rem; }
@media (min-width: 768px) {
  .register-divider { border-left: 1px solid var(--yaa-border); }
}

/* ---------- Alkalmazáskeret ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { --bs-offcanvas-width: 280px; }
/* A Bootstrap .nav alapból tördel; oszlopban ez minden sort a legszélesebb elem szélességére húzna */
.sidebar .nav { flex-wrap: nowrap; }
.sidebar-inner {
  display: flex; flex-direction: column; width: 100%; height: 100%; background: #fff;
  border-right: 1px solid var(--yaa-border); padding: 1rem .75rem;
  overflow-y: auto;
}
@media (min-width: 992px) {
  .sidebar { width: 280px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; }
}
.sidebar-logo { display: block; padding: .25rem .5rem 1rem; }
.sidebar-logo img { width: 220px; max-width: 100%; height: auto; }
.sidebar .nav-link {
  display: flex; align-items: center; gap: .7rem; color: var(--yaa-ink); border-radius: .4rem;
  padding: .55rem .75rem; margin-bottom: 2px;
}
.sidebar .nav-link i { font-size: 1.1rem; width: 1.25rem; text-align: center; color: #6b757d; }
.sidebar .nav-link > span:not(.badge) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .nav-link:hover { background: #f1f3f5; }
.sidebar .nav-link.active { background: var(--yaa-primary-soft); color: var(--yaa-primary-dark); font-weight: 600; }
.sidebar .nav-link.active i { color: var(--yaa-primary); }
.sidebar .nav-link.disabled { color: #9aa2a9; }
.sidebar .nav-link.disabled i { color: #b6bcc2; }
.sidebar .badge.soon { flex-shrink: 0; background: #eef0f2; color: #7a8289; font-weight: 500; font-size: .66rem; }
.nav-section {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #8a9299;
  padding: 1rem .75rem .35rem;
}
.sidebar-foot { margin-top: auto; padding: 1rem .75rem 0; font-size: .75rem; color: #9aa2a9; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; background: #fff; border-bottom: 1px solid var(--yaa-border);
  padding: .6rem 1rem; position: sticky; top: 0; z-index: 1020;
}
.topbar-company { display: flex; align-items: center; gap: .6rem; font-weight: 600; min-width: 0; }
.topbar-company span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-company img { height: 32px; width: auto; max-width: 110px; object-fit: contain; }
.content { padding: 1.25rem 1rem 2rem; }
@media (min-width: 992px) { .content { padding: 1.5rem 1.75rem 2.5rem; } }

.page-head { margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.6rem; font-weight: 600; margin-bottom: .15rem; }

.card { border: 1px solid var(--yaa-border); border-radius: .5rem; }
.card-header { background: #fff; font-weight: 600; border-bottom: 1px solid var(--yaa-border); }
.table > thead th {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: #6b757d;
  font-weight: 600; background: #f8f9fa; white-space: nowrap;
}
.table > :not(caption) > * > * { padding: .65rem .9rem; }

.stat-card { background: #fff; border: 1px solid var(--yaa-border); border-radius: .5rem; padding: 1rem 1.1rem; height: 100%; }
.stat-label { font-size: .85rem; color: #6b757d; }
.stat-label i { color: var(--yaa-primary); margin-right: .25rem; }
.stat-value { font-size: 1.9rem; font-weight: 700; line-height: 1.2; margin: .15rem 0; }
.stat-note { font-size: .78rem; color: #9aa2a9; }

.logo-preview {
  display: flex; align-items: center; justify-content: center; min-height: 140px; padding: 1rem;
  border: 1px dashed #c5ccd2; border-radius: .5rem;
  background: repeating-conic-gradient(#f4f5f6 0% 25%, #fff 0% 50%) 50% / 20px 20px;
}
.logo-preview img { max-width: 100%; max-height: 160px; }

/* ---------- Autók ---------- */
.status-tabs { gap: .25rem; flex-wrap: nowrap; overflow-x: auto; }
.status-tabs .nav-link { color: var(--yaa-ink); white-space: nowrap; padding: .4rem .85rem; }
.status-tabs .nav-link.active { background: var(--yaa-primary); color: #fff; }
.filter-bar { padding: .9rem 1rem; }
.plate { display: inline-block; border: 1.5px solid #2b2b2b; border-radius: 3px; padding: 0 .35rem; font-weight: 700;
  font-size: .78rem; letter-spacing: .04em; background: #fff; line-height: 1.4; }

.vehicle-list { display: flex; flex-direction: column; gap: .5rem; }
.vehicle-row { display: flex; gap: 1rem; align-items: center; background: #fff; border: 1px solid var(--yaa-border);
  border-radius: .5rem; padding: .6rem; color: var(--yaa-ink); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.vehicle-row:hover { border-color: #9cc3d1; box-shadow: 0 2px 8px rgba(0, 0, 0, .06); color: var(--yaa-ink); }
.vr-img { position: relative; flex: 0 0 132px; height: 99px; border-radius: .35rem; overflow: hidden; background: #eef1f3;
  display: flex; align-items: center; justify-content: center; color: #a5adb3; font-size: 1.6rem; }
.vr-img img { width: 100%; height: 100%; object-fit: cover; }
.vr-count { position: absolute; right: 4px; bottom: 4px; background: rgba(0, 0, 0, .6); color: #fff; font-size: .7rem; border-radius: 3px; padding: 0 .3rem; }
.vr-main { flex: 1; min-width: 0; }
.vr-title { font-weight: 600; font-size: 1.02rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vr-meta { color: #6b757d; font-size: .88rem; margin: .1rem 0 .35rem; }
.vr-tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.vr-tags .badge { font-weight: 500; }
.vr-side { text-align: right; flex-shrink: 0; }
.vr-price { font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.vr-price .old { display: block; font-weight: 400; font-size: .78rem; color: #8a9299; text-decoration: line-through; }
.vr-days { font-size: .8rem; color: #8a9299; }
@media (max-width: 575.98px) {
  .vehicle-row { flex-wrap: wrap; gap: .6rem; }
  .vr-img { flex-basis: 96px; height: 72px; }
  .vr-main { flex-basis: calc(100% - 110px); }
  .vr-side { width: 100%; display: flex; justify-content: space-between; align-items: baseline; text-align: left; }
}

.more-fields summary { cursor: pointer; color: var(--yaa-primary); font-weight: 500; }
.eq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .15rem 1rem; }
.eq-item { margin: 0; padding: .2rem 0 .2rem 1.6rem; font-size: .92rem; }
.accordion-button:not(.collapsed) { background: var(--yaa-primary-soft); color: var(--yaa-primary-dark); box-shadow: none; }
.accordion-button:focus { box-shadow: 0 0 0 .2rem rgba(28, 113, 145, .2); }

.sticky-save { position: sticky; bottom: 0; z-index: 5; background: rgba(233, 236, 239, .92); backdrop-filter: blur(4px);
  padding: .75rem 0; margin-bottom: 1rem; display: flex; gap: .5rem; }
@media (min-width: 1200px) { .side-sticky { position: sticky; top: 76px; } }
.status-buttons { display: flex; flex-wrap: wrap; gap: .35rem; }
.danger-zone summary { cursor: pointer; }

/* ---------- Fotók ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; margin-bottom: .75rem; }
.photo-grid:empty { display: none; }
.photo { position: relative; aspect-ratio: 4 / 3; border-radius: .4rem; overflow: hidden; background: #eef1f3; cursor: grab;
  border: 2px solid transparent; }
.photo:first-child { border-color: var(--yaa-primary); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.photo.sortable-ghost { opacity: .35; }
.photo-badge { position: absolute; left: 6px; top: 6px; background: var(--yaa-primary); color: #fff; font-size: .7rem; font-weight: 600;
  border-radius: 3px; padding: .05rem .4rem; }
.photo-actions { position: absolute; right: 4px; bottom: 4px; display: flex; gap: 3px; }
.photo-actions button, .photo-actions a { width: 30px; height: 30px; border: 0; border-radius: 4px; background: rgba(255, 255, 255, .92);
  color: var(--yaa-ink); display: flex; align-items: center; justify-content: center; font-size: .85rem; text-decoration: none; }
.photo-actions .del { color: #b02a37; }
.photo-drop { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: 1.4rem 1rem; border: 2px dashed #b9c4cb;
  border-radius: .5rem; text-align: center; cursor: pointer; background: #fafbfc; margin: 0; }
.photo-drop i { font-size: 1.8rem; color: var(--yaa-primary); }
.photo-drop.over { border-color: var(--yaa-primary); background: var(--yaa-primary-soft); }
.progress-bar { background-color: var(--yaa-primary); transition: width .2s; }
#fotok, .card[id] { scroll-margin-top: 80px; }

/* ---------- Yaani ---------- */
.yaani-bar { display: flex; gap: .4rem; align-items: center; }
.yaani-bar .form-select { width: auto; }
.btn-yaani { background: linear-gradient(135deg, #1c7191, #2a9cc4); color: #fff; border: 0; font-weight: 600; white-space: nowrap; }
.btn-yaani:hover, .btn-yaani:focus { color: #fff; background: linear-gradient(135deg, #165b75, #1b86ad); }
.btn-yaani:disabled { background: #b8c2c8; color: #fff; }
.yaani-spark { display: inline-block; }
.yaani-filled { animation: yaani-flash 1.5s ease; }
@keyframes yaani-flash { 0% { background: #e6f2f6; } 100% { background: #fff; } }

/* ---------- Pénzügyek ---------- */
.profit-box { border-radius: .5rem; padding: .75rem 1rem; margin-bottom: .75rem; text-align: center; }
.profit-box.pos { background: #d1e7dd; color: #0f5132; }
.profit-box.neg { background: #f8d7da; color: #842029; }
.profit-box.na { background: #eef1f3; color: #50585f; }
.profit-value { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.finance-table td { padding: .3rem .25rem; border-color: #eef0f2; }
.cost-list li { display: flex; justify-content: space-between; gap: .5rem; padding: .35rem 0; border-bottom: 1px solid #eef0f2; font-size: .9rem; }
.oldest-list a { color: inherit; text-decoration: none; }

/* ---- 4. kör: okmányfelismerés, ügyfelek, szerződés ---- */
#customer-form .company-only { display: none; }
#customer-form.is-company .company-only { display: block; }
#customer-form.is-company .person-only { display: none; }
#customer-form.is-company .card-header.company-only { display: block; }
.scan-result { border-radius: .5rem; padding: .6rem .8rem; font-size: .9rem; margin: .5rem 1rem 0; }
.scan-box .scan-result { margin: .75rem 0 0; }
.scan-ok { background: #eef6f9; border: 1px solid #cfe6ee; }
.scan-err { background: #fdecec; border: 1px solid #f5c2c2; color: #842029; }
.scan-list { display: grid; grid-template-columns: max-content 1fr; gap: .15rem .9rem; margin: .5rem 0 .25rem; }
.scan-list dt { font-weight: 500; color: #6c757d; }
.scan-list dd { margin: 0; }
label.btn.disabled { pointer-events: none; opacity: .65; }
label.btn-yaani.disabled { background: #b8c2c8; }
.contract-sheet { max-width: 820px; }
.cat-pick-box { background: var(--bs-tertiary-bg, #f4f6fa); border: 1px dashed var(--bs-border-color, #cfd6e2); border-radius: .5rem; padding: .6rem .75rem; margin-bottom: 1rem; }
.cat-pick-box .scan-result { margin: .5rem 0 0; }
.nav-locked { opacity: .6; }
.nav-soon .badge.soon, .nav-link .badge.soon { margin-left: auto; }
.soon-ic { font-size: 2.4rem; color: #1c7191; }
.soon-card { border: 1px dashed var(--bs-border-color); border-radius: .75rem; padding: 1rem; height: 100%; display: flex; gap: .8rem; align-items: flex-start; cursor: pointer; text-decoration: none; color: inherit; background: var(--bs-body-bg); }
.soon-card:hover { border-color: #1c7191; }
.soon-card .bi { font-size: 1.6rem; color: #1c7191; }
.fin-bar { height: 8px; border-radius: 4px; background: #1c7191; }
.fin-bar.neg { background: #dc3545; }
.fin-table td.text-end, .fin-table th.text-end { white-space: nowrap; }
.plate-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1rem; padding: .6rem .8rem; margin-bottom: .8rem; border-radius: .6rem; background: var(--bs-tertiary-bg, #f4f6f8); }
.photo-plate { position: absolute; top: .4rem; right: .4rem; background: rgba(28,113,145,.92); color: #fff; border-radius: .4rem; padding: .05rem .35rem; font-size: .8rem; }
.plate-stage { position: relative; display: inline-block; max-width: 100%; user-select: none; }
.plate-stage img { display: block; max-width: 100%; max-height: 68vh; border-radius: .5rem; }
.plate-layer { position: absolute; inset: 0; cursor: crosshair; touch-action: none; }
.plate-box { position: absolute; border: 2px dashed #fff; outline: 2px solid #1c7191; background: rgba(28,113,145,.25); }
.plate-box.saved { background: rgba(28,113,145,.35); border-style: solid; }
.plate-del { position: absolute; top: -12px; right: -12px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: #dc3545; color: #fff; line-height: 22px; font-size: 16px; padding: 0; cursor: pointer; }
