/* Budavári köztisztaság – közös arculat */
:root {
    --bordo: #6b1d1d;
    --bordo-sotet: #3d0f0f;
    --bordo-vilagos: #8b2e2e;
    --arany: #c4a35a;
    --arany-vilagos: #e8d5a3;
    --papir: #f4ebe0;
    --kartya: #fffdf8;
    --szoveg: #2a2420;
    --halvany: #6b6258;
    --keret: #d9ccb8;
    --ok: #2f6b3a;
    --hiba: #a32020;
    --arnyek: 0 12px 32px rgba(61, 15, 15, 0.12);
    --arnyek-kis: 0 4px 14px rgba(61, 15, 15, 0.08);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body.bdv-body {
    min-height: 100vh;
    font-family: "Segoe UI", Tahoma, sans-serif;
    color: var(--szoveg);
    background-color: #e8d9c4;
    background-image:
        radial-gradient(circle at 12% 18%, rgba(196, 163, 90, 0.45), transparent 28%),
        radial-gradient(circle at 88% 12%, rgba(107, 29, 29, 0.22), transparent 32%),
        radial-gradient(circle at 70% 85%, rgba(196, 163, 90, 0.2), transparent 30%),
        radial-gradient(circle at 20% 90%, rgba(107, 29, 29, 0.12), transparent 26%),
        linear-gradient(165deg, #faf3e6 0%, #ead9c0 45%, #dcc7a8 100%);
    background-attachment: fixed;
    padding: 18px 16px 40px;
    animation: bdvFadeIn 0.45s ease-out;
    position: relative;
}

body.bdv-body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        repeating-linear-gradient(
            -18deg,
            rgba(107, 29, 29, 0.03) 0,
            rgba(107, 29, 29, 0.03) 1px,
            transparent 1px,
            transparent 14px
        );
    z-index: 0;
}

body.bdv-body > * {
    position: relative;
    z-index: 1;
}

@keyframes bdvFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bdvRise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bdvPulseSoft {
    0%, 100% { box-shadow: 0 0 0 0 rgba(196, 163, 90, 0.35); }
    50% { box-shadow: 0 0 0 6px rgba(196, 163, 90, 0); }
}

.bdv-container {
    max-width: 1400px;
    margin: 0 auto;
    animation: bdvRise 0.5s ease-out;
}

/* Fejléc */
.bdv-header,
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
    background: linear-gradient(135deg, #fffaf2 0%, #f3e8d6 100%);
    padding: 14px 20px;
    border-radius: 12px;
    border: 1px solid var(--keret);
    border-top: 4px solid var(--bordo);
    box-shadow: var(--arnyek-kis);
}

.bdv-header-left,
.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.bdv-logo,
.header-logo,
.login-logo {
    height: 56px;
    width: auto;
    display: block;
    background: transparent;
    mix-blend-mode: normal;
    filter: none;
    object-fit: contain;
}

.login-logo {
    height: 88px;
    margin: 0 auto 14px;
}

/* Logó keret – nincs fehér kocka */
.logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
}

.bdv-header h2,
.header-container h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.25rem;
    color: var(--bordo);
    font-weight: 700;
}

.user-info {
    font-size: 13px;
    color: var(--halvany);
    margin-right: 8px;
}

.user-info strong { color: var(--bordo-sotet); }

