/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f5f6f8; color: #1a1a2e; line-height: 1.6; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Navbar */
.navbar { background: #1a1a2e; color: #fff; padding: 0 1.5rem; display: flex; align-items: center; justify-content: space-between; height: 56px; }
.nav-brand a { color: #fff; font-weight: 700; font-size: 1.2rem; }
.nav-brand a:hover { text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 1rem; }
.nav-links a { color: #ccc; }
.nav-links a:hover { color: #fff; }
.nav-user { color: #8b8fa3; }

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }
main { min-height: calc(100vh - 56px); }

/* Cards */
.card { background: #fff; border-radius: 8px; padding: 1.25rem; margin-bottom: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.test-card h2 { margin-bottom: .75rem; }
.test-card h2 a { color: #1a1a2e; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-bottom: 1rem; }
.stat { text-align: center; padding: .5rem; background: #f8f9fa; border-radius: 6px; }
.stat-value { display: block; font-size: 1.5rem; font-weight: 700; color: #1a1a2e; }
.stat-label { font-size: .75rem; color: #6b7280; text-transform: uppercase; letter-spacing: .5px; }

/* Test Cards Grid */
.test-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 1rem; margin-bottom: 2rem; }

/* Card Actions */
.card-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Buttons */
.btn { display: inline-block; padding: .5rem 1rem; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; color: #374151; cursor: pointer; font-size: .875rem; transition: all .15s; }
.btn:hover { background: #f3f4f6; text-decoration: none; }
.btn-sm { padding: .25rem .75rem; font-size: .8rem; }
.btn-primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.btn-primary:hover { background: #1d4ed8; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn.active { background: #1a1a2e; color: #fff; border-color: #1a1a2e; }

/* Badges */
.badge { display: inline-block; padding: .15rem .5rem; border-radius: 4px; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.badge-open { background: #e5e7eb; color: #374151; }
.badge-tosolve { background: #fef3c7; color: #92400e; }
.badge-solved { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 2px solid #e5e7eb; margin-bottom: 1.5rem; }
.tab { padding: .75rem 1.25rem; color: #6b7280; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab:hover { color: #1a1a2e; text-decoration: none; }
.tab.active { color: #2563eb; border-bottom-color: #2563eb; }

/* Status Bar */
.status-bar { display: flex; gap: .5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }

/* Items List */
.item-card { display: flex; flex-direction: column; gap: .5rem; }
.item-header { display: flex; align-items: center; gap: .75rem; }
.item-meta { display: flex; gap: 1rem; font-size: .85rem; color: #6b7280; flex-wrap: wrap; }

/* Severity */
.severity { font-weight: 600; }
.severity-major { color: #dc2626; }
.severity-minor { color: #f59e0b; }
.severity-cosmetic { color: #6b7280; }

/* Item Detail */
.item-detail-layout { display: grid; grid-template-columns: 1fr 340px; gap: 1.5rem; align-items: start; }
@media (max-width: 768px) { .item-detail-layout { grid-template-columns: 1fr; } }

.item-content h1 { font-size: 1.5rem; margin-bottom: 1rem; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.markdown-body { line-height: 1.7; }
.markdown-body ul, .markdown-body ol { padding-left: 1.5rem; margin: .5rem 0; }
.markdown-body li { margin: .25rem 0; }
.markdown-body strong { color: #1a1a2e; }
.markdown-body code { background: #f3f4f6; padding: .15rem .4rem; border-radius: 3px; font-size: .9em; }
.markdown-body img { max-width: 100%; border-radius: 6px; }

/* Triage Card */
.triage-card { position: sticky; top: 1rem; }
.triage-card h3 { margin-bottom: 1rem; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: .25rem; font-size: .875rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: .5rem; border: 1px solid #d1d5db; border-radius: 6px; font-size: .875rem; font-family: inherit;
}
.form-group textarea { resize: vertical; }

/* Alerts */
.alert { padding: .75rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: .875rem; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th, .table td { padding: .5rem .75rem; text-align: left; border-bottom: 1px solid #e5e7eb; }
.table th { font-weight: 600; color: #6b7280; font-size: .8rem; text-transform: uppercase; letter-spacing: .3px; }
.table tr:hover { background: #f9fafb; }

/* Breadcrumb */
.breadcrumb { font-size: .875rem; color: #6b7280; margin-bottom: 1rem; }

/* Detail Lists */
dl { display: grid; grid-template-columns: auto 1fr; gap: .25rem .75rem; }
dt { font-weight: 600; font-size: .85rem; color: #6b7280; }
dd { font-size: .85rem; }

/* Meta */
.meta { font-size: .85rem; color: #6b7280; }
.empty { color: #9ca3af; font-style: italic; padding: 2rem 0; text-align: center; }

/* Screenshot Gallery */
.screenshot-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.screenshot-thumb { cursor: pointer; border-radius: 8px; overflow: hidden; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08); transition: transform .15s; }
.screenshot-thumb:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.screenshot-thumb img { width: 100%; height: 150px; object-fit: cover; }
.screenshot-name { display: block; padding: .5rem; font-size: .75rem; color: #6b7280; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Lightbox */
.lightbox { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,.9); z-index: 1000; align-items: center; justify-content: center; cursor: pointer; }
.lightbox.active { display: flex; }
.lightbox-content { max-width: 95vw; max-height: 95vh; text-align: center; }
.lightbox-content img { max-width: 100%; max-height: 90vh; border-radius: 4px; }
.lightbox-content p { color: #ccc; margin-top: .5rem; font-size: .9rem; }

/* Prompt Layout */
.prompt-layout { display: grid; grid-template-columns: 1fr 340px; gap: 1.5rem; align-items: start; }
@media (max-width: 768px) { .prompt-layout { grid-template-columns: 1fr; } }
.prompt-content { overflow: auto; }

/* Prompt Hint */
.prompt-hint { background: #fffbeb; border-left: 3px solid #f59e0b; padding: .75rem 1rem; margin: .5rem 0; font-size: .875rem; border-radius: 0 6px 6px 0; }
.prompt-hint-item { margin-bottom: 1rem; }
.prompt-hint-item h4 { font-size: .85rem; margin-bottom: .25rem; }

/* Verification */
.verification-card { display: flex; flex-direction: column; gap: .75rem; }
.verification-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.inline-form { display: flex; gap: .5rem; align-items: center; }
.inline-form input[type="text"] { padding: .25rem .5rem; border: 1px solid #d1d5db; border-radius: 4px; font-size: .8rem; min-width: 200px; }

/* Login */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #1a1a2e; }
.login-container { background: #fff; padding: 2.5rem; border-radius: 12px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-container h1 { text-align: center; color: #1a1a2e; margin-bottom: .25rem; }
.login-container .subtitle { text-align: center; color: #6b7280; margin-bottom: 1.5rem; }

/* Runs List */
.runs-list { display: grid; gap: 1rem; }
