/* ============================================================================
   BugTracker — App CSS
   ============================================================================ */

:root {
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-danger: #dc2626;
    --color-success: #16a34a;
    --color-warning: #d97706;
    --color-bg: #f1f5f9;
    --color-surface: #ffffff;
    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --color-border: #e2e8f0;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body.loading {
    visibility: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-bg);
}

/* ========== Nézetek ========== */
.view { display: none; }
.view.active { display: block; }

/* ========== Login ========== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 24px;
    color: var(--color-primary);
}

/* ========== Form ========== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--color-text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: inherit;
    color: var(--color-text);
    background: var(--color-surface);
    transition: border-color 0.2s;
}

/* Nem vonatkozhat checkbox/rádió-kra — különbén [□]——————————————— név törik */
.form-group input[type="checkbox"],
.form-group input[type="radio"] {
    width: auto;
    max-width: none;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}

.form-group input[type="checkbox"]:focus,
.form-group input[type="radio"]:focus {
    outline: revert;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-desc {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: 16px;
}

.login-links {
    text-align: center;
    margin-top: 16px;
}

.login-links a {
    font-size: 13px;
    color: var(--color-primary);
    text-decoration: none;
}

.login-links a:hover {
    text-decoration: underline;
}

/* ========== Gombok ========== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.2s, opacity 0.2s;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-primary-hover);
}

.btn-outline {
    background: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-outline:hover {
    background: var(--color-bg);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-full {
    width: 100%;
    margin-top: 8px;
}

/* ========== Üzenetek ========== */
.msg {
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 16px;
}

.msg-error {
    background: #fef2f2;
    color: var(--color-danger);
    border: 1px solid #fecaca;
}

.msg-success {
    background: #f0fdf4;
    color: var(--color-success);
    border: 1px solid #bbf7d0;
}

/* ========== Header ========== */
#app-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

#app-header .header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

#app-header .header-left h1 {
    font-size: 18px;
    color: var(--color-primary);
}

#app-header .header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

#user-name {
    font-size: 14px;
    color: var(--color-text-muted);
}

/* ========== Navigáció ========== */
#app-nav {
    display: flex;
    gap: 4px;
}

.nav-link {
    padding: 6px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-muted);
    text-decoration: none;
    border-radius: var(--radius);
    transition: background 0.2s, color 0.2s;
}

.nav-link:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

.nav-link.active {
    background: var(--color-primary);
    color: #fff;
}

/* ========== Container ========== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
}

/* ========== Page ========== */
.page { display: block; }

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.page-header h2 {
    font-size: 20px;
}

.back-link {
    display: inline-block;
    font-size: 13px;
    color: var(--color-text-muted);
    text-decoration: none;
    margin-bottom: 4px;
}

.back-link:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.empty-text {
    color: var(--color-text-muted);
    text-align: center;
    padding: 60px 0;
    font-size: 16px;
}

/* ========== Táblázat ========== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.data-table th {
    background: var(--color-bg);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    font-size: 14px;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.data-table .actions a {
    font-size: 13px;
    color: var(--color-primary);
    text-decoration: none;
}

.data-table .actions a:hover {
    text-decoration: underline;
}

/* ========== Modal ========== */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
}

.modal-box {
    position: relative;
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 24px;
    width: 100%;
    max-width: 500px;
    z-index: 1;
}

.modal-box h3 {
    font-size: 18px;
    margin-bottom: 16px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    gap: 8px;
    margin-top: 16px;
}

/* ========== Utility ========== */
.text-muted { color: var(--color-text-muted); }
.text-danger { color: var(--color-danger) !important; }

/* ========== Badge ========== */
.badge {
    display: inline-block;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    white-space: nowrap;
}

.badge-role {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-muted {
    background: var(--color-bg);
    color: var(--color-text-muted);
}

/* ========== Checkbox lista ========== */
.checkbox-list {
    max-height: 250px;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
}

.checkbox-item:hover {
    background: var(--color-bg);
}

.checkbox-item input {
    margin: 0;
    flex-shrink: 0;
}

/* .form-group label { display: block } felülírja a flexet — sorban tartás */
.form-group label.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    font-weight: 400;
    color: var(--color-text);
}

.assign-help summary:focus {
    outline: none;
}

.assign-help summary:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

.assign-help[open] .assign-help-summary-hint {
    display: none;
}

