/**
 * KockázatWeb v2 – Teljes Design System
 * SmartAdmin NÉLKÜL. Saját, modern CSS.
 *
 * Esztétika: "Precision Risk" – ipari pontosság, adatgazdag
 * de légies. Sötét sidebar + fehér content area.
 * Betűtípus: Instrument Sans (display) + Inter (body)
 */

/* ============================================================ */
/* RESET & BASE                                                  */
/* ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* Brand */
    --c-primary:       #1a6fc4;
    --c-primary-d:     #1258a0;
    --c-primary-l:     #e8f1fb;
    --c-accent:        #e8530a;

    /* Sidebar */
    --c-sidebar-bg:    #111827;
    --c-sidebar-bg2:   #1a2436;
    --c-sidebar-text:  rgba(255,255,255,.6);
    --c-sidebar-hover: rgba(255,255,255,.08);
    --c-sidebar-active:rgba(26,111,196,.25);
    --c-sidebar-w:     220px;
    --c-sidebar-w-min: 56px;

    /* Layout */
    --c-header-h:      54px;
    --c-bg:            #f0f2f5;
    --c-surface:       #ffffff;
    --c-border:        #e3e7ec;
    --c-border-l:      #f0f2f5;

    /* Text */
    --c-text:          #111827;
    --c-text-2:        #4b5563;
    --c-text-3:        #9ca3af;

    /* Risk levels */
    --c-low:      #059669;
    --c-medium:   #d97706;
    --c-high:     #dc2626;
    --c-critical: #7f1d1d;

    /* Shadows */
    --sh-sm:  0 1px 3px rgba(0,0,0,.07);
    --sh:     0 4px 12px rgba(0,0,0,.09);
    --sh-lg:  0 8px 32px rgba(0,0,0,.13);

    /* Misc */
    --r-sm:   6px;
    --r:      10px;
    --r-lg:   16px;
    --tr:     0.18s cubic-bezier(.4,0,.2,1);
}

html { height: 100%; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--c-text);
    background: var(--c-bg);
    min-height: 100%;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--c-primary); text-decoration: none; transition: color var(--tr); }
a:hover { color: var(--c-primary-d); }

h1,h2,h3,h4,h5,h6 {
    font-family: 'Instrument Sans', 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.25;
    color: var(--c-text);
}

img { max-width: 100%; }

/* ============================================================ */
/* APP SHELL LAYOUT                                             */
/* ============================================================ */
#kw-shell {
    display: flex;
    min-height: 100vh;
    /* NE hozzon létre új stacking context-et – modal backdrop miatt */
    isolation: auto;
}

/* SIDEBAR */
#kw-sidebar {
    width: var(--c-sidebar-w);
    background: var(--c-sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: width var(--tr);
    overflow: hidden;
}

#kw-sidebar.collapsed { width: var(--c-sidebar-w-min); }
#kw-sidebar.collapsed .kw-nav-label,
#kw-sidebar.collapsed .kw-sidebar-user-name,
#kw-sidebar.collapsed .kw-nav-section-title { opacity: 0; width: 0; overflow: hidden; }
#kw-sidebar.collapsed .kw-brand-name { display: none; }

/* Sidebar brand */
.kw-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    height: var(--c-header-h);
    border-bottom: 1px solid rgba(255,255,255,.07);
    flex-shrink: 0;
}

.kw-brand-icon {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--c-primary), #2884e8);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.kw-brand-icon svg { width: 18px; height: 18px; fill: #fff; }

.kw-brand-name {
    font-family: 'Instrument Sans', sans-serif;
    font-weight: 800;
    font-size: 15px;
    color: #fff;
    letter-spacing: -.02em;
    white-space: nowrap;
}

/* Sidebar user */
.kw-sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}

.kw-user-avatar {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, #374151, #4b5563);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: rgba(255,255,255,.7);
    font-size: 14px;
}

