/* =========================================
   ALAPSZÍNEK / VÁLTOZÓK
========================================= */
:root {
    --lila: #7030a0;
    --kek: #00b0f0;
    --piros: #ff0000;
    --narancs: #ffc000;
    --zold: #00b050;
    --sarga: #ffff00;
    --szurke: #bfbfbf;
    --bordo: #c00000;
}

:root[data-bs-theme="dark"] {
    --lila:   #522873;
    --kek:    #0082b3;
    --piros:  #b00020;
    --narancs:#b97a0e;
    --zold:   #12723b;
    --sarga:  #a8901b;
    --szurke: #444444;
    --bordo:  #730000;
}

/* =========================================
   GOMBOK / ÁLTALÁNOS
========================================= */
.rb-row {
    align-items: stretch !important; /* a select és a gomb azonos magasságú lesz */
}

.rb-row .rbRemove {
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.70rem;
}

[data-bs-theme="dark"] .btn-outline-secondary {
    color: var(--bs-light) !important;
    border-color: var(--bs-light) !important;
}
[data-bs-theme="dark"] .btn-outline-secondary:hover,
[data-bs-theme="dark"] .btn-outline-secondary:focus,
[data-bs-theme="dark"] .btn-outline-secondary.active {
    color: #000 !important;
    background-color: var(--bs-light) !important;
    border-color: var(--bs-light) !important;
}

html[data-bs-theme="dark"] .btn-outline-secondary {
    color: var(--bs-light);
    border-color: var(--bs-light);
}
html[data-bs-theme="dark"] .btn-outline-secondary:hover {
    background-color: var(--bs-light);
    color: var(--bs-dark);
}

body { padding-top: 60px; }

/* =========================================
   ANIMÁCIÓK
========================================= */
@keyframes fadein {
    from { opacity: 0; transform: translateY(30px);}
    to   { opacity: 1; transform: translateY(0);}
}
.animate-fadein { opacity: 0; animation: fadein 0.8s cubic-bezier(.23,.89,.69,1.08) forwards; }
.animate-fadein.delay-1 { animation-delay: 0.4s; }

/* =========================================
   LOGIN KÁRTYA
========================================= */
.login-card { width: 20rem; }
@media (min-width: 576px) { .login-card { width: 25rem; } }

/* =========================================
   NAVBAR / FÓKUSZ
========================================= */
.navbar .dropdown-toggle:focus { box-shadow: none !important; outline: none !important; }
[data-bs-theme="dark"] .navbar .nav-link:focus { color: #fff !important; }
[data-bs-theme="dark"] .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:hover { color: #fff !important; }

/* =========================================
   AUTOCOMPLETE (világos/sötét)
========================================= */
:root[data-bs-theme="light"] #un-autocomplete {
    background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
:root[data-bs-theme="light"] #un-autocomplete .list-group-item {
    background: #fff; color: #212529; border-bottom: 1px solid #dee2e6;
}
:root[data-bs-theme="light"] #un-autocomplete .list-group-item:last-child { border-bottom: none; }
:root[data-bs-theme="light"] #un-autocomplete .active,
:root[data-bs-theme="light"] #un-autocomplete .list-group-item:hover {
    background: #e9ecef; color: #000;
}

:root[data-bs-theme="dark"] #un-autocomplete {
    background: #23272b; box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
:root[data-bs-theme="dark"] #un-autocomplete .list-group-item {
    background: #23272b; color: #f8f9fa; border-bottom: 1px solid #495057;
}
:root[data-bs-theme="dark"] #un-autocomplete .list-group-item:last-child { border-bottom: none; }
:root[data-bs-theme="dark"] #un-autocomplete .active,
:root[data-bs-theme="dark"] #un-autocomplete .list-group-item:hover {
    background: #395164; color: #fff;
}

/* =========================================
   BOOTSTRAP-SELECT SÖTÉT MÓD
========================================= */
:root[data-bs-theme="dark"] .bootstrap-select .btn-light,
:root[data-bs-theme="dark"] .bootstrap-select .btn {
    background-color: #23272b !important; color: #fff !important; border-color: #444 !important;
}
.was-validated .bootstrap-select select:invalid+.dropdown-toggle {
    border-color: var(--bs-form-invalid-border-color) !important;
}
.bootstrap-select .bs-searchbox input,
.bootstrap-select .bs-searchbox .form-control {
    background-image: none !important; box-shadow: none !important;
}
.bootstrap-select .bs-searchbox input:valid,
.bootstrap-select .bs-searchbox .form-control:valid {
    border-color: var(--bs-border-color) !important;
}
.was-validated .bootstrap-select > select:valid + .dropdown-toggle,
.bootstrap-select > select.is-valid + .dropdown-toggle {
    border-color: var(--bs-form-valid-border-color) !important;
}