.assign-help {
    font-size: 13px;
    line-height: 1.55;
    color: var(--color-text);
    margin: 0 0 16px;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg);
}

.assign-help summary {
    list-style: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    color: var(--color-text);
}

.assign-help summary::-webkit-details-marker {
    display: none;
}

.assign-help-summary {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0 0.25em;
}

.assign-help-summary-hint {
    font-weight: 400;
    color: var(--color-text-muted);
    font-size: 12px;
}

.assign-help-list {
    margin: 10px 0 0;
    padding-left: 1.2em;
}

.assign-help-list li {
    margin-bottom: 8px;
}

.assign-help-list li:last-child {
    margin-bottom: 0;
}

/* Hozzárendelés modal — cím + fix láb, középen együtt görget az ügyfelek + projektek */
.modal-box-assign-layout {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 48px);
    padding: 0;
    overflow: hidden;
}

.modal-box-assign-layout > h3 {
    flex: 0 0 auto;
    margin: 0;
    padding: 20px 24px 12px;
    font-size: 18px;
}

.modal-box-assign-layout > input[type="hidden"] {
    display: none;
}

.assign-modal-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 24px 12px;
    -webkit-overflow-scrolling: touch;
}

.modal-box-assign-layout .assign-modal-checklist.checkbox-list {
    max-height: none;
    overflow: visible;
    min-height: 0;
}

.modal-box-assign-layout .assign-modal-checklist.perm-groups {
    max-height: none;
    overflow: visible;
    min-height: 0;
}

.assign-modal-messages {
    flex: 0 0 auto;
    padding: 0 24px;
}

.assign-modal-messages .msg:last-child {
    margin-bottom: 0;
}

.assign-modal-footer.modal-actions {
    flex: 0 0 auto;
    margin-top: 0;
    padding: 12px 24px 20px;
    border-top: 1px solid var(--color-border);
    max-height: none;
    overflow: visible;
}

.assign-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.assign-project-group {
    margin-bottom: 12px;
}

.assign-project-group:last-child {
    margin-bottom: 0;
}

.checkbox-item-project {
    font-size: 13px;
}

/* ========== Jogosultság csoportok (modulonkénti) ========== */
.perm-groups {
    max-height: 400px;
    overflow-x: hidden;
    overflow-y: auto;
}

.perm-group {
    margin-bottom: 12px;
}

.perm-group:last-child {
    margin-bottom: 0;
}

.perm-group-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    padding: 4px 0;
    margin-bottom: 2px;
    border-bottom: 1px solid var(--color-border);
}

/* Szélesebb modal a jogosultságokhoz */
.modal-box-wide {
    max-width: 600px;
}

/* Hozzárendelés: két oszlop + sok név — extra széles */
.modal-box-wide.modal-box-assign {
    max-width: min(1020px, 96vw);
    width: 100%;
}

/* Nagyon széles modal (JSON import) — használja: modal-box modal-box-detail modal-box-xxl */
.modal-box-xxl.modal-box-detail {
    max-width: min(1280px, 98vw);
}

.modal-box-xxl .modal-scroll-body {
    padding: 24px 28px 12px;
}

.modal-box-xxl h3 {
    margin-bottom: 10px;
    font-size: 20px;
}

.task-json-desc {
    font-size: 14px;
    line-height: 1.55;
    margin-bottom: 16px;
}

.task-json-actions-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.task-json-input {
    width: 100%;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    line-height: 1.45;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    resize: vertical;
    min-height: 140px;
}

.task-json-buttons-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 16px;
}

.task-json-table-wrap {
    overflow-x: auto;
    margin-top: 4px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
}

.task-json-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.task-json-preview-table th,
.task-json-preview-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
    text-align: left;
}

.task-json-preview-table th {
    background: var(--color-bg);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--color-text-muted);
}

.task-json-preview-table tbody tr:last-child td {
    border-bottom: none;
}

.task-json-field {
    width: 100%;
    font-family: inherit;
    font-size: 13px;
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    resize: vertical;
}

.task-json-field-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 13px;
}

.task-json-row-bad {
    background: #fff7f7;
}

.task-json-status-bad {
    color: var(--color-danger);
    font-size: 12px;
    font-weight: 600;
}

.task-json-status-ok {
    color: var(--color-text-muted);
    font-size: 12px;
}

.task-json-empty-msg {
    padding: 24px;
    text-align: center;
}

.task-json-section-field {
    font-size: 12px;
}

