:root {
  --bg: #060a12;
  --surface: #0b1120;
  --surface-2: #111827;
  --surface-3: #1a2535;
  --border: rgba(255,255,255,0.08);
  --text: #e2e8f3;
  --text-2: #8892a4;
  --text-3: #4a5a72;
  --accent: #4f8ef7;
  --accent-2: #7cb4ff;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --radius: 10px;
  --radius-lg: 14px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

h1, h2, h3 { font-weight: 700; margin-bottom: 12px; }
h2 { font-size: 20px; }
h3 { font-size: 15px; color: var(--text-2); }

.hint { color: var(--text-2); font-size: 13px; margin-bottom: 12px; }
.hint code { background: var(--surface-3); padding: 2px 5px; border-radius: 4px; }

/* Auth screen */
.auth-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; width: 100%; max-width: 380px; }
.auth-logo { font-weight: 800; font-size: 18px; margin-bottom: 16px; color: var(--accent-2); }
.auth-title { margin-bottom: 20px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }

/* Layout */
.app-screen { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border);
  padding: 20px; display: flex; flex-direction: column; gap: 18px;
}
.sidebar-logo { font-weight: 800; font-size: 16px; color: var(--accent-2); }
.main { flex: 1; padding: 28px 32px; max-width: 900px; }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  text-align: left; background: none; border: none; color: var(--text-2); padding: 10px 12px;
  border-radius: var(--radius); cursor: pointer; font-size: 14px; font-family: var(--font);
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--surface-3); color: var(--accent-2); font-weight: 600; }

.account-select { display: flex; flex-direction: column; gap: 6px; }
.account-status { font-size: 12px; color: var(--warning); min-height: 14px; }

/* Forms */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-grid { display: flex; flex-direction: column; }
.form-grid-inline { flex-direction: row; gap: 8px; margin-bottom: 10px; }
.form-label { font-size: 12px; color: var(--text-2); font-weight: 600; }
.form-input {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  padding: 9px 12px; border-radius: var(--radius); font-size: 14px; font-family: var(--font); width: 100%;
}
.form-input:focus { outline: none; border-color: var(--accent); }
.form-error { color: var(--danger); font-size: 13px; margin-top: 8px; }

/* Buttons */
.btn {
  padding: 9px 16px; border-radius: var(--radius); border: none; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: var(--font);
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); }
.btn-secondary { background: var(--surface-3); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-2); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); }
.btn-danger { background: rgba(248,113,113,0.15); color: var(--danger); }
.btn-danger:hover { background: rgba(248,113,113,0.25); }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.w-full { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.file-btn { display: inline-block; cursor: pointer; margin-top: 8px; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 20px; }
.filter-card { padding: 14px 16px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* Comptes */
.accounts-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.account-card { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; }
.account-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-3); object-fit: cover; }
.account-info { flex: 1; min-width: 0; }
.account-name { font-weight: 600; }
.account-handle { color: var(--text-2); font-size: 13px; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 20px; margin-left: 6px; }
.badge-warn { background: rgba(251,191,36,0.15); color: var(--warning); }

/* Profile images */
.profile-images { position: relative; margin-bottom: 20px; }
.banner-wrap { position: relative; }
.profile-banner { width: 100%; height: 140px; object-fit: cover; border-radius: var(--radius); background: var(--surface-3); }
.avatar-wrap { position: relative; margin-top: -32px; margin-left: 16px; width: fit-content; }
.profile-avatar { width: 72px; height: 72px; border-radius: 50%; border: 3px solid var(--surface); object-fit: cover; background: var(--surface-3); }
.banner-wrap .file-btn, .avatar-wrap .file-btn { position: absolute; bottom: 6px; right: 6px; margin: 0; }

/* Item list (tweets/likes/retweets/bookmarks) */
.selection-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; color: var(--text-2); }
.item-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.item-row { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; }
.item-row:hover { border-color: var(--border-2, rgba(255,255,255,0.15)); }
.item-body { flex: 1; min-width: 0; }
.item-text { font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.item-meta { font-size: 11px; color: var(--text-3); margin-top: 4px; }

/* Job progress */
.job-panel { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.job-status { font-size: 13px; margin-bottom: 8px; }
.job-bar { height: 6px; background: var(--surface-3); border-radius: 4px; overflow: hidden; margin-bottom: 10px; }
.job-bar-fill { height: 100%; background: var(--accent); transition: width 0.3s; }
.job-actions { display: flex; gap: 8px; }

/* Toast */
.toast { position: fixed; top: 20px; right: 20px; padding: 12px 18px; border-radius: var(--radius); font-size: 13px; z-index: 100; box-shadow: 0 4px 16px rgba(0,0,0,0.4); }
.toast-ok { background: var(--success); color: #06281c; }
.toast-error { background: var(--danger); color: #2b0a0a; }