/* =========================================
   DROPZONE
========================================= */
.dropzone { border: 2px dashed #6c757d; background: #f8f9fa; padding: 2rem; text-align: center; color: #6c757d; transition: background 0.3s ease; }
.dropzone:hover { background: #e9ecef; }
.dz-message { font-size: 1.25rem; }
.dropzone .dz-preview .dz-image img { width: 100%; }

:root[data-bs-theme="dark"] .dropzone { border-color: #adb5bd; background: #343a40; color: #adb5bd; }
:root[data-bs-theme="dark"] .dropzone:hover { background: #495057; }

/* =========================================
   TOOLTIP – sötét mód
========================================= */
:root[data-bs-theme="dark"] .tooltip-inner img {
    max-width: 120px; max-height: 120px; display: block; margin: 0 auto;
    background: #fff !important; padding: 6px !important; border-radius: 10px !important;
}

/* =========================================
   FIXED TABLE LOADING – sötét mód
========================================= */
[data-bs-theme="dark"] .fixed-table-loading { background: #23272b !important; }

/* =========================================
   SWEETALERT EMAIL MODÁL
========================================= */
.swal-email .swal2-html-container ul{list-style:disc;margin:0 0 1rem;padding-left:1.25rem}
.swal-email p{margin-bottom:.5rem}
.swal-email img{max-width:100%;height:auto;display:block;margin:1rem 0}
.swal-email { width: 90% !important; max-width: 1000px !important; }
@media (max-width: 768px) { .swal-email { width: 95% !important; } }

/* =========================================
   NAPI BEOSZTÁS – SZEKCIÓ VÁLASZTÓ VONAL
========================================= */
.first-zala-row { border-top: 3px solid #706c6c !important; }
:root[data-bs-theme="dark"] .first-zala-row { border-top: 3px solid black !important; }

/* =========================================
   DISZPÉCSER 2 – TÁBLÁK
========================================= */
#eredmeny_table td:nth-child(1),
#eredmeny_table td:nth-child(3),
#eredmeny_table td:nth-child(4),
#eredmeny_table td:nth-child(5),
#eredmeny_table td:nth-child(6),
#eredmeny_table td:nth-child(7),
#eredmeny_table td:nth-child(8),
#eredmeny_table td:nth-child(9),
#eredmeny_table td:nth-child(11) { cursor: default; }
#eredmeny_table td.copied,
.rid-entry.copied { text-decoration: line-through; color: gray; }
#eredmeny_table tbody tr.selected-row { --bs-table-bg: rgba(13,110,253,.15); }

#spool_email_table thead th { text-align: center; }
.fix-sticky thead th .th-inner { text-align: center !important; }
#mvk_table td:nth-child(4) { cursor: pointer; }

/* =========================================
   RID TÁBLA
========================================= */
.rid-frame {
    display:inline-block; background: #111111; padding: 12px; box-sizing: border-box; border-radius: 2px;
}
.rid {
    width: 260px; height: calc(130px * 1.6); display: grid; grid-template-rows: 1fr 1fr;
    background: #e64a24; overflow: hidden; box-sizing: border-box;
}
.rid-top, .rid-bottom {
    display:flex; align-items:center; justify-content:center; box-sizing: border-box;
    font-family: "Helvetica Neue", Arial, sans-serif; font-weight: 900; color: #111111; line-height: 1;
    font-size: calc(130px * 0.72);
}
.rid-bottom { padding-bottom: 2px; border-top: 6px solid #111111; }
.rid-top    { padding-top: 2px; }

@media (max-width: 480px){
    .rid-frame { padding: 8px; }
    .rid { width: 140px; height: calc(70px * 1.6); }
    .rid-top, .rid-bottom { font-size: calc(70px * 0.72); }
    .rid-bottom { border-top-width: 5px; }
}

/* =========================================
   PDF TÁBLÁZAT
========================================= */
#pdf_table table, th, td, tr { border: 1px solid black; border-collapse: collapse; }
:root[data-bs-theme="dark"] #pdf_table table, th, td, tr {
    border: 1px solid #706c6c; border-collapse: collapse;
}

/* =========================================
   BEOSZTÁS TÁBLÁZAT – GÖRGETHETŐ WRAPPER
========================================= */

/* A táblázat igazodjon a tartalom szélességéhez */
#beosztas_tabla {
    table-layout: fixed;
    width: max-content;          /* oszlopszélességek összege */
    margin: 0;                   /* mobilon balról induljon */
}

/* Órasor háttér */
#beosztas_tabla .tr_ora > td { background-color: #f2f2f2 !important; }
:root[data-bs-theme="dark"] #beosztas_tabla .tr_ora > td { background-color: #2c3034 !important; }

.ora-szam-td { font-size: 0.80em; }

/* Nap-oszlopok alap szélessége */
#beosztas_tabla .th-w { width: 60px; min-width: 60px; max-width: 60px; }

/* Sticky fejlécek (2. és 3. sor) */
#beosztas_tabla thead tr:nth-child(2) th {
    position: sticky; top: 61px; z-index: 10; background: #fff;
}
:root[data-bs-theme="dark"] #beosztas_tabla thead tr:nth-child(2) th { background: #2c3034; }
#beosztas_tabla thead tr:nth-child(3) th {
    position: sticky; top: 101px; z-index: 10; background: #fff;
}
:root[data-bs-theme="dark"] #beosztas_tabla thead tr:nth-child(3) th { background: #2c3034; }

/* Sticky első oszlop (név/checkbox blokk) – két külön sor miatt eltérő nth-child */
#beosztas_tabla tr:nth-child(odd) td:nth-child(2) {
    position: sticky; left: 0; z-index: 11; background: #fff;
}
#beosztas_tabla tr:nth-child(even) td:nth-child(1) {
    position: sticky; left: 0; z-index: 11; background: #fff;
}
:root[data-bs-theme="dark"] #beosztas_tabla tr:nth-child(odd) td:nth-child(2),
:root[data-bs-theme="dark"] #beosztas_tabla tr:nth-child(even) td:nth-child(1) {
    background: #2c3034;
}