.kw-sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Nav */
.kw-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.1) transparent;
}

.kw-nav-section-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255,255,255,.25);
    padding: 14px 16px 4px;
    white-space: nowrap;
}

.kw-nav-item {
    list-style: none;
    padding: 2px 8px;
}

.kw-nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    border-radius: var(--r-sm);
    color: var(--c-sidebar-text) !important;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--tr);
    white-space: nowrap;
    text-decoration: none !important;
}

.kw-nav-link:hover {
    color: #fff !important;
    background: var(--c-sidebar-hover);
}

.kw-nav-link.active {
    color: #fff !important;
    background: var(--c-sidebar-active);
    border-left: 3px solid var(--c-primary);
    padding-left: 7px;
}

.kw-nav-icon {
    width: 18px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
    opacity: .75;
}
.kw-nav-link.active .kw-nav-icon,
.kw-nav-link:hover .kw-nav-icon { opacity: 1; }

.kw-nav-label { white-space: nowrap; }

/* Sidebar footer */
.kw-sidebar-footer {
    padding: 12px 8px;
    border-top: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}

.kw-sidebar-toggle {
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,.4);
    padding: 8px 10px;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    transition: all var(--tr);
}
.kw-sidebar-toggle:hover { color: rgba(255,255,255,.7); background: rgba(255,255,255,.06); }

/* MAIN CONTENT */
#kw-main {
    margin-left: var(--c-sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--tr);
}

#kw-main.expanded { margin-left: var(--c-sidebar-w-min); }

/* TOPBAR */
#kw-topbar {
    height: var(--c-header-h);
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 99;
    box-shadow: var(--sh-sm);
}

.kw-topbar-breadcrumb {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--c-text-3);
}

.kw-topbar-breadcrumb span { color: var(--c-text-2); }
.kw-topbar-breadcrumb .sep { color: var(--c-border); }
.kw-topbar-breadcrumb .current { color: var(--c-text); font-weight: 600; }

.kw-topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kw-topbar-btn {
    width: 34px; height: 34px;
    border-radius: var(--r-sm);
    background: none;
    border: 1px solid var(--c-border);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--c-text-2);
    font-size: 14px;
    transition: all var(--tr);
    text-decoration: none;
}
.kw-topbar-btn:hover {
    background: var(--c-bg);
    color: var(--c-text);
    border-color: #c5cad1;
}

/* PAGE CONTENT */
#kw-content {
    flex: 1;
    padding: 24px;
    animation: fadeup .25s ease both;
}

@keyframes fadeup {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* PAGE FOOTER */
#kw-footer {
    background: #f9fafb;
    border-top: 1px solid var(--c-border);
    padding: 10px 24px;
    color: var(--c-text-3);
    font-size: 12px;
    display: flex;
    align-items: center;
}

/* ============================================================ */
/* BEJELENTKEZÉSI KÉPERNYŐ                                      */
/* ============================================================ */
.kw-login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #090f1a 0%, #0f1e33 40%, #091524 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.kw-login-page::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(26,111,196,.12) 0%, transparent 70%);
    top: -100px; right: -100px;
    pointer-events: none;
}
.kw-login-page::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232,83,10,.08) 0%, transparent 70%);
    bottom: -50px; left: -50px;
    pointer-events: none;
}

.kw-login-box {
    width: 100%;
    max-width: 400px;
    animation: fadeup .5s ease both;
    position: relative;
    z-index: 1;
}

.kw-login-logo {
    text-align: center;
    margin-bottom: 40px;
}

.kw-login-logo-icon {
    width: 72px; height: 72px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--c-primary), #2884e8);
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 12px 32px rgba(26,111,196,.4);
}

