*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f0f2f5; color: #1a1a2e; line-height: 1.5; }
.app { display: grid; grid-template-columns: 280px 1fr; grid-template-rows: auto 1fr; min-height: 100vh; max-width: 1400px; margin: 0 auto; }
header { grid-column: 1 / -1; background: #1a1a2e; color: #fff; padding: 16px 24px; }
header h1 { font-size: 1.3rem; }
header p { font-size: 0.85rem; opacity: 0.7; margin-top: 2px; }
.sidebar { background: #fff; border-right: 1px solid #e0e0e0; padding: 16px; overflow-y: auto; }
.sidebar .section { margin-bottom: 20px; }
.sidebar h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; color: #666; margin-bottom: 10px; }
.sidebar label { display: block; font-size: 0.8rem; color: #555; margin-top: 8px; margin-bottom: 3px; }
.sidebar select, .sidebar input { width: 100%; padding: 6px 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 0.85rem; }
.sidebar details { margin-top: 8px; }
.sidebar details summary { cursor: pointer; font-size: 0.85rem; padding: 4px 0; color: #555; }
.sidebar .btn { display: block; text-align: center; text-decoration: none; }
.main { padding: 20px; overflow-y: auto; }
.tabs { display: flex; gap: 2px; margin-bottom: 16px; }
.tab { padding: 8px 18px; border: none; background: #dde; border-radius: 6px 6px 0 0; cursor: pointer; font-size: 0.85rem; color: #555; }
.tab.active { background: #fff; color: #1a1a2e; font-weight: 600; box-shadow: 0 -1px 3px rgba(0,0,0,0.05); }
.tab-content { display: none; }
.tab-content.active { display: block; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.col { background: #fff; padding: 16px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.col h3 { font-size: 0.95rem; margin-bottom: 8px; }
.col p { font-size: 0.85rem; color: #666; margin-bottom: 10px; }
.col label { display: block; font-size: 0.8rem; color: #555; margin-top: 8px; margin-bottom: 3px; }
.col select { width: 100%; padding: 6px 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 0.85rem; }
input[type="file"] { display: block; margin: 8px 0; font-size: 0.85rem; }
.btn { display: inline-block; padding: 8px 16px; border: none; border-radius: 5px; cursor: pointer; font-size: 0.85rem; font-weight: 500; }
.btn-primary { background: #4361ee; color: #fff; }
.btn-primary:hover { background: #3a56d4; }
.btn-secondary { background: #e0e0e0; color: #333; }
.btn-secondary:hover { background: #d0d0d0; }
.btn-danger { background: #e63946; color: #fff; }
.btn-danger:hover { background: #c1121f; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.hidden { display: none !important; }
.table-wrap { max-height: 200px; overflow: auto; margin-top: 8px; border: 1px solid #eee; border-radius: 4px; }
table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
th, td { padding: 4px 8px; text-align: left; border-bottom: 1px solid #eee; white-space: nowrap; }
th { background: #f5f5f5; font-weight: 600; position: sticky; top: 0; }
.metrics { display: flex; gap: 12px; margin-bottom: 14px; }
.metric { background: #fff; padding: 12px 20px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); text-align: center; flex: 1; }
.metric-value { display: block; font-size: 1.6rem; font-weight: 700; color: #1a1a2e; }
.metric { font-size: 0.75rem; color: #666; }
.progress-bar { height: 10px; background: #e0e0e0; border-radius: 5px; overflow: hidden; margin-bottom: 6px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #4361ee, #7209b7); transition: width 0.3s; width: 0%; }
.progress-text { font-size: 0.8rem; color: #666; margin-bottom: 12px; }
.queue-actions { display: flex; gap: 8px; margin-bottom: 12px; }
details { background: #fff; padding: 12px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); margin-top: 10px; }
details summary { cursor: pointer; font-weight: 500; font-size: 0.85rem; }
#queueList { margin-top: 8px; font-size: 0.82rem; max-height: 300px; overflow-y: auto; }
.queue-item { padding: 3px 0; border-bottom: 1px solid #f0f0f0; }
.queue-item .status { margin-right: 6px; }
.queue-item.failed { color: #e63946; }
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 12px 0; }
.image-card { background: #fff; border-radius: 6px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.image-card img { width: 100%; height: 200px; object-fit: cover; display: block; }
.image-card .caption { padding: 6px 8px; font-size: 0.72rem; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#queueStatus { padding: 8px 12px; border-radius: 4px; margin-bottom: 8px; font-size: 0.85rem; }
#queueStatus.info { background: #dbeafe; color: #1e40af; }
#queueStatus.success { background: #dcfce7; color: #166534; }
#queueStatus.error { background: #fee2e2; color: #991b1b; }
@media (max-width: 800px) { .app { grid-template-columns: 1fr; } .sidebar { border-right: none; border-bottom: 1px solid #e0e0e0; } .two-col { grid-template-columns: 1fr; } }