/* Feladat lista — összefoglaló blokkok (kártya, elválasztás, összecsukás) */
.task-section-block {
    margin-bottom: 28px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.task-section-block.task-section-tail {
    border-left-color: #94a3b8;
}

.task-section-block:last-child {
    margin-bottom: 0;
}

.task-section-block.is-collapsed .task-section-body {
    display: none;
}

.task-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 12px 14px;
    margin-bottom: 0;
    padding: 14px 16px;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    border-bottom: 2px solid var(--color-border);
}

.task-section-collapse-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    margin-top: 2px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    color: var(--color-text-muted);
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.task-section-collapse-btn:hover {
    color: var(--color-primary);
    border-color: rgba(37, 99, 235, 0.35);
    background: #fff;
}

.task-section-head-main {
    flex: 1;
    min-width: 200px;
    cursor: pointer;
}

.task-section-head-main:hover .task-section-title {
    color: var(--color-primary);
}

.task-section-title {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    transition: color 0.15s ease;
}

.task-section-desc {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.task-section-head-actions {
    flex-shrink: 0;
    margin-left: auto;
    font-size: 13px;
    white-space: nowrap;
    align-self: center;
}

.task-section-body {
    padding: 16px;
    background: var(--color-surface);
}

.task-section-body .task-section-table {
    margin-top: 0;
}

/* Feladat táblázat — széles cím, meta a cím alatt */
.task-section-table {
    margin-top: 0;
    table-layout: fixed;
    width: 100%;
}

.task-section-table tbody tr:nth-child(odd) {
    background: var(--color-surface);
}

.task-section-table tbody tr:nth-child(even) {
    background: #f1f5f9;
}

.task-section-table tbody tr:hover {
    background: #e8eef5;
}

.task-section-table th.task-col-reorder,
.task-section-table td.task-col-reorder {
    width: 52px;
    text-align: center;
    vertical-align: top;
    padding-top: 12px;
}

.task-section-table th.task-col-title,
.task-section-table td.task-col-title {
    width: auto;
    min-width: 0;
    vertical-align: top;
}

.task-section-table th.task-col-assign-date,
.task-section-table td.task-col-assign-date {
    width: 122px;
    vertical-align: top;
    padding-top: 10px;
}

.task-section-table th.task-col-bugs,
.task-section-table td.task-col-bugs {
    width: 68px;
    text-align: center;
    vertical-align: top;
    padding-top: 12px;
}

.task-section-table th.task-col-actions,
.task-section-table td.task-col-actions {
    width: 132px;
    vertical-align: top;
    padding-top: 10px;
}

.task-th-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.25;
}

.task-th-stack .task-th-line {
    font-weight: 600;
}

.task-th-stack .task-th-sub {
    font-weight: 500;
    font-size: 11px;
}

.task-title-stack .task-title-main {
    margin-bottom: 8px;
    line-height: 1.35;
}

.task-section-table .task-title-main a {
    color: var(--color-text);
    text-decoration: none;
}

.task-section-table .task-title-main a:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.task-section-table .task-title-main a strong {
    font-weight: 700;
}

.task-title-stack .task-title-main a strong {
    font-size: 15px;
}

.task-title-meta {
    max-width: 100%;
}

.task-title-meta-inline {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    max-width: min(560px, 100%);
}

.task-title-meta-status {
    flex-shrink: 0;
}

.task-title-meta-section {
    flex: 1 1 200px;
    min-width: 0;
}

.task-title-meta-section .task-row-section-select {
    width: 100%;
    max-width: min(380px, 100%);
    min-width: 0;
}

.task-title-meta-section-readonly {
    font-size: 13px;
    line-height: 1.35;
}

.task-title-meta-status .badge {
    font-size: 12px;
}

.task-assign-date-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    font-size: 13px;
    line-height: 1.3;
}

.task-assign-date-stack .task-assign-name {
    font-weight: 600;
    color: var(--color-text);
}

.task-assign-date-stack .task-assign-date {
    font-size: 12px;
    color: var(--color-text-muted);
}

.task-reorder-cell {
    vertical-align: middle;
    white-space: nowrap;
    font-size: 15px;
    line-height: 1.2;
}

.task-reorder-btn {
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
}

.task-reorder-btn:hover {
    text-decoration: underline;
}

.task-reorder-muted {
    display: inline-block;
    min-width: 1em;
    color: var(--color-text-muted);
    opacity: 0.4;
    cursor: default;
    text-align: center;
}