.kw-login-logo-icon svg { width: 36px; height: 36px; fill: #fff; }

.kw-login-logo h1 {
    font-family: 'Instrument Sans', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -.03em;
    margin-bottom: 6px;
}

.kw-login-logo p {
    color: rgba(255,255,255,.4);
    font-size: 13px;
}

.kw-login-card {
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.1);
    backdrop-filter: blur(20px);
    border-radius: var(--r-lg);
    padding: 32px;
    box-shadow: var(--sh-lg);
}

.kw-field { margin-bottom: 18px; }
.kw-field label {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(255,255,255,.5);
    margin-bottom: 8px;
}

.kw-input-wrap { position: relative; }
.kw-input-wrap .icon {
    position: absolute;
    left: 13px; top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,.25);
    font-size: 13px;
    pointer-events: none;
}

.kw-field input[type="email"],
.kw-field input[type="password"],
.kw-field input[type="text"] {
    width: 100%;
    padding: 11px 13px 11px 38px;
    background: rgba(255,255,255,.08);
    border: 1.5px solid rgba(255,255,255,.12);
    border-radius: var(--r-sm);
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all var(--tr);
}
.kw-field input::placeholder { color: rgba(255,255,255,.25); }
.kw-field input:focus {
    background: rgba(255,255,255,.11);
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(26,111,196,.2);
}

.kw-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    background: linear-gradient(135deg, var(--c-primary), #2884e8);
    color: #fff;
    border: none;
    border-radius: var(--r-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--tr);
    box-shadow: 0 4px 16px rgba(26,111,196,.35);
    text-decoration: none;
    width: 100%;
}
.kw-btn-primary:hover {
    background: linear-gradient(135deg, var(--c-primary-d), var(--c-primary));
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(26,111,196,.45);
    color: #fff;
}
.kw-btn-primary:active { transform: none; }

.kw-login-links {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}
.kw-login-links a {
    color: rgba(255,255,255,.35);
    font-size: 12.5px;
    transition: color var(--tr);
}
.kw-login-links a:hover { color: rgba(255,255,255,.6); }

/* ============================================================ */
/* ALERT SÁVOK                                                  */
/* ============================================================ */
.kw-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--r-sm);
    font-size: 13px;
    margin-bottom: 16px;
    border-left: 4px solid transparent;
}
.kw-alert i { font-size: 14px; margin-top: 1px; flex-shrink: 0; }
.kw-alert .kw-alert-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    opacity: .5;
    font-size: 16px;
    padding: 0 4px;
    transition: opacity var(--tr);
}
.kw-alert .kw-alert-close:hover { opacity: 1; }

