:root {
    --bg: #1a1a2e;
    --surface: #16213e;
    --surface2: #0f3460;
    --accent: #e94560;
    --ok: #4caf50;
    --gen: #ff9800;
    --text: #e0e0e0;
    --text2: #9e9e9e;
    --border: #2a2a4a;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

header {
    background: var(--surface);
    border-bottom: 2px solid var(--accent);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
header h1 { font-size: 1.4rem; flex: 1; }
.back { color: var(--text2); text-decoration: none; font-size: .9rem; }
.back:hover { color: var(--text); }

.global-progress { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--text2); }
.progress-bar { width: 160px; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--ok); border-radius: 4px; transition: width .3s; }

main { padding: 24px; max-width: 1200px; margin: 0 auto; }

/* Dashboard table */
.category-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.category-table th, .category-table td {
    padding: 12px 16px; text-align: left;
    border-bottom: 1px solid var(--border);
}
.category-table th { color: var(--text2); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.category-table tr:hover td { background: var(--surface); }
.ok  { color: var(--ok); font-weight: 600; }
.gen { color: var(--gen); font-weight: 600; }
.pend { color: var(--text2); }

/* Asset grid */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.asset-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.asset-card.status-approved { border-color: var(--ok); }
.asset-card.status-generated { border-color: var(--gen); }
.asset-thumb { height: 80px; display: flex; align-items: center; justify-content: center; background: #111; border-radius: 4px; overflow: hidden; }
.asset-thumb img { max-height: 76px; max-width: 100%; image-rendering: pixelated; }
.no-img { color: var(--text2); font-size: .75rem; }
.asset-info { display: flex; flex-direction: column; gap: 2px; }
.asset-info strong { font-size: .9rem; }
.asset-info code { font-size: .75rem; color: var(--text2); }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: .75rem; font-weight: 600; }
.badge-pending  { background: #333; color: var(--text2); }
.badge-generated { background: #3d2800; color: var(--gen); }
.badge-approved  { background: #1b3a1b; color: var(--ok); }
.badge-rejected  { background: #3a1b1b; color: var(--accent); }

/* Buttons */
.btn {
    display: inline-block; padding: 8px 16px; border-radius: 6px;
    background: var(--surface2); color: var(--text);
    text-decoration: none; border: none; cursor: pointer;
    font-size: .9rem; text-align: center;
    transition: opacity .2s;
}
.btn:hover { opacity: .8; }
.btn-copy { padding: 4px 10px; font-size: .8rem; background: var(--surface2); }
.btn-ok { background: #1b3a1b; color: var(--ok); }
.btn-ko { background: #3a1b1b; color: var(--accent); }

/* Asset detail */
.asset-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.asset-detail section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
}
.asset-detail h2 { font-size: 1rem; margin-bottom: 12px; color: var(--text2); display: flex; align-items: center; justify-content: space-between; }
.prompt-section { grid-column: 1 / -1; }
pre#prompt-text {
    background: #111;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 16px;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'Consolas', monospace;
    font-size: .88rem;
    line-height: 1.6;
    color: #c5d8a4;
    max-height: 300px;
    overflow-y: auto;
    user-select: all;
}
.meta { font-size: .82rem; color: var(--text2); margin-top: 8px; }
.notes { font-size: .85rem; color: var(--text2); margin-top: 8px; }
.preview { max-width: 100%; max-height: 200px; image-rendering: pixelated; border-radius: 4px; display: block; margin: 0 auto; }
.no-preview { height: 120px; display: flex; align-items: center; justify-content: center; color: var(--text2); font-size: .9rem; }
.upload-section form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.upload-section input[type=file] { color: var(--text); font-size: .9rem; }
.actions-section { display: flex; gap: 12px; flex-direction: column; }
.actions-section .btn { width: 100%; text-align: center; padding: 12px; }
.msg { background: var(--surface2); padding: 10px 24px; font-size: .9rem; }

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