.task-section-reorder .task-reorder-btn {
    font-weight: 700;
}

.task-json-target-section-wrap {
    margin-bottom: 12px;
}

.task-json-target-section-wrap select {
    max-width: min(520px, 100%);
}

.task-section-empty {
    margin: 4px 0 0;
    padding: 12px 14px;
    font-size: 14px;
    background: #f8fafc;
    border: 1px dashed var(--color-border);
    border-radius: 8px;
}

.task-inline-section-cell {
    vertical-align: middle;
}

.task-row-section-select {
    max-width: 100%;
    min-width: 160px;
}

.modal-box-compact {
    max-width: 540px;
    padding: 22px;
}

.modal-box-compact h3 {
    margin-bottom: 14px;
    font-size: 18px;
}

.modal-box-compact .form-group {
    margin-bottom: 12px;
}

.modal-box-compact .form-group label {
    margin-bottom: 5px;
    font-size: 12px;
}

.modal-box-compact .form-row {
    gap: 10px;
}

.modal-box-compact .form-group input,
.modal-box-compact .form-group select,
.modal-box-compact .form-group textarea {
    padding: 9px 12px;
    font-size: 14px;
}

.modal-box-compact .modal-actions {
    margin-top: 14px;
    padding-top: 14px;
}

.modal-box-compact .btn {
    padding: 9px 16px;
}

.paste-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    padding: 10px 12px;
    border: 1px dashed #94a3b8;
    border-radius: 12px;
    background: #f8fafc;
    color: var(--color-text-muted);
    text-align: center;
    font-size: 13px;
    cursor: text;
}

.paste-zone strong {
    color: var(--color-text);
    margin-right: 6px;
}

.paste-zone:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.paste-preview-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}

.paste-preview-image {
    display: block;
    width: 96px;
    height: 72px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--color-border);
    background: #fff;
}

.paste-zone-hint {
    margin-top: 6px;
    font-size: 12px;
}

/* ========== Szűrő ========== */
.filter-select {
    padding: 6px 12px;
    font-size: 13px;
    font-family: inherit;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--color-primary);
}

.filter-select-sm {
    padding: 3px 8px;
    font-size: 12px;
    margin-left: 8px;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========== Task badge státuszok ========== */
.badge-open {
    background: #dbeafe;
    color: #1e40af;
}

.badge-progress {
    background: #fef3c7;
    color: #92400e;
}

/* ========== Bug típus badge-ek ========== */
.badge-bug {
    background: #fef2f2;
    color: #991b1b;
}

.badge-question {
    background: #eff6ff;
    color: #1e40af;
}

/* ========== Prioritás badge-ek ========== */
.badge-prio-low {
    background: #f0fdf4;
    color: #166534;
}

.badge-prio-medium {
    background: #fefce8;
    color: #854d0e;
}

.badge-prio-high {
    background: #fff7ed;
    color: #c2410c;
}

.badge-prio-critical {
    background: #fef2f2;
    color: #991b1b;
    font-weight: 700;
}

/* ========== Form row (két mező egymás mellett) ========== */
.form-row {
    display: flex;
    gap: 12px;
}

.form-group-half {
    flex: 1;
}

/* ========== Bug detail modal — széles, kétoszlopos ========== */
.modal-box-detail {
    max-width: 960px;
    padding: 0;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 48px);
}

.modal-scroll-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 28px 28px 8px;
    min-height: 0;
}

.modal-fixed-footer {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 28px;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
    border-radius: 0 0 var(--radius) var(--radius);
}

.bug-detail-header {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.modal-box-detail h3 {
    font-size: 20px;
    margin-bottom: 16px;
    line-height: 1.3;
}

.bug-detail-columns {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    min-height: 0;
}

.bug-detail-col-left {
    min-width: 0;
}

.bug-detail-col-right {
    min-width: 0;
}

.bug-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}

.bug-detail-desc {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 16px;
}

/* Jobb oldali kontextus panel */
.bug-detail-context-panel {
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: #f8fafc;
    font-size: 13px;
}

.context-field {
    margin-bottom: 14px;
}

.context-field:last-child {
    margin-bottom: 0;
}

.context-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--color-text-muted);
    margin-bottom: 3px;
}

.context-value {
    display: block;
    font-size: 13px;
    word-break: break-word;
    color: var(--color-text);
}

.context-link {
    color: var(--color-primary);
    text-decoration: none;
}

