/* ==========================================================================
   LAB5 ERP 3.0 – GLOBÁLIS STÍLUSOK (TOP NAVBAR LAYOUT)
   ========================================================================== */

:root {
    --erp-bg:           #f1f5f9;
    --erp-nav-bg:       #ffffff;
    --erp-nav-border:   #eaeaea;
    --erp-nav-height:   52px;
    --erp-text-main:    #000000;
    --erp-text-light:   #718096;
    --erp-border:       #eaeaea;
    --erp-accent:       #e6e2dd;
    --erp-primary-blue: #3182ce;
    --erp-danger:       #e53e3e;
}

html, body {
    margin: 0 !important;
    padding: 0 !important;
    background-color: var(--erp-bg) !important;
    overflow-x: hidden;
    letter-spacing: normal !important;
}
html { height: 100%; }
body { min-height: 100%; overflow-y: auto; }

#wpadminbar, .site-header, .site-footer, #site-footer,
footer, #colophon, .credits, .bg-image {
    display: none !important;
}

.erp-app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    background-color: var(--erp-bg);
}

/* Fő nav sáv – position: fixed, hogy biztosan rögzüljön */
.erp-topnav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--erp-nav-height);
    background: var(--erp-nav-bg);
    border-bottom: 1px solid var(--erp-nav-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 0 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* Content area: felső padding kompenzálja a fixed nav magasságát */
.erp-content-area {
    flex: 1;
    padding: calc(var(--erp-nav-height) + 25px) 40px 40px 40px;
    box-sizing: border-box;
    overflow-x: auto;
    min-width: 0;
    font-weight: 400;
    /* Globális kártya-belső margó – egy helyen állítható az egész ERP-re.
       Mobil felülírás a media query-ben (16px). */
    --card-pad: 25px;
}

/* ==========================================================================
   TOP NAVBAR – egy sor: bal=logó+logout+menü | jobb=akció gombok
   ========================================================================== */

/* BAL oldal wrapper */
.erp-topnav-left {
    display: flex;
    align-items: center;
    height: 100%;
    flex-shrink: 0;
}

/* Logó */
.erp-topnav-logo {
    width: 60px;
    flex-shrink: 0;
    color: #000;
    display: flex;
    align-items: center;
    margin-right: 6px;
    margin-top: -4px;
}
.erp-topnav-logo svg { display: block; }

/* Kilépés – ugyanolyan mint a többi nav link, nincs külön stílus */

/* Elválasztó */
.erp-topnav-divider {
    width: 1px;
    height: 20px;
    background: var(--erp-border);
    margin: 0 8px;
    flex-shrink: 0;
}

/* Nav lista */
.erp-topnav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    height: 100%;
}

/* Nav elem */
.erp-topnav-item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