.kw-alert-info     { background: #eff6ff; border-color: var(--c-primary); color: #1e40af; }
.kw-alert-warning  { background: #fffbeb; border-color: var(--c-medium);  color: #92400e; }
.kw-alert-danger   { background: #fef2f2; border-color: var(--c-high);    color: #991b1b; }
.kw-alert-success  { background: #f0fdf4; border-color: var(--c-low);     color: #166534; }

/* Login oldalon sötét alert */
.kw-login-card .kw-alert-danger {
    background: rgba(220,38,38,.12);
    border-color: rgba(220,38,38,.4);
    color: #fca5a5;
}

.kw-subscription-bar {
    background: linear-gradient(90deg, #7f1d1d, #991b1b);
    color: #fecaca;
    padding: 10px 24px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.kw-subscription-bar a { color: #fed7aa; font-weight: 700; }

/* ============================================================ */
/* CARD / PANEL                                                 */
/* ============================================================ */
.kw-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    box-shadow: var(--sh-sm);
}

.kw-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--c-border-l);
}

.kw-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--c-text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.kw-card-title i { color: var(--c-text-3); }

.kw-card-body { padding: 20px; }

.kw-card-actions { display: flex; gap: 8px; align-items: center; }

/* ============================================================ */
/* GOMBOK                                                       */
/* ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--r-sm);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: all var(--tr);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--c-primary), #2884e8);
    color: #fff;
    box-shadow: 0 2px 8px rgba(26,111,196,.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--c-primary-d), var(--c-primary));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26,111,196,.4);
    color: #fff;
}

.btn-success {
    background: linear-gradient(135deg, #047857, #059669);
    color: #fff;
}
.btn-success:hover { background: linear-gradient(135deg, #065f46, #047857); color: #fff; transform: translateY(-1px); }

.btn-warning {
    background: linear-gradient(135deg, #b45309, #d97706);
    color: #fff;
}
.btn-warning:hover { color: #fff; transform: translateY(-1px); }

.btn-danger {
    background: linear-gradient(135deg, #b91c1c, #dc2626);
    color: #fff;
}
.btn-danger:hover { color: #fff; transform: translateY(-1px); }

.btn-info {
    background: linear-gradient(135deg, #0369a1, #0284c7);
    color: #fff;
}
.btn-info:hover { color: #fff; transform: translateY(-1px); }

.btn-secondary {
    background: #f3f4f6;
    color: var(--c-text-2);
    border: 1px solid var(--c-border);
}
.btn-secondary:hover { background: #e5e7eb; color: var(--c-text); }

.btn-lg { padding: 11px 22px; font-size: 14px; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-xs { padding: 3px 9px; font-size: 11px; border-radius: 4px; }

.btn:disabled, .btn[disabled] {
    opacity: .45; cursor: not-allowed; pointer-events: none;
}

/* ============================================================ */
/* TÁBLÁZATOK                                                   */
/* ============================================================ */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--r);
    border: 1px solid var(--c-border);
    background: var(--c-surface);
    box-shadow: var(--sh-sm);
}

table.kw-table {
    width: 100%;
    border-collapse: collapse;
}

.kw-table thead th {
    background: #f9fafb;
    border-bottom: 2px solid var(--c-border);
    padding: 11px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--c-text-2);
    white-space: nowrap;
    text-align: left;
}

.kw-table tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--c-border-l);
    font-size: 13px;
    vertical-align: middle;
}

.kw-table tbody tr:last-child td { border-bottom: none; }
.kw-table tbody tr:hover td { background: var(--c-primary-l); }
.kw-table tbody tr.selected td,
table.dataTable tbody tr.selected td,
table.dataTable tbody tr.kw-selected td {
    background: #dbeafe !important;
    color: var(--c-text-1);
    border-left: 3px solid var(--c-primary);
}
table.dataTable tbody tr.selected:hover td,
table.dataTable tbody tr.kw-selected:hover td {
    background: #bfdbfe !important;
}

/* DataTables override */
table.dataTable { border-collapse: collapse !important; }
table.dataTable thead th {
    background: #f9fafb !important;
    border-bottom: 2px solid var(--c-border) !important;
    padding: 11px 14px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: .07em !important;
    color: var(--c-text-2) !important;
}
table.dataTable tbody td {
    padding: 11px 14px !important;
    border-bottom: 1px solid var(--c-border-l) !important;
    font-size: 13px !important;
    vertical-align: middle !important;
}
table.dataTable tbody tr:hover td { background: var(--c-primary-l) !important; }
table.dataTable.stripe tbody tr.odd { background: #fafafa; }

.dataTables_wrapper .dataTables_filter input {
    border: 1.5px solid var(--c-border);
    border-radius: var(--r-sm);
    padding: 6px 12px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color var(--tr);
}
.dataTables_wrapper .dataTables_filter input:focus { border-color: var(--c-primary); }

.dataTables_wrapper .dataTables_length select {
    border: 1.5px solid var(--c-border);
    border-radius: var(--r-sm);
    padding: 5px 10px;
    font-family: inherit;
    font-size: 13px;
}

/* DataTables Bootstrap 5 – finomhangolás */
.dataTables_wrapper .dataTables_filter input {
    border: 1.5px solid var(--c-border);
    border-radius: var(--r-sm);
    padding: 6px 12px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color var(--tr);
}
.dataTables_wrapper .dataTables_filter input:focus { border-color: var(--c-primary); }
.dataTables_wrapper .dataTables_length select {
    border: 1.5px solid var(--c-border);
    border-radius: var(--r-sm);
    padding: 5px 10px;
    font-family: inherit;
    font-size: 13px;
}
.dataTables_wrapper .dataTables_paginate .page-link {
    color: var(--c-primary);
    border-color: var(--c-border);
    font-size: 13px;
}
.dataTables_wrapper .dataTables_paginate .page-item.active .page-link {
    background: var(--c-primary);
    border-color: var(--c-primary);
}
.dataTables_wrapper .dataTables_paginate .page-item.disabled .page-link {
    color: #ccc;
}
.dataTables_wrapper .dataTables_info {
    padding-top: 8px;
    font-size: 12px;
    color: var(--c-text-3);
}
.dataTables_wrapper { padding-bottom: 8px; }



/* ============================================================ */
/* FORM ELEMEK                                                  */
/* ============================================================ */
.kw-form-group { margin-bottom: 18px; }

.kw-form-group label,
.kw-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--c-text-2);
    margin-bottom: 6px;
}

