:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --border: #333;
  --text: #e0e0e0;
  --muted: #888;
  --accent: #4285f4;
  --success: #4caf50;
  --error: #ff5252;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.5; }

.login-page { display: flex; align-items: center; justify-content: center; }
.login-box { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 48px 40px; text-align: center; width: 100%; max-width: 380px; }
.login-box h1 { font-size: 28px; font-weight: 600; margin-bottom: 6px; }
.login-box > p { color: var(--muted); margin-bottom: 28px; }
.login-box form { display: flex; flex-direction: column; gap: 12px; }
.login-box input { padding: 12px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 15px; width: 100%; }
.login-box input:focus { outline: none; border-color: var(--accent); }
.login-box button { padding: 12px; border-radius: 8px; border: none; background: var(--accent); color: #fff; font-size: 15px; font-weight: 500; cursor: pointer; }
.login-box button:hover { opacity: 0.88; }

.upload-page header { display: flex; align-items: center; gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--border); }
.upload-page header h1 { font-size: 18px; font-weight: 600; flex: 1; }
.upload-page #userLabel { color: var(--muted); font-size: 14px; }
.upload-page #signOutBtn { background: transparent; color: var(--muted); border: 1px solid var(--border); padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.upload-page #signOutBtn:hover { background: var(--surface); color: var(--text); }
.upload-page main { max-width: 820px; margin: 32px auto; padding: 0 20px; }

#projectForm { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
#projectForm input, #projectForm textarea { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 12px 14px; font-size: 14px; width: 100%; font-family: inherit; resize: vertical; }
#projectForm input:focus, #projectForm textarea:focus { outline: none; border-color: var(--accent); }

#dropzone { border: 2px dashed var(--border); border-radius: 12px; padding: 60px 20px; text-align: center; cursor: pointer; background: var(--surface); transition: 0.2s; }
#dropzone:hover, #dropzone.dragover { border-color: var(--accent); background: #1a1f2a; }
#dropzone p { color: var(--muted); }
.hint { color: var(--muted); font-size: 12px; margin-top: 4px; }

.upload-item { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; margin-top: 12px; }
.upload-item .name { font-weight: 500; margin-bottom: 8px; word-break: break-all; font-size: 14px; }
.progress-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); width: 0%; transition: width 0.2s; border-radius: 4px; }
.progress-fill.complete { background: var(--success); }
.stats { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; color: var(--muted); }
.stats .speed { color: var(--accent); font-variant-numeric: tabular-nums; }
.actions { display: flex; gap: 8px; margin-top: 10px; }
.actions button { background: var(--surface); color: var(--text); border: 1px solid var(--border); padding: 5px 12px; border-radius: 5px; cursor: pointer; font-size: 12px; }
.actions button:hover { background: #2a2a2a; }
.actions .restart-btn { color: var(--muted); border-color: transparent; }
.actions .cancel-btn { color: var(--error); border-color: transparent; }
.error-text { color: var(--error); font-size: 13px; margin-top: 8px; }
.success-text { color: var(--success); font-size: 13px; margin-top: 8px; }

#syncStatus { margin-top: 24px; }
.sync-bar { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; font-size: 14px; color: var(--muted); }
.sync-icon { font-size: 18px; animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

#historyBtn { background: var(--surface); color: var(--text); border: 1px solid var(--border); padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; margin-right: 8px; }
#historyBtn:hover { background: #2a2a2a; }
#historyBtn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

#historyPanel { margin-top: 32px; }
#historyPanel h2 { font-size: 16px; font-weight: 500; margin-bottom: 12px; }
#historyTable { width: 100%; border-collapse: collapse; font-size: 13px; }
#historyTable th { text-align: left; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--border); }
#historyTable td { padding: 8px 10px; border-bottom: 1px solid var(--border); word-break: break-all; }
#historyTable tr:hover td { background: var(--surface); }
#historyTable .status-uploading { color: var(--accent); }
#historyTable .status-complete { color: var(--success); }
#historyTable .status-error { color: var(--error); }
#historyEmpty { color: var(--muted); font-size: 14px; }