.context-link:hover {
    text-decoration: underline;
}

.context-small {
    font-size: 12px;
    color: var(--color-text-muted);
}

.context-screenshot {
    margin-top: 4px;
}

.bug-shot-sidebar {
    display: block;
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.bug-shot-sidebar:hover {
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.bug-detail-sidebar-note {
    display: block;
    margin-top: 16px;
    font-size: 12px;
    line-height: 1.5;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.dashboard-download-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.dashboard-download-panel h3 {
    margin: 0 0 4px;
    font-size: 18px;
}

.dashboard-download-panel p {
    margin: 0;
}

.dashboard-download-actions {
    flex-shrink: 0;
}

.dashboard-card {
    display: block;
    padding: 18px 20px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: #ffffff;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.dashboard-card-label {
    display: block;
    margin-bottom: 8px;
    color: var(--color-text-muted);
    font-size: 13px;
}

.dashboard-card strong {
    font-size: 28px;
    line-height: 1.1;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.dashboard-panel-wide {
    grid-column: 1 / -1;
}

.dashboard-panel {
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: #ffffff;
    padding: 18px 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.dashboard-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.dashboard-panel-head h3 {
    margin: 0;
    font-size: 18px;
}

.panel-link {
    font-size: 13px;
}

.dashboard-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dashboard-item {
    display: block;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f8fafc;
    text-decoration: none;
    color: inherit;
}

.dashboard-item strong {
    display: block;
    margin-bottom: 4px;
}

.dashboard-item span {
    color: var(--color-text-muted);
    font-size: 13px;
}

.dashboard-item-status {
    display: inline-block;
    margin-top: 5px;
    color: #9a3412;
    font-size: 12px;
}

.dashboard-project-list {
    display: grid;
    gap: 12px;
}

.dashboard-project-item {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    background: #f8fafc;
}

.dashboard-project-main {
    min-width: 0;
}

.dashboard-project-title-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: baseline;
}

.dashboard-project-meta {
    color: var(--color-text-muted);
    font-size: 12px;
}

.dashboard-project-desc {
    margin-top: 6px;
    color: #4b5563;
    font-size: 13px;
}

.dashboard-project-url {
    margin-top: 8px;
    font-size: 13px;
    word-break: break-all;
}

.dashboard-project-stats {
    min-width: 150px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: right;
    color: #374151;
    font-size: 12px;
}

.dashboard-empty {
    padding: 14px;
    border-radius: 10px;
    background: #f8fafc;
    color: var(--color-text-muted);
}

.bug-detail-status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}

.bug-comments-box {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.bug-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.bug-comments-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 12px;
}

.bug-comments-head h4 {
    margin: 0;
    font-size: 16px;
}

.bug-comments-thread {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bug-comment-item {
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: #f8fafc;
}

.bug-comment-head {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    margin-bottom: 6px;
    color: var(--color-text-muted);
    font-size: 12px;
}

.bug-comment-body {
    font-size: 14px;
    line-height: 1.6;
}

.bug-comment-form {
    margin-top: 14px;
}

/* ========== Bug link a task táblában ========== */
.bug-link-cell {
    font-size: 13px;
    color: var(--color-primary);
    text-decoration: none;
}

.bug-link-cell:hover {
    text-decoration: underline;
}

/* ========== Task detail modal ========== */
.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}

.task-description {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 16px;
    white-space: pre-wrap;
}

.task-status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}

/* ========== Responsive ========== */
@media (max-width: 480px) {
    .login-box {
        padding: 24px;
    }
    #app-header {
        padding: 0 12px;
    }
    .container {
        padding: 16px;
    }

    .dashboard-download-panel {
        padding: 14px;
    }
}

@media (max-width: 900px) {
    .bug-detail-columns {
        grid-template-columns: 1fr;
    }

    .bug-detail-col-right {
        order: -1;
    }

    .modal-box-detail {
        max-width: 100%;
        margin: 12px;
    }

    .modal-scroll-body {
        padding: 20px 16px 8px;
    }

    .modal-fixed-footer {
        padding: 12px 16px;
    }
}

@media (max-width: 760px) {
    .dashboard-download-panel {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-download-actions {
        width: 100%;
    }

    .dashboard-download-actions .btn {
        width: 100%;
    }

    .dashboard-project-item {
        flex-direction: column;
    }

    .dashboard-project-stats {
        min-width: 0;
        text-align: left;
    }
}