.kw-input,
input[type="text"].kw-input,
input[type="email"].kw-input,
input[type="password"].kw-input,
input[type="number"].kw-input,
input[type="date"].kw-input,
select.kw-input,
textarea.kw-input {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--c-border);
    border-radius: var(--r-sm);
    font-size: 13px;
    font-family: inherit;
    color: var(--c-text);
    background: var(--c-surface);
    outline: none;
    transition: border-color var(--tr), box-shadow var(--tr);
    -webkit-appearance: none;
}
.kw-input:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(26,111,196,.1);
}
select.kw-input { 
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
textarea.kw-input { resize: vertical; min-height: 80px; }

/* Smart-form legacy support */
.smart-form .input input,
.smart-form .select select,
.smart-form .textarea textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--c-border);
    border-radius: var(--r-sm);
    font-size: 13px;
    font-family: inherit;
    color: var(--c-text);
    background: var(--c-surface);
    outline: none;
    transition: border-color var(--tr);
    box-shadow: none;
}
.smart-form .input input:focus,
.smart-form .select select:focus,
.smart-form .textarea textarea:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(26,111,196,.1);
}

.smart-form label.label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--c-text-2);
    display: block;
    margin-bottom: 5px;
}

.smart-form section { margin-bottom: 16px; }

/* Radio / Checkbox */
.smart-form label.radio,
.smart-form label.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--c-text-2);
    padding: 4px 0;
}
.smart-form label.radio input,
.smart-form label.checkbox input { width: 16px; height: 16px; accent-color: var(--c-primary); }

/* ============================================================ */
/* MODAL (Bootstrap 5)                                          */
/* ============================================================ */
.modal-content {
    border: none;
    border-radius: var(--r);
    box-shadow: var(--sh-lg);
    overflow: hidden;
}
.modal-header {
    background: #f9fafb;
    border-bottom: 1px solid var(--c-border);
    padding: 18px 24px;
}
.modal-header .modal-title { font-size: 15px; font-weight: 700; color: var(--c-text); }
.modal-body { padding: 24px; }
.modal-footer {
    border-top: 1px solid var(--c-border);
    padding: 16px 24px;
    background: #f9fafb;
}

/* ============================================================ */
/* PROGRESS BAR                                                 */
/* ============================================================ */
.progress {
    height: 8px;
    background: #e5e7eb;
    border-radius: 100px;
    overflow: hidden;
    margin: 4px 0;
}
.progress-xs { height: 5px; }
.progress-sm { height: 8px; }
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--c-primary), #2884e8);
    border-radius: 100px;
    transition: width .5s ease;
}