/* Kártyák */
.bdv-card,
.form-card,
.table-card,
.login-card,
.card {
    background: #fffaf2;
    border: 1px solid var(--keret);
    border-top: 4px solid var(--bordo);
    border-radius: 12px;
    padding: 20px 22px;
    box-shadow: var(--arnyek);
    margin-bottom: 16px;
    animation: bdvRise 0.55s ease-out;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bdv-card:hover,
.form-card:hover,
.table-card:hover {
    box-shadow: 0 16px 36px rgba(61, 15, 15, 0.14);
}

/* Login */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-card {
    width: 100%;
    max-width: 420px;
    text-align: center;
    border-top-width: 5px;
    padding: 36px 32px;
    box-shadow: 0 18px 48px rgba(61, 15, 15, 0.18);
    animation: bdvRise 0.55s ease-out;
}

.login-card h2 {
    color: var(--bordo);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
    margin: 0 0 8px;
}

.login-sub {
    display: block;
    margin: 0 0 20px;
    font-size: 0.85rem;
    color: var(--halvany);
    letter-spacing: 0.02em;
}

.login-error {
    color: var(--hiba);
    background: #fdecec;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
    border: 1px solid #f0c0c0;
}

/* Űrlap */
fieldset {
    border: 1px solid var(--keret);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 12px;
    background: linear-gradient(180deg, #fffdf8, #faf4ea);
}

legend {
    font-weight: 700;
    color: var(--bordo);
    padding: 0 10px;
    font-size: 14px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.form-grid-full {
    display: flex;
    flex-direction: column;
    margin-top: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

label {
    font-weight: 600;
    margin-bottom: 4px;
    color: #4a4038;
    font-size: 12px;
}

input, select, textarea {
    padding: 8px 11px;
    border: 1px solid var(--keret);
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    color: var(--szoveg);
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--arany);
    box-shadow: 0 0 0 3px rgba(196, 163, 90, 0.25);
}

/* Gombok – egységes rendszer */
.btn-container {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.btn,
a.btn,
button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
    background: #6b1d1d;
    box-shadow: none;
    font-family: inherit;
    text-align: center;
    line-height: 1.2;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:hover,
a.btn:hover,
button.btn:hover {
    background: #4f1515;
    color: #fff;
    transform: none;
    box-shadow: none;
}

/* Fő művelet */
.btn-submit,
.btn-primary {
    background: #6b1d1d;
    color: #fff;
    border-color: #6b1d1d;
}
.btn-submit:hover,
.btn-primary:hover {
    background: #4f1515;
    border-color: #4f1515;
}

/* Másodlagos / navigáció */
.btn-secondary {
    background: #fffdf8;
    color: #5a2a2a;
    border-color: #c9b59a;
}
.btn-secondary:hover {
    background: #f3ebe0;
    color: #3d0f0f;
    border-color: #a89070;
}

/* Excel / sikeres állapot */
.btn-excel,
.btn-success {
    background: #2f6b3a;
    color: #fff;
    border-color: #2f6b3a;
}
.btn-excel:hover,
.btn-success:hover {
    background: #245530;
    border-color: #245530;
}

/* Veszélyes */
.btn-danger,
.btn-danger-all,
.btn-delete {
    background: #b42318;
    color: #fff;
    border-color: #b42318;
}
.btn-danger:hover,
.btn-danger-all:hover,
.btn-delete:hover {
    background: #912018;
    border-color: #912018;
}

/* Mégse / semleges */
.btn-cancel,
.btn-ghost {
    background: #f3ebe0;
    color: #4a4038;
    border-color: #d9ccb8;
}
.btn-cancel:hover,
.btn-ghost:hover {
    background: #e8dcc8;
    color: #2a2420;
    border-color: #c9b59a;
}

/* Fejléc kijelentkezés / jelszó */
.btn-logout,
a.btn-logout {
    background: #fffdf8;
    color: #5a2a2a;
    padding: 7px 12px;
    font-size: 12px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    border: 1px solid #d9ccb8;
    display: inline-flex;
    align-items: center;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-logout:hover,
a.btn-logout:hover {
    background: #f3ebe0;
    border-color: #c9b59a;
    transform: none;
}

.btn-password {
    background: #fffdf8 !important;
    color: #5a2a2a !important;
    border: 1px solid #d9ccb8 !important;
}

.btn-password:hover {
    background: #f3ebe0 !important;
}

/* Táblázat sor műveletek */
.btn-action {
    padding: 5px 8px;
    font-size: 12px;
    background: #fffdf8;
    color: #6b1d1d;
    border-radius: 5px;
    border: 1px solid #d9ccb8;
    cursor: pointer;
    margin-right: 4px;
    transition: background 0.15s, border-color 0.15s;
}

.btn-action:hover {
    background: #f3ebe0;
    border-color: #6b1d1d;
    transform: none;
}

.btn-delete {
    padding: 5px 8px;
    font-size: 12px;
    border-radius: 5px;
    border: 1px solid #b42318;
    cursor: pointer;
}

/* Karbantartás állapot */
.btn-maint-on {
    background: #b42318 !important;
    border-color: #b42318 !important;
    color: #fff !important;
}
.btn-maint-off {
    background: #2f6b3a !important;
    border-color: #2f6b3a !important;
    color: #fff !important;
}

/* Táblázat */
.table-responsive { overflow-x: auto; width: 100%; }

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table-card table { table-layout: fixed; }

th {
    background: linear-gradient(180deg, #6b1d1d, #5a1818);
    color: #f8efd8;
    font-weight: 700;
    font-size: 12px;
    padding: 11px 10px;
    border-bottom: 2px solid var(--arany);
}

td {
    padding: 10px;
    border-bottom: 1px solid #ebe2d4;
    font-size: 13px;
    vertical-align: top;
    background: rgba(255, 253, 248, 0.9);
}

tr:nth-child(even) td { background: #faf4ea; }

.main-row { cursor: pointer; transition: background 0.15s, transform 0.15s; }
.main-row:hover td {
    background: #f3e6d0 !important;
}

.detail-row { display: none; background: #faf4ea; }
.detail-container {
    padding: 15px;
    border-left: 4px solid var(--arany);
    margin: 5px 0;
    font-size: 12px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    background: linear-gradient(90deg, #fff9f0, #fffdf8);
    border-radius: 0 8px 8px 0;
}

.detail-group {
    border-bottom: 1px dashed var(--keret);
    padding-bottom: 4px;
}

.detail-group strong { color: var(--bordo); }

.detail-full {
    grid-column: span 3;
    background: #fff;
    padding: 10px;
    border: 1px solid var(--keret);
    border-radius: 6px;
    font-style: italic;
}

/* Státusz badge */
.badge {
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-folyamatban {
    background: #ffe8c8;
    color: #9c4221;
    border: 1px solid #f0c48a;
    animation: bdvPulseSoft 2.4s ease-in-out infinite;
}

.status-befejezett {
    background: #d4f5de;
    color: #22543d;
    border: 1px solid #9ed9b0;
}

/* Gyors szűrők */
.gyors-szurok {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.gyors-szurok button {
    border: 1px solid #d9ccb8;
    background: #fffdf8;
    color: #5a2a2a;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    font-family: inherit;
}

.gyors-szurok button:hover {
    background: #f3ebe0;
    border-color: #c9b59a;
}

.gyors-szurok button.active {
    background: #6b1d1d;
    border-color: #6b1d1d;
    color: #fff;
    box-shadow: none;
}

.form-toggle {
    width: 100%;
    text-align: left;
    background: linear-gradient(135deg, #f8f0e4, #efe4d2);
    border: 1px solid var(--keret);
    border-radius: 8px;
    padding: 13px 16px;
    font-weight: 700;
    color: var(--bordo);
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    transition: background 0.18s, transform 0.18s;
}

.form-toggle:hover {
    background: #ebe0cc;
    transform: translateY(-1px);
}

#ujBejelentesPanel.collapsed { display: none; }

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(45, 25, 20, 0.55);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal-content {
    background: var(--kartya);
    padding: 22px;
    border-radius: 12px;
    width: 360px;
    max-width: 92vw;
    box-shadow: var(--arnyek);
    border-top: 4px solid var(--bordo);
    animation: bdvRise 0.25s ease-out;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: flex-end;
}

/* Statisztika kártyák */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.cards .card {
    text-align: center;
    padding: 26px 20px;
}

.cards .card h3 {
    margin: 0;
    color: var(--halvany);
    font-size: 0.95rem;
}

.cards .card .szam {
    font-size: 2.4rem;
    font-weight: 800;
    margin-top: 12px;
    color: var(--bordo);
    font-family: Georgia, "Times New Roman", serif;
}

.cards .card:nth-child(1) { animation-delay: 0.05s; }
.cards .card:nth-child(2) { animation-delay: 0.1s; }
.cards .card:nth-child(3) { animation-delay: 0.15s; }
.cards .card:nth-child(4) { animation-delay: 0.2s; }
.cards .card:nth-child(5) { animation-delay: 0.25s; }
.cards .card:nth-child(6) { animation-delay: 0.3s; }
.cards .card:nth-child(7) { animation-delay: 0.35s; }

/* Oldalcím */
.bdv-page-title {
    text-align: center;
    font-family: Georgia, "Times New Roman", serif;
    color: var(--bordo);
    margin: 8px 0 24px;
    font-size: 1.6rem;
}

.bdv-back {
    display: inline-block;
    margin-bottom: 18px;
    padding: 10px 16px;
    background: var(--bordo);
    color: #fff !important;
    text-decoration: none;
    border-radius: 7px;
    font-weight: 700;
    transition: transform 0.18s, background 0.18s;
}

.bdv-back:hover {
    background: var(--bordo-sotet);
    transform: translateY(-2px);
}

.bdv-msg-ok {
    background: #e8f5e9;
    color: var(--ok);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 14px;
    border: 1px solid #b7dfc0;
}

.bdv-msg-hiba {
    background: #fdecec;
    color: var(--hiba);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 14px;
    border: 1px solid #f0c0c0;
}

#fajlLista {
    margin-top: 8px;
    font-size: 12px;
    color: var(--szoveg);
}

/* Tábla oszlopszélességek – fő nyilvántartás */
.table-card th:nth-child(1),
.table-card td:nth-child(1) { width: 5%; text-align: center; }
.table-card th:nth-child(2),
.table-card td:nth-child(2) { width: 15%; }
.table-card th:nth-child(3),
.table-card td:nth-child(3) { width: 18%; }
.table-card th:nth-child(4),
.table-card td:nth-child(4) { width: 22%; }
.table-card th:nth-child(5),
.table-card td:nth-child(5) {
    width: 22%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.table-card th:nth-child(6),
.table-card td:nth-child(6) { width: 5%; text-align: center; }
.table-card th:nth-child(7),
.table-card td:nth-child(7) { width: 8%; text-align: center; }
.table-card th:nth-child(8),
.table-card td:nth-child(8) { width: 12%; text-align: center; }

@media (max-width: 800px) {
    .detail-container { grid-template-columns: 1fr; }
    .detail-full { grid-column: span 1; }
    .bdv-header h2,
    .header-container h2 { font-size: 1.05rem; }
}
