/* ============================================================================
   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;
}

.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: none; }

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

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

.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;
    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-y: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 8px;
}

.checkbox-item {
    display: block;
    padding: 6px 8px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
}

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

.checkbox-item input {
    margin-right: 8px;
}

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