:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --border: #e3e6eb;
  --border-strong: #cfd4dc;
  --text: #15181e;
  --text-2: #5b6372;
  --text-3: #8b93a1;
  --accent: #0b72f0;
  --accent-hover: #0960cc;
  --accent-soft: #e8f2ff;
  --success: #12a150;
  --success-soft: #e6f6ec;
  --warning: #c27803;
  --warning-soft: #fdf3e1;
  --danger: #d93a3a;
  --danger-soft: #fdecec;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 8px 24px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 24px 64px rgba(16, 24, 40, 0.18);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
button, input, textarea, select { font: inherit; color: inherit; }
svg { flex-shrink: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface);
  font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background .15s, border-color .15s, box-shadow .15s, color .15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-3); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #0e8a44; border-color: #0e8a44; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: rgba(16, 24, 40, .06); border-color: transparent; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-icon { width: 38px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.input, .textarea, .select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
.textarea { resize: vertical; min-height: 96px; }
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(11, 114, 240, .18);
}
.hint { font-size: 12px; color: var(--text-3); }
.error-msg { color: var(--danger); font-size: 13px; min-height: 18px; }

/* Status pill */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-review { background: var(--accent-soft); color: var(--accent); }
.pill-changes { background: var(--warning-soft); color: var(--warning); }
.pill-approved { background: var(--success-soft); color: var(--success); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 18, 25, .45); backdrop-filter: blur(2px);
  display: none; align-items: center; justify-content: center; padding: 16px; z-index: 100;
}
.modal-backdrop.open { display: flex; animation: fade .15s ease-out; }
.modal {
  width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow: auto;
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 24px;
  animation: pop .18s ease-out;
}
.modal h2 { font-size: 18px; margin-bottom: 6px; }
.modal p.sub { margin: 0 0 18px; color: var(--text-2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* Dropzone */
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 22px 16px;
  text-align: center; color: var(--text-2); cursor: pointer; background: var(--surface-2);
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone strong { color: var(--text); display: block; margin-bottom: 2px; }
.dropzone .file-name { margin-top: 8px; font-weight: 500; color: var(--accent); word-break: break-all; }
.dropzone input { display: none; }

/* Toast */
.toast-wrap { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #15181e; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-lg);
  font-weight: 500; animation: pop .18s ease-out; max-width: calc(100vw - 32px);
}
.toast.error { background: var(--danger); }

.muted { color: var(--text-2); }
.empty { text-align: center; padding: 48px 16px; color: var(--text-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