/* ============================================================ */
/* BADGE / LABEL                                                */
/* ============================================================ */
.badge, .label {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .03em;
    line-height: 1.5;
}
.label-primary, .badge-primary { background: var(--c-primary-l);  color: var(--c-primary); }
.label-success, .badge-success { background: #dcfce7; color: #166534; }
.label-warning, .badge-warning { background: #fef3c7; color: #92400e; }
.label-danger,  .badge-danger  { background: #fee2e2; color: #991b1b; }
.label-info,    .badge-info    { background: #dbeafe; color: #1e40af; }

/* Rizikó szint badge-ek */
.kw-risk-low      { background: #dcfce7; color: #166534; font-weight: 700; }
.kw-risk-medium   { background: #fef3c7; color: #92400e; font-weight: 700; }
.kw-risk-high     { background: #fee2e2; color: #991b1b; font-weight: 700; }
.kw-risk-critical { background: #fce7f3; color: #881337; font-weight: 700; }

/* ============================================================ */
/* JSTREE OVERRIDES                                             */
/* ============================================================ */
#jstree li > a { font-size: 13px !important; color: var(--c-text) !important; }
#jstree li > a:hover { background: var(--c-primary-l) !important; }
#jstree li > a.jstree-clicked { background: var(--c-primary-l) !important; color: var(--c-primary) !important; font-weight: 600 !important; }

/* ============================================================ */
/* SELECT2 OVERRIDES                                           */
/* ============================================================ */
.select2-container--default .select2-selection--single {
    border: 1.5px solid var(--c-border) !important;
    border-radius: var(--r-sm) !important;
    height: 36px !important;
}
.select2-container--default .select2-selection--single:focus,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--c-primary) !important;
    box-shadow: 0 0 0 3px rgba(26,111,196,.1) !important;
}
.select2-dropdown { border-radius: var(--r-sm) !important; border: 1.5px solid var(--c-border) !important; box-shadow: var(--sh) !important; }
.select2-container--default .select2-results__option--highlighted {
    background: var(--c-primary) !important;
}

/* ============================================================ */
/* ION RANGE SLIDER                                             */
/* ============================================================ */
.irs-bar { background: var(--c-primary) !important; }
.irs-bar-edge { background: var(--c-primary) !important; }
.irs-slider { background: var(--c-primary) !important; }

/* ============================================================ */
/* TOOLTIP                                                      */
/* ============================================================ */
.tooltip-inner {
    background: var(--c-sidebar-bg);
    border-radius: var(--r-sm);
    font-size: 12px;
    padding: 5px 10px;
}

/* ============================================================ */
/* RESPONSIVE                                                   */
/* ============================================================ */
@media (max-width: 768px) {
    #kw-sidebar {
        transform: translateX(-100%);
        transition: transform var(--tr), width var(--tr);
    }
    #kw-sidebar.mobile-open { transform: translateX(0); }
    #kw-main { margin-left: 0 !important; }

    #kw-content { padding: 16px; }

    .kw-login-card { padding: 24px 20px; }

    table.dataTable thead { display: none; }
    table.dataTable tbody td { display: block; padding: 8px 14px !important; }
    table.dataTable tbody td:first-child { padding-top: 12px !important; }
    table.dataTable tbody td:last-child { padding-bottom: 12px !important; }
}

@media (max-width: 480px) {
    .kw-login-logo h1 { font-size: 22px; }
    .kw-login-box { max-width: 100%; }
}

/* ============================================================ */
/* UTILITY                                                      */
/* ============================================================ */
.text-muted { color: var(--c-text-3) !important; }
.text-primary { color: var(--c-primary) !important; }
.text-success { color: var(--c-low) !important; }
.text-warning { color: var(--c-medium) !important; }
.text-danger  { color: var(--c-high) !important; }
.text-right   { text-align: right; }
.text-center  { text-align: center; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.p-0  { padding: 0 !important; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-2 { gap: 8px; }
.flex-1 { flex: 1; }

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