/* Fejléc cellák */
#beosztas_tabla th { text-align: center; padding: 0 !important; }
#beosztas_tabla .nap-szam-th, .nap-szoveg-th {
    height: 40px; padding: 0 !important; vertical-align: middle;
}
#beosztas_tabla .nap-szam {
    height: 30px; display: flex; justify-content: center; align-items: center;
    font-size: 1.1em; font-weight: 700; width: 100%;
}

/* Megjegyzéses nap fejléc kiemelés */
#beosztas_tabla th.megjegyzeses-nap { background: #ffe066 !important; }
:root[data-bs-theme="dark"] #beosztas_tabla th.megjegyzeses-nap { background: #8d711a !important; }

/* Megjegyzés címke (forgatva) */
#beosztas_tabla th .megjegyzes-fent {
    height: 160px; display: flex; justify-content: center; align-items: center; padding: 0;
}
#beosztas_tabla th .megjegyzes-fent span {
    display: inline-block; font-size: 0.80em; white-space: nowrap; transform: rotate(-90deg);
}

/* Beosztás küldése cella */
#bt_nco { vertical-align: middle; max-width: 350px; width: 350px; }
@media (max-width: 576px) {
    #bt_nco { max-width: 200px; width: 200px; }
}

/* Név/lakcím blokk */
#beosztas_tabla .mv-nev { font-weight: bold; font-size: 1em; min-width: 200px; }
#beosztas_tabla .mv-lakcim { font-size: 0.87em; color: #999; margin-top: 2px; white-space: nowrap; }

/* Speciális napok a fejlécben */
#beosztas_tabla th.unnep        { background: var(--bordo) !important; }
#beosztas_tabla th.szombat-nap  { background: var(--kek) !important; }
#beosztas_tabla th.vasarnap-nap { background: var(--piros) !important; }

/* Beosztás cella színek */
#beosztas_tabla td.lila   { background: var(--lila) !important; }
#beosztas_tabla td.kek    { background: var(--kek) !important; }
#beosztas_tabla td.piros  { background: var(--piros) !important; }
#beosztas_tabla td.narancs{ background: var(--narancs) !important; }
#beosztas_tabla td.zold   { background: var(--zold) !important; }
#beosztas_tabla td.sarga  { background: var(--sarga) !important; }
#beosztas_tabla td.szurke { background: var(--szurke) !important; }
#beosztas_tabla td.bordo  { background: var(--bordo) !important; }

/* =========================================
   MOBIL FINOMHANGOLÁS (≤576px)
========================================= */
@media (max-width: 576px) {
    /* Keskenyebb nap-oszlopok */
    #beosztas_tabla .th-w {
        width: 44px; min-width: 44px; max-width: 44px;
    }
    /* Alacsonyabb fejlécek, kisebb számok */
    #beosztas_tabla .nap-szam-th, #beosztas_tabla .nap-szoveg-th { height: 32px; }
    #beosztas_tabla .nap-szam { height: 24px; font-size: 0.95em; font-weight: 700; }
    /* A felül álló, forgatott megjegyzés-címkéket rejtsük el mobilon */
    #beosztas_tabla th .megjegyzes-fent { display: none; }
}

/* =========================================
   TABLE SCROLL – SÖTÉT MÓD EXTRÁK
========================================= */
:root[data-bs-theme="dark"] .animation-wrap .animation-dot,
:root[data-bs-theme="dark"] .animation-wrap::before,
:root[data-bs-theme="dark"] .animation-wrap::after { background: #fff !important; }

/* =========================================
   KISEBB KORRIGÁLÁSOK
========================================= */
#beosztas_tabla th, #beosztas_tabla th { text-align: center; padding: 0 !important; } /* duplikált selector: kompat okból */