/* Nav link */
.erp-topnav-link {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 10px;
    height: var(--erp-nav-height);
    font-size: 12px;
    font-weight: 600;
    color: var(--erp-text-main);
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: background 0.15s, border-color 0.15s;
    cursor: pointer;
}
.erp-topnav-link:hover,
.erp-topnav-item.open > .erp-topnav-link { background: #f7f7f7; }
.erp-topnav-item.active > .erp-topnav-link { border-bottom-color: #000; }

/* Chevron */
.erp-topnav-chevron {
    opacity: 0.4;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
}
.erp-topnav-item.open .erp-topnav-chevron { transform: rotate(180deg); opacity: 0.7; }

/* Dropdown */
.erp-topnav-dropdown {
    display: none;
    position: absolute;
    top: calc(var(--erp-nav-height) - 1px);
    left: 0;
    min-width: 180px;
    background: #fff;
    border: 1px solid var(--erp-nav-border);
    border-top: 2px solid #000;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    list-style: none;
    margin: 0;
    padding: 6px 0;
    z-index: 1001;
}
.erp-topnav-item.open .erp-topnav-dropdown {
    display: block;
    animation: erp-dd-in 0.12s ease;
}
@keyframes erp-dd-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.erp-topnav-dropdown-link {
    display: block;
    padding: 7px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
    text-transform: uppercase;
    transition: background 0.1s;
}
.erp-topnav-dropdown-link:hover { background: #f7f7f7; color: #000; }
.erp-topnav-dropdown-link.active { background: var(--erp-accent); color: #000; }

/* JOBB: akció gombok slot */
.erp-topnav-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    flex-shrink: 0;
}

/* ==========================================================================
   EGYSÉGESÍTETT GOMBOK (26px, 12px, 600, UPPERCASE)
   ========================================================================== */
.erp-btn,
.erp-btn-success,
.erp-btn-danger,
.erp-btn-primary,
.erp-btn-outline,
.log-btn,
.ts-submit-btn,
.erp-action-btn,
.erp-action-btn-danger,
.btn-delete-row,
.btn-delete,
.quick-link-btn,
.proj-name-link,
.proj-code-link,
.cat-badge,
.btn-move {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    padding: 0 12px !important;
    font-family: inherit !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    box-sizing: border-box !important;
    line-height: normal !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    margin: 0 !important;
    letter-spacing: normal !important;
}

.erp-btn-success { background: #38a169 !important; color: #fff !important; border: 1px solid #38a169 !important; }
.erp-btn-success:hover { background: #2f855a !important; border-color: #2f855a !important; }

.erp-btn-primary, .ts-submit-btn, .log-btn.active { background: var(--erp-primary-blue) !important; color: #fff !important; border: 1px solid var(--erp-primary-blue) !important; }
.erp-btn-primary:hover, .ts-submit-btn:hover { background: #2b6cb0 !important; border-color: #2b6cb0 !important; }

.erp-btn-danger, .erp-action-btn-danger, .btn-delete-row, .btn-delete { background: #fff5f5 !important; color: #e53e3e !important; border: 1px solid #fc8181 !important; }
.erp-btn-danger:hover, .erp-action-btn-danger:hover, .btn-delete-row:hover, .btn-delete:hover { background: #e53e3e !important; color: #fff !important; border-color: #e53e3e !important; }

.erp-btn-outline, .erp-action-btn, .quick-link-btn { background: #fff !important; color: #4a5568 !important; border: 1px solid var(--erp-border) !important; }
.erp-btn-outline:hover, .erp-action-btn:hover, .quick-link-btn:hover { background: #edf2f7 !important; color: #000 !important; border-color: #cbd5e0 !important; }

.log-btn:not(.active) { background: #edf2f7 !important; color: #000 !important; border: 1px solid var(--erp-border) !important; }
.log-btn:not(.active):hover { background: #e2e8f0 !important; border-color: #cbd5e0 !important; }

.proj-name-link { background: #f7fafc !important; border: 1px solid #cbd5e0 !important; color: #000 !important; }
.proj-name-link:hover { background: #e2e8f0 !important; border-color: #a0aec0 !important; }

.proj-code-link { background: transparent !important; border: 1px solid transparent !important; color: #000 !important; width: 50px !important; min-width: 50px !important; max-width: 50px !important; padding: 0 !important; }
.proj-code-link:hover { background: #edf2f7 !important; border-color: #cbd5e0 !important; }

.cat-badge { background: #f8fafc !important; border: 1px solid var(--erp-border) !important; color: #4a5568 !important; cursor: default !important; }

.btn-move { padding: 0 !important; width: 26px !important; background: #f8fafc !important; border: 1px solid var(--erp-border) !important; color: #000 !important; }
.btn-move:hover { background: #e2e8f0 !important; border-color: #cbd5e0 !important; }

.erp-btn-success:disabled, .ts-submit-btn:disabled, button:disabled { opacity: 0.6 !important; cursor: not-allowed !important; }

/* ==========================================================================
   OLDALFEJLÉC (sticky kártya az oldalakon belül)
   ========================================================================== */
.erp-page-title h2 {
    font-family: 'Barlow', "Helvetica Neue", Helvetica, Arial, sans-serif !important;
    font-size: 30px !important;
    font-weight: 300 !important;
    color: #000 !important;
    text-transform: uppercase !important;
    margin: 0 !important;
    letter-spacing: normal !important;
    line-height: 1.2 !important;
}

.erp-page-header {
    position: sticky;
    top: calc(var(--erp-nav-height) + 10px);
    z-index: 999;
    background-color: #ffffff;
    border: 1px solid var(--erp-border);
    border-radius: 8px;
    padding: 15px 25px;
    margin-top: 25px;
    margin-bottom: 25px;
    box-shadow: 0 -40px 0 0 var(--erp-bg), 0 4px 6px -1px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.erp-page-header form { margin: 0 !important; padding: 0 !important; display: flex !important; align-items: center !important; gap: 15px !important; }
.erp-page-header form label { margin: 0 !important; padding: 0 !important; line-height: 1 !important; white-space: nowrap !important; }
.erp-page-header form select { margin: 0 !important; height: 34px !important; min-height: 34px !important; line-height: normal !important; vertical-align: middle !important; }

/* Üzenetek */
.erp-msg { padding: 12px 20px; margin-bottom: 20px; border-radius: 4px; border-left: 4px solid; font-size: 13px; font-weight: 600; letter-spacing: normal; }
.erp-msg-success { background: #d4edda; color: #155724; border-left-color: #28a745; }
.erp-msg-danger  { background: #fcf0f1; color: #d63638; border-left-color: #d63638; }
.erp-msg-warning { background: #fff3cd; color: #856404; border-left-color: #ffeeba; }

/* Fejlesztés alatt kártya */
.erp-dev-msg-card { background: #fff; border: 1px solid var(--erp-border); border-radius: 8px; padding: 40px; margin-top: 25px; text-align: center; }
.erp-dev-msg-title { font-size: 18px; font-weight: 300; text-transform: uppercase; margin: 0 0 10px; }

/* ==========================================================================
   PROJEKT TÁBLÁZAT
   ========================================================================== */
.proj-card { background: #fff; border: 1px solid var(--erp-border); border-radius: 8px; padding: var(--card-pad, 25px); box-shadow: 0 1px 3px rgba(0,0,0,0.05); margin-bottom: 25px; overflow-x: auto; box-sizing: border-box; }
.proj-table { table-layout: fixed; width: 100% !important; border-collapse: collapse; text-align: left; font-size: 13px !important; min-width: 1150px !important; letter-spacing: normal; }

/* Fejléc (Fősor): 12px betűméret és pontosan 600-as font-weight */
.proj-table th { background: #f8fafc; padding: 12px 15px !important; font-size: 12px !important; font-weight: 600 !important; text-transform: uppercase; color: #000 !important; border-bottom: 2px solid var(--erp-border); letter-spacing: normal; }

/* Általános cellák */
.proj-table td { padding: 12px 15px !important; color: #000; border-bottom: 1px solid #edf2f7; vertical-align: middle; box-sizing: border-box; font-size: 13px !important; height: auto !important; }
.proj-table tr:hover td { background: #fcfcfc; }

.col-code          { width: 55px !important; min-width: 55px !important; max-width: 55px !important; }
.col-name          { width: 140px !important; }
.col-actions-links { width: 440px !important; text-align: left; }
.col-status        { width: 145px !important; }
.col-cats          { width: auto !important; }
.col-actions       { width: 90px !important; text-align: right; }
.quick-links       { display: flex; gap: 5px; justify-content: flex-start; flex-wrap: nowrap; }

/* --- Kód, Név és Kategória "gombszerűség" és nagybetűk megszüntetése --- */
.proj-table .proj-code-link { background: transparent !important; border: none !important; padding: 0 !important; width: auto !important; min-width: 0 !important; color: #000 !important; font-weight: 400 !important; box-shadow: none !important; }
.proj-table .proj-code-link:hover { color: var(--erp-primary-blue) !important; background: transparent !important; }

.proj-table .proj-name-link { background: transparent !important; border: none !important; padding: 0 !important; color: #000 !important; font-weight: 600 !important; text-transform: none !important; box-shadow: none !important; }
.proj-table .proj-name-link:hover { color: var(--erp-primary-blue) !important; background: transparent !important; }

.proj-table .cat-badge { 
    background: transparent !important; 
    border: none !important; 
    padding: 0 !important; 
    margin-right: 8px !important; /* Távolság a több kategória közé */
    display: inline-block !important; /* Hogy a margó biztosan érvényesüljön */
    height: auto !important; 
    min-height: 0 !important; 
    color: #000 !important; /* Fekete betűszín a szürke helyett */
    font-weight: 400 !important; 
    text-transform: none !important; 
    box-shadow: none !important; 
    cursor: default !important; 
}

.text-placeholder        { color: #cbd5e0; }
.text-placeholder-italic { color: var(--erp-text-light); font-style: italic; }

/* ==========================================================================
   DataTables (Gyorsszűrő)
   ========================================================================== */
.dataTables_wrapper .dataTables_filter { margin-bottom: 15px; float: none !important; text-align: left !important; }
.dataTables_wrapper .dataTables_filter label { float: none !important; }
.erp-dt-top { text-align: left; margin-bottom: 15px; }
.erp-dt-top .dataTables_filter { margin-bottom: 0; }

/* Szűrő címke: 12px és NAGYBETŰS */
.dataTables_wrapper .dataTables_filter label { display: inline-flex !important; align-items: center !important; font-size: 12px !important; font-weight: 600 !important; text-transform: uppercase !important; color: #000 !important; margin-right: 20px !important; letter-spacing: normal !important; }

/* Szűrő input mező: A beírt szöveg normál maradjon */
.dataTables_wrapper .dataTables_filter input { height: 26px !important; width: 250px !important; padding: 0 10px !important; margin-left: 10px !important; border: 1px solid var(--erp-border) !important; border-radius: 4px !important; box-sizing: border-box !important; font-family: inherit; background: #fff; text-transform: none !important; color: #000 !important; letter-spacing: normal !important; }
.dataTables_wrapper .dataTables_filter input:focus { outline: none; border-color: var(--erp-primary-blue); box-shadow: 0 0 0 2px rgba(43,108,176,0.1); }

/* ==========================================================================
   STÁTUSZ JELZŐK
   ========================================================================== */
.status-badge {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 12px; height: 26px !important; border-radius: 4px;
    font-size: 12px; font-weight: 600; text-transform: uppercase !important;
    border: 1px solid transparent; white-space: nowrap;
    cursor: pointer; user-select: none; transition: filter 0.2s;
    box-sizing: border-box; line-height: normal !important; letter-spacing: normal;
}
.status-badge:hover { filter: brightness(0.95); }
.status-folyamatban  { background-color: #ebf8ff; color: #2b6cb0 !important; border-color: #bee3f8; }
.status-lezart       { background-color: #edf2f7; color: #4a5568 !important; border-color: #e2e8f0; }
.status-szuneteltetett { background-color: #fffaf0; color: #dd6b20 !important; border-color: #feebc8; }
.status-eljovo       { background-color: #f0fff4; color: #276749 !important; border-color: #c6f6d5; }

/* ==========================================================================
   ŰRLAP ELEMEK
   ========================================================================== */
.erp-form-row   { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 25px; }
.erp-col-1      { flex: 1; min-width: 150px; }
.erp-col-2      { flex: 2; min-width: 250px; }
.erp-form-group { margin-bottom: 25px; }

.erp-label { display: block; font-size: 12px; font-weight: 600; color: #000; text-transform: uppercase; margin-bottom: 8px; letter-spacing: normal; }

.erp-input { width: 100%; border: 1px solid var(--erp-border); border-radius: 4px; font-size: 13px; font-weight: 400; color: #000; font-family: inherit; background: #fff; box-sizing: border-box; transition: border-color 0.2s, box-shadow 0.2s; letter-spacing: normal; }
input.erp-input, select.erp-input, textarea.erp-input, .erp-status-toggle-large { font-size: 13px !important; }
input.erp-input, select.erp-input, .erp-status-toggle-large { height: 26px !important; min-height: 26px !important; max-height: 26px !important; line-height: 24px !important; box-sizing: border-box !important; padding-top: 0 !important; padding-bottom: 0 !important; margin: 0 !important; }
textarea.erp-input { height: auto !important; min-height: 80px !important; line-height: 1.5 !important; padding: 8px 12px !important; }
.erp-input:focus { outline: none; border-color: var(--erp-primary-blue); box-shadow: 0 0 0 2px rgba(43,108,176,0.1); }

.erp-checkbox-group  { display: flex; flex-wrap: wrap; gap: 15px; background: #f8fafc; border: 1px solid var(--erp-border); border-radius: 4px; padding: 15px; }
.erp-checkbox-label  { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #000; cursor: pointer; font-weight: 400; text-transform: lowercase !important; }
.erp-checkbox        { margin: 0; cursor: pointer; }

.erp-status-toggle-large { cursor: pointer; width: 100%; height: 26px !important; font-size: 12px !important; font-weight: 600 !important; text-transform: uppercase !important; display: flex; align-items: center; justify-content: center; } /* uppercase → marad 12px */

.erp-input-group { display: inline-flex !important; align-items: center !important; flex-wrap: nowrap !important; width: auto !important; }
.erp-input-group .erp-input { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: none; }
.erp-input-group .addon { background: #f8fafc; color: #718096; font-size: 10px; font-weight: 600; padding: 0 10px; height: 26px; line-height: 24px; border: 1px solid var(--erp-border); border-top-right-radius: 4px; border-bottom-right-radius: 4px; text-transform: uppercase; box-sizing: border-box; }

/* ==========================================================================
   BEJELENTKEZŐ KÉPERNYŐ
   ========================================================================== */
.erp-login-wrapper { display: flex; align-items: center; justify-content: center; min-height: 100vh; background-color: #f1f5f9; font-family: 'Barlow', sans-serif; }
.erp-login-card { background: #fff; width: 100%; max-width: 360px; padding: 45px 35px; border-radius: 8px; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05); border: 1px solid var(--erp-border); text-align: center; box-sizing: border-box; }
.erp-login-logo  { margin-bottom: 10px; color: #000; display: flex; justify-content: center; }
.erp-login-logo svg { max-width: 160px; height: auto; }
.erp-login-sub   { font-size: 13px; color: #718096; margin-bottom: 30px; font-weight: 600; text-transform: uppercase; }
.erp-login-error { background: #fff5f5; color: var(--erp-danger); border: 1px solid #fc8181; padding: 12px; border-radius: 4px; font-size: 13px; font-weight: 600; margin-bottom: 20px; }
.erp-login-input { width: 100% !important; height: 40px !important; padding: 0 15px !important; margin-bottom: 15px !important; border: 1px solid #cbd5e0 !important; border-radius: 4px !important; font-size: 14px !important; font-family: inherit !important; box-sizing: border-box !important; transition: border-color 0.2s, box-shadow 0.2s !important; }
.erp-login-input:focus { outline: none !important; border-color: var(--erp-primary-blue) !important; box-shadow: 0 0 0 2px rgba(43,108,176,0.1) !important; }
.erp-login-btn { width: 100% !important; height: 42px !important; background: #38a169 !important; color: #fff !important; border: none !important; border-radius: 4px !important; font-size: 14px !important; font-weight: 600 !important; font-family: inherit !important; cursor: pointer !important; transition: background 0.2s !important; text-transform: uppercase !important; margin-top: 10px !important; }
.erp-login-btn:hover { background: #2f855a !important; }

/* ==========================================================================
   TÁBLÁZAT KÖZÖS ALAP (proj, fin, hr, hq, ts)
   ========================================================================== */
.erp-table-wrap { overflow-x: auto; border-radius: 6px; border: 1px solid var(--erp-border); }

.fin-table, .hr-table, .hq-table, .vt-table, .ts-table {
    width: 100%; border-collapse: collapse; text-align: left; letter-spacing: normal;
}
.fin-table th, .hr-table th, .hq-table th, .vt-table th, .ts-table th {
    background: #f8fafc; padding: 12px 15px; font-size: 12px; font-weight: 600;
    text-transform: uppercase; color: #000; border-bottom: 2px solid var(--erp-border);
}
.fin-table td, .hr-table td, .hq-table td, .ts-table td {
    padding: 12px 15px; font-size: 13px; color: #000; border-bottom: 1px solid var(--erp-border); vertical-align: middle;
}
.fin-table tr:hover td, .hr-table tr:hover td, .hq-table tr:hover td { background: #f7fafc; }

.fin-table { font-size: 13px !important; min-width: 900px; }
.fin-table th { font-size: 12px !important; } /* uppercase → marad 12px */
.fin-table td { font-size: 13px !important; }
.fin-table td { font-weight: 400 !important; }
.fin-table td:nth-child(2), .fin-table td:nth-child(2) a { font-weight: 600 !important; color: #000 !important; text-decoration: none; }
.fin-table td:last-child, .fin-table td:last-child span { font-weight: 600 !important; }
.fin-profit-income { color: #38a169 !important; }
.fin-profit-cost   { color: var(--erp-danger) !important; }
.fin-bal-pos  { color: #38a169 !important; font-weight: 600 !important; font-size: 13px !important; }
.fin-bal-neg  { color: var(--erp-danger) !important; font-weight: 600 !important; font-size: 13px !important; }
.fin-bal-zero { color: #000 !important; font-weight: 600 !important; font-size: 13px !important; }

.hq-table { min-width: 900px; }
.hq-summary-row { background: #ebf8ff; font-weight: 600; font-size: 13px; }
.hq-summary-row td { color: var(--erp-primary-blue); border-bottom: none; }

.ts-table th { font-size: 12px; font-weight: 600; } /* uppercase → marad 12px */
.ts-table td { font-size: 13px; font-weight: 400; }

/* ==========================================================================
   TIMESHEET KÁRTYA
   ========================================================================== */
.ts-card    { background: #fff; border: 1px solid var(--erp-border); border-radius: 8px; padding: var(--card-pad, 25px); box-shadow: 0 1px 3px rgba(0,0,0,0.05); margin-bottom: 30px; }
.ts-row     { display: flex; margin-bottom: 20px; align-items: flex-start; }
.ts-label   { width: 120px; font-size: 12px; font-weight: 600; color: #000; text-transform: uppercase; padding-top: 5px; flex-shrink: 0; }
.ts-content { flex: 1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-weight: 400 !important; }

/* ts-input – egységes 26px, 12px, nem italic, nem bold */
.ts-input {
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    padding: 0 10px !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    font-style: normal !important;
    color: #000 !important;
    background: #fff !important;
    border: 1px solid var(--erp-border) !important;
    border-radius: 4px !important;
    box-sizing: border-box !important;
    line-height: 24px !important;
    vertical-align: middle !important;
    transition: border-color 0.2s !important;
}
.ts-input:focus {
    outline: none !important;
    border-color: var(--erp-primary-blue) !important;
    box-shadow: 0 0 0 2px rgba(43,108,176,0.1) !important;
}

/* Dátum input – böngésző ikon miatt kis jobb padding */
input[type="date"].ts-input {
    padding-right: 6px !important;
    cursor: pointer !important;
}

/* Select */
select.ts-input {
    padding-right: 6px !important;
    cursor: pointer !important;
}

/* Placeholder szöveg ne legyen italic */
.ts-input::placeholder {
    color: #a0aec0 !important;
    font-style: normal !important;
    font-weight: 400 !important;
}

/* Select2 */
.select2-container--default .select2-selection--single { height: 26px !important; border: 1px solid var(--erp-border) !important; border-radius: 4px !important; display: flex !important; align-items: center !important; background: #fff !important; }
.select2-container--default .select2-selection--single .select2-selection__rendered { font-family: inherit !important; font-size: 13px !important; font-weight: 600 !important; color: #000 !important; line-height: 24px !important; padding-left: 10px !important; }
.select2-container--default .select2-selection--single .select2-selection__placeholder { font-family: inherit !important; font-size: 13px !important; font-weight: 400 !important; color: #a0aec0 !important; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 24px !important; }
.select2-container .select2-dropdown { font-family: inherit !important; font-size: 13px !important; border-color: var(--erp-primary-blue) !important; }
.select2-results__option { font-family: inherit !important; font-weight: 600 !important; font-size: 13px !important; padding: 6px 10px !important; }

/* ==========================================================================
   HOLIDAY PLANNER
   ========================================================================== */
.cal-cell { cursor: pointer; transition: filter 0.2s; user-select: none; text-align: center; }
.cal-cell:hover { filter: brightness(0.9); }
.cell-weekend    { background: #edf2f7; color: #a0aec0; }
.cell-empty      { background: #fff; }
.cell-v          { background: #fef08a !important; color: #744210 !important; }
.cell-sl         { background: #e2e8f0 !important; color: #4a5568 !important; }
.cell-sp         { background: #cbd5e0 !important; color: #2d3748 !important; }
.cell-ct         { background: #48bb78 !important; color: #fff !important; }
.cell-m-v        { background: #dd6b20 !important; color: #fff !important; }
.cell-p          { background: #e53e3e !important; color: #fff !important; }
.cell-m-work     { background: #fff; color: #1a202c; border: 2px solid #cbd5e0 !important; }
.past-locked     { opacity: 0.6; cursor: not-allowed !important; }
.stat-col        { background: #f8fafc; width: 35px; color: #000; border-left: 2px solid var(--erp-border) !important; text-align: center; }

/* ==========================================================================
   PARTNERS / GANTT / OTHERS – változatlan a 2.0-ból
   ========================================================================== */
.partners-table-wrapper { background: #fff; border: 1px solid var(--erp-border); border-radius: 8px; overflow-x: auto; margin-bottom: 25px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.partners-table { width: 100%; border-collapse: collapse; font-size: 13px !important; letter-spacing: normal; }
.partners-table tr { height: 26px !important; max-height: 26px !important; }
.partners-table th { border: 1px solid var(--erp-border); vertical-align: middle; color: #000 !important; font-size: 12px !important; font-family: inherit !important; font-weight: 600 !important; text-align: center; padding: 6px 4px; text-transform: uppercase; background: #f8fafc; } /* uppercase → marad 12px */
.partners-table td { border: 1px solid var(--erp-border); vertical-align: middle; color: #000 !important; font-size: 13px !important; font-family: inherit !important; font-weight: 400 !important; text-align: center; }
.partners-table td.input-cell { padding: 0 !important; position: relative; height: 26px !important; max-height: 26px !important; overflow: hidden; }
.partners-table td.pad-cell   { padding: 0 6px !important; height: 26px !important; }

/* Phase cell wrapper fix – ne nőjön a badge mérete miatt */
.partners-table .phase-cell-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 26px !important;
    max-height: 26px !important;
    overflow: hidden;
    padding-right: 2px;
}
.partners-table .phase-cell-wrapper .borderless-input {
    text-align: right !important;
    padding: 0 2px !important;
    min-width: 0;
    flex: 1;
}

/* Note ikon */
.note-icon-wrapper { cursor: pointer; display: flex; align-items: center; justify-content: center; height: 100%; padding: 0 2px; flex-shrink: 0; }
.note-icon-btn { opacity: 0.4; transition: opacity 0.2s; flex-shrink: 0; pointer-events: none; }
.note-icon-wrapper:hover .note-icon-btn { opacity: 1; stroke: var(--erp-primary-blue) !important; }
.note-icon-btn.has-note { opacity: 1; stroke: var(--erp-primary-blue) !important; }

/* Sor műveletek (mozgatás, törlés) */
.action-btn-group { display: flex; align-items: center; justify-content: center; gap: 4px; height: 26px; }
.move-btn { color: #38a169; font-size: 13px; text-decoration: none; line-height: 1; padding: 0 2px; opacity: 0.7; transition: opacity 0.2s; }
.move-btn:hover { opacity: 1; }
.remove-partner-btn { color: var(--erp-danger); font-size: 16px !important; text-decoration: none; font-weight: 600 !important; opacity: 0.5; transition: opacity 0.2s; padding: 0 2px; line-height: 1; }
.remove-partner-btn:hover { opacity: 1; }

/* Partners táblázat alsó összesítő sorok */
.row-sum td, .row-sum .borderless-input { font-weight: 600 !important; text-align: right !important; background: #f8fafc; }
.row-sum td:first-child { text-align: left !important; padding-left: 15px !important; }
.tfoot-sum th, .tfoot-sum td { font-weight: 600 !important; padding: 8px 10px; text-align: right !important; border: 1px solid var(--erp-border); vertical-align: middle; }
.th-total-blue { background: #e2e8f0; border-top: 2px solid #a0aec0 !important; border-bottom: 2px solid #a0aec0 !important; }
.th-spacer { height: 15px; border: none !important; background: transparent !important; }

/* Eredmény terv tábla */
.th-result-header th { font-weight: 600 !important; background: #edf2f7 !important; text-align: right !important; text-transform: uppercase !important; }
.th-result-header th:first-child { text-align: left !important; padding-left: 15px !important; }
.th-result-row td { font-weight: 600 !important; background: #fff; text-align: right !important; }
.th-result-row td:first-child { text-align: left !important; padding-left: 15px !important; }
.th-result-profit td { font-weight: 600 !important; background: #f0fff4; color: #22543d !important; border-top: 2px solid #68d391 !important; border-bottom: 2px solid #68d391 !important; text-align: right !important; }
.th-result-profit td:first-child { text-align: left !important; padding-left: 15px !important; }

/* Partners táblázaton belüli státusz badge – kis méret, felülírja az egységes gombot */
.partners-table .status-badge {
    width: 18px !important;
    height: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    min-width: 18px !important;
    padding: 0 !important;
    font-size: 9px !important;
    border-radius: 3px;
    color: #000000 !important;
    border-color: var(--erp-border);
    line-height: 18px !important;
    flex-shrink: 0;
}
.borderless-input { width: 100%; height: 26px !important; padding: 0 4px; border: none !important; background: transparent !important; font-size: 13px !important; font-family: inherit !important; color: #000 !important; box-sizing: border-box; box-shadow: none !important; font-weight: 400 !important; }
.borderless-input:focus { background: #ebf8ff !important; outline: none; }
.bg-becsult    { background-color: #fbd38d; border-color: #f6ad55; }
.bg-ajanlat    { background-color: #ffffff; }
.bg-szerzodott { background-color: #90cdf4; border-color: #63b3ed; }
.bg-szamlazott { background-color: #c6f6d5; border-color: #9ae6b4; }
.bg-kifizetett { background-color: #68d391; border-color: #48bb78; color: #fff !important; }
.bg-ures       { background-color: transparent; border: 1px dashed transparent; cursor: default; }

.financial-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--erp-border); }
.financial-table th { background: #f8fafc; padding: 10px 15px; font-size: 12px; font-weight: 600; text-transform: uppercase; color: #000; border-bottom: 2px solid var(--erp-border); }
.financial-table td { height: 34px; padding: 4px 15px; font-size: 13px; font-weight: 400; color: #000; border-bottom: 1px solid #edf2f7; vertical-align: middle; }
.financial-table tfoot tr { background: #f8fafc; font-weight: 600; border-top: 2px solid var(--erp-border); }

.others-panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 25px; margin-bottom: 30px; }
.others-card { background: #fff; border: 1px solid var(--erp-border); border-radius: 8px; padding: var(--card-pad, 25px); box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.others-card h3 { margin-top: 0; margin-bottom: 20px; font-size: 12px; font-weight: 600; color: #000; padding-bottom: 10px; border-bottom: 1px solid var(--erp-border); text-transform: uppercase; }
.others-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.others-row-desc   { flex: 2; }
.others-row-amount { flex: 1; text-align: right !important; }

/* ==========================================================================
   HR
   ========================================================================== */
.status-active   { background: #e6fffa; color: #234e52; border: 1px solid #81e6d9; }
.status-inactive { background: #edf2f7; color: #4a5568; border: 1px solid #cbd5e0; }

/* ==========================================================================
   SZÁM INPUTOK (spinner elrejtése)
   ========================================================================== */
.erp-input[type="number"]::-webkit-outer-spin-button,
.erp-input[type="number"]::-webkit-inner-spin-button,
.pct-input::-webkit-outer-spin-button,
.pct-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.erp-input[type="number"], .pct-input { -moz-appearance: textfield; }

/* letter-spacing globális nullázás – egy helyen, nem 40x */
.erp-app-container * { letter-spacing: normal !important; }

/* Téma overflow védelem – border és font-size */
.erp-app-container div,
.erp-app-container section {
    border: none;
    box-sizing: border-box;
    font-size: 13px;
}

/* Font-family védelem – megakadályozza, hogy a fő oldal témája felülírja a betűtípust */
.erp-app-container,
.erp-app-container h1,
.erp-app-container h2,
.erp-app-container h3,
.erp-app-container h4,
.erp-app-container h5,
.erp-app-container h6,
.erp-app-container p,
.erp-app-container span,
.erp-app-container div,
.erp-app-container input,
.erp-app-container select,
.erp-app-container textarea,
.erp-app-container button,
.erp-app-container label,
.erp-app-container td,
.erp-app-container th {
    font-family: 'Barlow', "Helvetica Neue", Helvetica, Arial, sans-serif !important;
}

/* ==========================================================================
   KÉTSZINTES TOPBAR
   ========================================================================== */

/* A teljes sticky wrapper */
.erp-topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.07);
}

/* 1. sor – nav (felülírjuk a korábbi sticky-t) */
.erp-topnav {
    position: static !important;
    box-shadow: none !important;
    height: var(--erp-nav-height);
    border-bottom: 1px solid var(--erp-nav-border);
}

/* 2. sor – actionbar */
.erp-actionbar {
    min-height: 52px;
    border-bottom: 1px solid var(--erp-border);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    gap: 20px;
}

/* Ha az actionbar üres (JS még nem töltötte), elrejtjük */
.erp-actionbar:empty {
    display: none;
}

/* Oldal cím az actionbaron belül – kisebb mint a teljes oldalon */
.erp-actionbar .erp-page-title h2 {
    font-size: 22px !important;
    font-weight: 300 !important;
}

/* Az eredeti erp-page-header NE jelenjen meg az oldalon belül –
   a 3.0-ban az $erp_actionbar változón keresztül megy a topbarba */
.erp-page-header {
    display: none !important;
}

/* Inline siker üzenet (actionbarban) */
.erp-inline-success {
    color: #155724;
    background: #d4edda;
    border: 1px solid #28a745;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
}



/* ==========================================================================
   CASH-FLOW TÁBLÁZAT ÉS KÁRTYA VÉGLEGES JAVÍTÁSA
   ========================================================================== */

/* 1. Táblázat rácsának újraépítése (függőleges szétcsúszás ellen) */
.cf-table { 
    width: 100% !important; 
    border-collapse: separate !important; /* Nem collapse, így tudunk sorközt tartani */
    border-spacing: 0 8px !important; /* Ez adja vissza a sorok közötti függőleges űrt! */
    table-layout: fixed !important; /* Megakadályozza a vízszintes kilógást */
    margin-top: 10px !important;
}

/* 2. Oszlopok szigorú, pixelpontos méretezése */
.cf-table th:nth-child(1) { width: 175px !important; }
.cf-table th:nth-child(2) { width: auto !important; }
.cf-table th:nth-child(3) { width: 140px !important; text-align: right !important; }
.cf-table th:nth-child(4) { width: 40px !important; text-align: right !important; }

.cf-table th { 
    padding: 0 5px 8px 5px !important; 
    font-size: 12px !important; 
    font-weight: 600 !important; 
    text-transform: uppercase !important; 
    color: #000 !important; 
    border-bottom: 2px solid var(--erp-border) !important; 
    vertical-align: bottom !important;
}

/* 3. Cellák formázása (felülírjuk az elrontott inline paddingeket is) */
.cf-table td { 
    padding: 0 5px !important; 
    border: none !important; 
    vertical-align: middle !important; 
}

/* 4. Input mezők 100%-os, esztétikus kitöltése a cellán belül */
.cf-table td input.erp-input { 
    width: 100% !important; 
    height: 30px !important; 
    padding: 0 10px !important;
    margin: 0 !important; 
    box-sizing: border-box !important; 
    border: 1px solid var(--erp-border) !important;
    border-radius: 4px !important;
    background: #fff !important;
    color: #000 !important;
}

.cf-table td .btn-delete-row {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 26px !important;
    height: 26px !important;
    padding: 0 !important;
    margin-left: 5px !important;
}

/* 5. A havi kártyák dizájnjának visszahozása (fehér háttér, árnyék, keret) */
.cf-month-card { 
    background: #fff !important; 
    border: 1px solid var(--erp-border) !important; 
    border-radius: 8px !important; 
    overflow: hidden !important; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important; 
    width: 100% !important;
    margin-top: 0 !important;
    box-sizing: border-box !important;
}
.cf-month-header {
    padding: 12px var(--card-pad, 25px) !important;
    background: #f8fafc !important; 
    border-bottom: 1px solid var(--erp-border) !important; 
    text-transform: uppercase !important; 
    font-size: 12px !important; 
    font-weight: 600 !important; 
    color: #000 !important; 
}
.cf-month-body { padding: 20px var(--card-pad, 25px) !important; }
.cf-row { display: flex !important; justify-content: space-between !important; font-size: 13px !important; margin-bottom: 8px !important; align-items: center !important; }
.cf-expense { color: var(--erp-danger) !important; }
.cf-income { color: #38a169 !important; }



/* ==========================================================================
   DATATABLES RENDEZŐ NYILAK (Középre zárt, stabil verzió)
   ========================================================================== */
table.dataTable thead th {
    position: relative !important;
    padding-right: 25px !important; /* Biztosítjuk, hogy a szöveg sose takarja a nyilat */
    cursor: pointer !important; /* <--- EZ VÁLTJA ÁT A KURZORT KÉZRE! */
}

/* Fel/Le nyilak abszolút függőleges középre igazítása */
table.dataTable thead th.sorting::before,
table.dataTable thead th.sorting_asc::before,
table.dataTable thead th.sorting_desc::before {
    content: "▲" !important;
    position: absolute !important;
    right: 8px !important;
    bottom: 50% !important; 
    margin-bottom: -2px !important; /* Finomhangolás a szöveg alapvonalához */
    font-size: 10px !important;
    line-height: 1 !important;
    opacity: 0.2 !important;
}

table.dataTable thead th.sorting::after,
table.dataTable thead th.sorting_asc::after,
table.dataTable thead th.sorting_desc::after {
    content: "▼" !important;
    position: absolute !important;
    right: 8px !important;
    top: 50% !important; 
    margin-top: -2px !important; /* Finomhangolás a szöveg alapvonalához */
    font-size: 10px !important;
    line-height: 1 !important;
    opacity: 0.2 !important;
}

/* Aktív (kiválasztott) rendezés kiemelése kékkel */
table.dataTable thead th.sorting_asc::before,
table.dataTable thead th.sorting_desc::after {
    opacity: 1 !important;
    color: var(--erp-primary-blue) !important;
}

/* Letiltott rendezésű oszlopoknál ne mutassa a nyilakat */
table.dataTable thead th.sorting_disabled::before,
table.dataTable thead th.sorting_disabled::after {
    display: none !important;
   cursor: default !important;
}
/* ==========================================================================
   HOLIDAY PLANNER – SUMMARY GRID (3 oszlopos)
   ========================================================================== */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
}
.summary-box {
    padding: 20px var(--card-pad-x, 20px);
    border-right: 1px solid var(--erp-border);
    font-size: 13px;
}
.summary-box:last-child { border-right: none; }
.summary-box h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #000;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--erp-border);
}
.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--erp-border);
    font-size: 13px;
    align-items: center;
    font-weight: 400;
    color: #000;
}
.summary-row:last-child { border-bottom: none; }

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 6px;
    color: #000;
    font-weight: 400;
}
.legend-badge {
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    min-width: 22px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Holiday naptár hónapnév: desktopon hosszú, mobilon rövid */
.hol-month-short { display: none; }
.hol-month-long  { display: inline; }

/* Working Hours Summary fejléc: desktopon hosszú, mobilon rövid */
.whs-short { display: none; }
.whs-long  { display: inline; }

/* A scrollozható kártyák belső vízszintes margója a globális --card-pad-hoz igazodik,
   hogy a holiday naptár margói egyezzenek a többi kártyáéval (desktop 25px / mobil 16px). */
.ts-card-scrollable { --card-pad-x: var(--card-pad, 25px); }

/* Holiday táblázat scroll wrapper – a vízszintes padding a változóból jön */
.hol-table-scroll {
    padding: 15px var(--card-pad-x) 20px var(--card-pad-x);
}

/* Egységes bal/jobb belső margó a kártyák tábláin/dobozain */
.hol-cal-table th:last-child,
.hol-cal-table td:last-child { padding-right: var(--card-pad-x); }
.whs-table th:first-child,
.whs-table td:first-child { padding-left: var(--card-pad-x) !important; }
.whs-table th:last-child,
.whs-table td:last-child { padding-right: var(--card-pad-x) !important; }

/* ----------------------------------------------------------------------------
   FULL-BLEED TÁBLÁZAT-KÁRTYA MINTA (calendar, recent entries, employees, stb.)
   A kártya padding:0 (a fejléc/elválasztó élig ér), de a tábla első/utolsó
   cellája a globális --card-pad margót adja, így a tartalom ugyanott kezdődik,
   mint a sima kártyáknál. A .flush-scroll mobilon is vízszintesen görgethető.
   -------------------------------------------------------------------------- */
.flush-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
}
.flush-table > thead > tr > th:first-child,
.flush-table > tbody > tr > td:first-child { padding-left: var(--card-pad, 25px) !important; }
.flush-table > thead > tr > th:last-child,
.flush-table > tbody > tr > td:last-child { padding-right: var(--card-pad, 25px) !important; }

/* ==========================================================================
   WEEK VIEW TÁBLÁZAT – újrafelhasználható heti nézet
   ========================================================================== */
.wv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    font-weight: 400;
    table-layout: fixed;
}
.wv-table thead th {
    background: #f8fafc;
    padding: 8px 10px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    color: #000 !important;
    border-bottom: 1px solid var(--erp-border);
    text-align: center;
    white-space: nowrap;
}
.wv-table thead th.wv-th-left { text-align: left !important; padding-left: 20px !important; }
.wv-table tbody td {
    padding: 8px 10px !important;
    border-bottom: 1px solid #edf2f7;
    color: #000;
    font-size: 13px !important;
    font-weight: 400 !important;
    text-align: center;
    vertical-align: middle;
}
.wv-table tbody td.wv-td-left  { text-align: left !important; padding-left: 20px !important; font-weight: 400 !important; }
.wv-table tbody td.wv-td-phase { text-align: left !important; color: #000; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wv-table tbody tr:hover td    { background: #fcfcfc; }
.wv-table tfoot td {
    padding: 8px 10px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-align: center;
    background: #f8fafc;
    border-top: 2px solid var(--erp-border) !important;
    border-bottom: none !important;
}
.wv-table tfoot td.wv-td-left  { text-align: left !important; padding-left: 20px !important; text-transform: uppercase; }
.wv-col-day   { width: 68px; }
.wv-col-total { width: 68px; background: #f0f4f8 !important; }
.wv-col-phase { width: auto; }
.wv-weekend   { background: #f8fafc !important; }
.wv-today     { background: #ebf8ff !important; color: #2b6cb0 !important; }
.wv-grand     { background: #e2e8f0 !important; }

/* Week view kártya – téma overflow elleni védelem */
#wv-card {
    border: 1px solid var(--erp-border) !important;
    outline: none !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
}
#wv-card * {
    font-size: 13px !important;
    box-sizing: border-box;
}
#wv-header {
    font-size: 13px !important;
}
#wv-chevron {
    color: #a0aec0 !important;
}

/* Gomb szöveg variánsok (desktop/mobil) */
.erp-btn-short { display: none; }

/* ==========================================================================
   EGYSÉGES OVERLAY ÜZENETEK – minden oldalon (sikeres mentés + mentés szükséges)
   A meglévő #php-success-msg / .erp-inline-success / #page-save-notice elemeket
   fixed overlay-jé alakítjuk, hogy az oldaltól függetlenül, felül jelenjenek meg.
   ========================================================================== */

/* Sikeres mentés (zöld toast) – flash overlay + minden success üzenet */
#erp-flash-overlay,
.erp-inline-success,
#php-success-msg,
.erp-msg-success {
    position: fixed !important;
    top: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: #38a169 !important;
    color: #fff !important;
    font-family: 'Barlow', "Helvetica Neue", Helvetica, Arial, sans-serif !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 10px 24px !important;
    border: none !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    z-index: 99999 !important;
    max-width: 90vw !important;
    text-align: center !important;
    transition: opacity 0.4s !important;
    margin: 0 !important;
}
#erp-flash-overlay.erp-flash-hide,
.erp-inline-success.erp-flash-hide,
#php-success-msg.erp-flash-hide,
.erp-msg-success.erp-flash-hide { opacity: 0 !important; }

/* Mentés szükséges (narancs figyelmeztető toast) */
#page-save-notice {
    position: fixed !important;
    top: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: #fffaf0 !important;
    color: #dd6b20 !important;
    border: 1px solid #dd6b20 !important;
    font-family: 'Barlow', "Helvetica Neue", Helvetica, Arial, sans-serif !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 10px 24px !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    z-index: 99998 !important;
    max-width: 90vw !important;
    text-align: center !important;
    margin: 0 !important;
}

/* Quick edit overlay */
.erp-qe-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
}
.erp-qe-box {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    min-width: 280px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    gap: 14px;
    font-family: 'Barlow', "Helvetica Neue", Helvetica, Arial, sans-serif !important;
}
.erp-qe-box input,
.erp-qe-box select,
.erp-qe-box button {
    font-family: 'Barlow', "Helvetica Neue", Helvetica, Arial, sans-serif !important;
}
.erp-qe-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    color: #000;
}
.erp-qe-btns {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Kilépés ikon: mobilon a jobb oldalra kerül, desktopon a bal oldalon van */
.erp-mobile-logout { display: none !important; }


/* Mentés ikon gomb */
.erp-save-icon-btn {
    padding: 0 !important;
    width: 30px !important;
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    align-self: center !important;
    margin-top: -4px !important;
}
.erp-save-icon-btn svg {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
}

/* ==========================================================================
   HAMBURGER GOMB – csak mobilon látható
   ========================================================================== */
.erp-ham-btn {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}
.erp-ham-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: #000;
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.25s;
}
.erp-ham-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.erp-ham-btn.open span:nth-child(2) { opacity: 0; }
.erp-ham-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   DRAWER – overlay + panel
   ========================================================================== */
.erp-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}
.erp-drawer-overlay.open {
    opacity: 1;
    pointer-events: all;
}
.erp-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100%;
    background: #fff;
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(.4,0,.2,1);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 16px rgba(0,0,0,0.1);
}
.erp-drawer.open {
    transform: translateX(0);
}
.erp-drawer-header {
    height: var(--erp-nav-height);
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-bottom: 1px solid var(--erp-nav-border);
    flex-shrink: 0;
}
.erp-drawer-nav {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
}
.erp-drawer-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #000;
    text-transform: uppercase;
    text-decoration: none;
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: background 0.15s;
}
.erp-drawer-item:hover { background: #f7f7f7; }
.erp-drawer-item.active { border-left-color: #000; background: #f7f7f7; }
.erp-drawer-item .erp-nav-icon { display: flex; align-items: center; opacity: 0.6; flex-shrink: 0; }
.erp-drawer-item .erp-drawer-chevron {
    margin-left: auto;
    opacity: 0.4;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
}
.erp-drawer-item.sub-open .erp-drawer-chevron { transform: rotate(180deg); }
.erp-drawer-sub {
    display: none;
    padding: 4px 0 4px 42px;
    background: #fafafa;
}
.erp-drawer-sub.open { display: block; }
.erp-drawer-sub a {
    display: block;
    padding: 9px 16px 9px 0;
    font-size: 12px;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    text-decoration: none;
    border-left: none;
}
.erp-drawer-sub a:hover { color: #000; }
.erp-drawer-sub a.active { color: #000; font-weight: 700; }
.erp-drawer-footer {
    border-top: 1px solid var(--erp-nav-border);
    padding: 8px 0;
    flex-shrink: 0;
}

/* ==========================================================================
   MOBIL MEDIA QUERY
   ========================================================================== */
@media (max-width: 1024px) {

    /* Vízszintes elhúzás megakadályozása.
       touch-action: pan-y CSAK a nem-scrollozható kártyákon van, nem globálisan –
       különben a leszármazott overflow:auto elemek sem tudnak vízszintesen scrollozni. */
    html {
        overflow-x: clip !important;
        max-width: 100% !important;
    }
    body {
        overflow-x: clip !important;
        max-width: 100% !important;
        width: 100% !important;
        position: relative !important;
    }
    .erp-app-container,
    .erp-content-area {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        width: 100% !important;
    }
    /* Fixed topnav garantáltan viewport-széles, nem lóghat ki */
    .erp-topnav {
        left: 0 !important;
        right: 0 !important;
        max-width: 100vw !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    /* A kártyák alap overflow-x:auto-ja engedi az oldalra húzást – kikapcsoljuk.
       touch-action: pan-y itt van (nem a html/body-n), hogy a .hol-table-scroll
       felül tudja írni pan-x engedélyezésével. */
    .proj-card,
    .ts-card:not(.ts-card-scrollable),
    .others-card,
    .cf-month-card,
    .partners-table-wrapper,
    .erp-table-wrap {
        overflow-x: hidden !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        touch-action: pan-y pinch-zoom !important;
    }
    .ts-card-scrollable {
        overflow-x: hidden !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Select2 kereső mező: iOS zoom megakadályozása szövegnövelés NÉLKÜL.
       Belül 16px (a Safari ezt nem zoomolja), de scale(0.8125) visszazsugorítja,
       így vizuálisan 13px marad. Csak a kereső inputra, a megjelenített érték 13px. */
    .select2-search--dropdown .select2-search__field {
        font-size: 16px !important;
        transform: scale(0.8125);
        transform-origin: left center;
        width: 122.8% !important;
    }

    /* Comment input: ugyanaz a scale-trükk (nincs zoom, vizuálisan 13px).
       A .comment-scale-wrap overflow:hidden elnyeli a 123%-os layout túllógást.
       max-width: none KELL, különben a .ts-card input max-width:100% leklamplná
       a szélességet 100%-ra, és a scale után csak 81% maradna. */
    #comment-input {
        font-size: 16px !important;
        transform: scale(0.8125);
        transform-origin: left center;
        width: 123.08% !important;
        max-width: none !important;
        /* Magasság kompenzálás: 32 × 0.8125 = 26px vizuálisan */
        height: 32px !important;
        min-height: 32px !important;
        max-height: 32px !important;
        line-height: 30px !important;
    }

    /* Nav: desktop lista elrejtése, hamburger megjelenítése */
    .erp-topnav-list,
    .erp-topnav-divider { display: none !important; }

    .erp-topnav {
        padding: 0 12px;
    }

    .erp-topnav-left {
        gap: 0;
    }

    .erp-topnav-logo {
        margin-right: 0;
    }

    .erp-ham-btn { display: flex; }

    /* Topnav nem lóghat ki a viewportból */
    .erp-topnav { overflow: hidden !important; }

    /* Hamburger 3px-el feljebb */
    .erp-ham-btn { margin-top: -3px !important; }

    /* Day oszlop mobilon rejtve */
    .ts-col-day { display: none !important; }

    /* Kilépés: bal oldalon elrejtve, jobb oldalon megjelenik */
    .erp-topnav-left > a.erp-topnav-link[title="Kilépés"] { display: none !important; }
    .erp-mobile-logout { display: flex !important; }

    /* Mentés ikon gomb mobilon ugyanolyan, padding nulla */
    .erp-save-icon-btn { width: 36px !important; }

    /* Drawer és overlay aktívvá válik */
    .erp-drawer-overlay { display: block; }

    /* Content area kisebb padding mobilon, overflow-x kikapcsolva */
    .erp-content-area {
        padding: calc(var(--erp-nav-height) + 16px) 14px 32px 14px !important;
        overflow-x: hidden !important;
        width: 100% !important;
        box-sizing: border-box !important;
        --card-pad: 16px;
    }

    /* Timesheet form: sorok egymás alá */
    .ts-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        margin-bottom: 16px !important;
    }

    .ts-label {
        width: auto !important;
        padding-top: 0 !important;
        margin-bottom: 6px;
    }

    .ts-content {
        width: 100% !important;
        flex-wrap: wrap !important;
    }

    /* Minden input/select/textarea teljes szélesség – inline style-t is felülírjuk */
    .ts-card input,
    .ts-card select,
    .ts-card textarea,
    .ts-input {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    /* Projekt select wrapper teljes szélesség mobilon */
    .ts-project-select-wrap { width: 100% !important; }
    .ts-project-select-wrap .select2-container { width: 100% !important; }

    /* Dátum + óra: gombok és inputok flex-wrap-pel természetesen törnek,
       sorrend és column-direction override nélkül */
    .ts-date-hours-row input[type="date"] { width: 150px !important; max-width: 150px !important; }
    .ts-date-hours-row select.ts-input#logged_hours_select { width: 80px !important; max-width: 80px !important; }

    .select2-container { width: 100% !important; }
    #project_select { width: 100% !important; }

    /* Submit gomb teljes szélesség, nagyobb tap target */
    .ts-submit-btn {
        width: 100% !important;
        height: 44px !important;
        font-size: 14px !important;
    }

    /* ts-card mobil padding a globális --card-pad változóból jön (16px),
       a scrollozható naptár-kártyák inline padding:0-ja felülírja. */

    /* Week view: mobilon nem jelenik meg */
    #wv-card { display: none !important; }

    /* Recent entries: csak Dátum, Projekt, Óra + Action látszik */
    .ts-col-employee,
    .ts-col-details,
    .ts-col-comment { display: none !important; }

    /* Recent entries kártya és tábla: teljes szélesség */
    .proj-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    .ts-table:not(.hol-cal-table) {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    /* Recent entries fejléc: mobilon egymás alá */
    .ts-entries-header {
        height: auto !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
        padding: 12px var(--card-pad) !important;
    }
    .ts-entries-header form {
        flex-wrap: wrap !important;
        gap: 8px !important;
        width: 100% !important;
    }
    .ts-entries-header form .ts-input,
    .ts-entries-header form select { width: 100% !important; max-width: 100% !important; }

    /* Dátum filter: label mobilon */
    .ts-filter-date-wrap { width: 100%; }
    .ts-filter-date-wrap::before {
        content: attr(data-label);
        display: block;
        font-size: 11px;
        font-weight: 600;
        color: #718096;
        text-transform: uppercase;
        margin-bottom: 4px;
    }
    .ts-filter-date-wrap .ts-input { width: 100% !important; }
    .ts-filter-sep { display: none !important; }

    /* Rövidített gombok mobilon */
    .erp-btn-full { display: none !important; }
    .erp-btn-short { display: inline !important; }

    /* Recent entries tábla: fixed layout + százalékos oszlopok.
       Mindig 4 látható oszlop (date/project/hours/action), a rejtett
       oszlopok display:none-nal kiesnek. A százalékok 100%-ra jönnek ki,
       így a tábla determinisztikusan kitölti a teljes szélességet. */
    .ts-table:not(.hol-cal-table) {
        table-layout: fixed !important;
        width: 100% !important;
    }
    .ts-col-date    { width: 24% !important; max-width: none !important; white-space: nowrap !important; }
    .ts-col-project { width: 44% !important; max-width: none !important; }
    .ts-col-hours   { width: 14% !important; max-width: none !important; white-space: nowrap !important; }
    .ts-col-action  {
        width: 18% !important;
        max-width: none !important;
        text-align: right !important;
        white-space: nowrap !important;
        padding-left: 4px !important;
        padding-right: 8px !important;
    }
    .ts-col-action > div { gap: 4px !important; }
    .ts-col-action .erp-action-btn,
    .ts-col-action .erp-action-btn-danger {
        padding: 0 7px !important;
        min-width: 24px !important;
    }

    /* Date input – 26px, egységes a többi inputtal */
    input[type="date"] {
        -webkit-appearance: none !important;
        appearance: none !important;
        height: 26px !important;
        min-height: 26px !important;
        max-height: 26px !important;
        line-height: 24px !important;
        padding: 0 10px !important;
        border: 1px solid var(--erp-border) !important;
        border-radius: 4px !important;
        background: #fff !important;
        font-family: inherit !important;
        font-size: 13px !important;
        color: #000 !important;
        box-sizing: border-box !important;
    }

    /* Actionbar mobilon elrejtve (a submit gomb a formban van) */
    .erp-actionbar { display: none !important; }

    /* Topbar mobilon nem sticky – helyet spórolunk */
    .erp-topbar { position: relative !important; }

    /* Holiday táblázat scroll */
    .hol-table-scroll {
        width: 100%;
        box-sizing: border-box;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y;
        /* vízszintes padding a --card-pad-x változóból (base szabály) */
    }

    /* Holiday naptár hónapnév rövidítése mobilon */
    .hol-month-long { display: none; }
    .hol-month-short { display: inline; }

    /* Working Hours Summary fejléc rövidítése mobilon */
    .whs-long  { display: none; }
    .whs-short { display: inline; }

    /* Working Hours Summary oszlopok tömörítése, hogy a diff értékek egysorosak maradjanak */
    .whs-table th,
    .whs-table td {
        padding: 10px 6px !important;
        white-space: nowrap !important;
        font-size: 12px !important;
    }

    /* Holiday naptár: a summary-grid 3 oszlopból 1 oszlopra vált,
       minden summary-box alulra kerül, és a kártyák vízszintesen görgethetők */
    .summary-grid {
        grid-template-columns: 1fr !important;
    }
    .summary-box {
        border-right: none !important;
        border-bottom: 1px solid var(--erp-border) !important;
    }
    .summary-box:last-child { border-bottom: none !important; }
}
