* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f6f8;
    color: #222;
}

header {
    background: #1f2937;
    color: white;
    padding: 18px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

header h1 {
    margin: 0;
    font-size: 22px;
}

header h1 a {
    color: inherit;
    text-decoration: none;
}

.user-badge {
    font-size: 13px;
    color: #cbd5e1;
}

main {
    max-width: 1250px;
    margin: 30px auto;
    padding: 0 20px;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 22px;
}

.card h2 {
    margin-top: 0;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.button {
    display: inline-block;
    background: #2563eb;
    color: white;
    padding: 10px 18px;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
}

.button:hover {
    background: #1d4ed8;
}

.button.secondary {
    background: #e5e7eb;
    color: #374151;
}

.button.secondary:hover {
    background: #d1d5db;
}

/* ---------- Forms ---------- */

.field {
    margin-bottom: 18px;
}

.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: bold;
}

.field input[type="text"],
.field input[type="file"],
.field select,
.field textarea {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    font-family: inherit;
    font-size: 14px;
    background: white;
}

.field textarea {
    min-height: 90px;
    resize: vertical;
}

.row {
    display: flex;
    gap: 20px;
}

.row > .field {
    flex: 1;
}

.buttons {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.cancel {
    color: #6b7280;
    text-decoration: none;
    font-size: 14px;
}

.cancel:hover {
    text-decoration: underline;
}

.hint {
    font-size: 12px;
    color: #6b7280;
    margin-top: 5px;
}

.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 12px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
}

.error ul {
    margin: 6px 0 0;
    padding-left: 20px;
}

/* ---------- Status tabs ---------- */

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tab {
    padding: 8px 16px;
    border-radius: 20px;
    background: #e5e7eb;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
}

.tab:hover {
    background: #d1d5db;
}

.tab.active {
    background: #1f2937;
    color: white;
}

.tab .count {
    opacity: 0.75;
    margin-left: 4px;
}

/* ---------- Filter bar ---------- */

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.filters .field {
    margin-bottom: 0;
    min-width: 165px;
}

.filters .field.grow {
    flex: 1;
    min-width: 220px;
}

/* ---------- Table ---------- */

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th,
td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

th {
    background: #f9fafb;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #6b7280;
}

tbody tr:hover {
    background: #f9fafb;
}

td a {
    color: #2563eb;
    text-decoration: none;
}

td a:hover {
    text-decoration: underline;
}

.muted {
    color: #9ca3af;
}

.nowrap {
    white-space: nowrap;
}

.empty {
    text-align: center;
    color: #6b7280;
    padding: 40px 0;
}

/* ---------- Status badges ---------- */

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

.badge.status-open {
    background: #dbeafe;
    color: #1e40af;
}

.badge.status-in-progress {
    background: #fef3c7;
    color: #92400e;
}

.badge.status-fixed {
    background: #dcfce7;
    color: #166534;
}

.badge.status-rejected {
    background: #f3f4f6;
    color: #4b5563;
}

/* ---------- Detail view ---------- */

.detail-grid {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 10px 20px;
    font-size: 14px;
}

.detail-grid dt {
    font-weight: bold;
    color: #6b7280;
}

.detail-grid dd {
    margin: 0;
    white-space: pre-wrap;
}

.screenshot {
    max-width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 5px;
    margin-top: 10px;
}

@media (max-width: 760px) {
    .row,
    .filters {
        flex-direction: column;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }
}
