@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

* { box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { margin: 0; background: #faf9fb; color: #16151a; }
a { color: #7c3aed; text-decoration: none; }
a:hover { color: #6d28d9; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d8d5e0; border-radius: 4px; }

.heading { font-family: 'Space Grotesk', sans-serif; font-weight: 700; }
.muted { color: #6b6873; }

.app-shell { display: flex; width: 100vw; height: 100vh; overflow: hidden; }
.sidebar { width: 240px; flex-shrink: 0; background: #16151a; color: #fff; display: flex; flex-direction: column; padding: 20px 14px; overflow-y: auto; }
.sidebar-brand { padding: 6px 10px 18px; }
.sidebar-brand .name { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
.sidebar-brand .tag { font-size: 11px; color: #8a8794; margin-top: 2px; }

.persona-switch { display: flex; flex-direction: column; gap: 4px; padding: 0 4px 16px; border-bottom: 1px solid #2a2833; margin-bottom: 14px; }
.section-label { font-size: 11px; color: #726f7c; text-transform: uppercase; letter-spacing: .05em; padding: 0 10px 6px; }
.nav-item, .persona-item { display: flex; align-items: center; padding: 10px 14px; border-radius: 8px; font-weight: 500; font-size: 14px; cursor: pointer; margin-bottom: 2px; color: #b8b5c2; }
.persona-item { padding: 9px 10px; font-size: 13px; }
.nav-item.active, .persona-item.active { background: rgba(124,58,237,0.28); color: #fff; font-weight: 600; }
.persona-item.active { background: #fff; color: #16151a; }
.nav-item:hover, .persona-item:hover { color: #fff; }

.sidebar-footer { margin-top: auto; padding: 12px 10px; border-top: 1px solid #2a2833; font-size: 11px; color: #726f7c; line-height: 1.5; }

.main-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 64px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid #e8e6ec; background: #fff; }
.topbar .title { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 17px; }
.topbar .subtitle { font-size: 12px; color: #6b6873; }
.topbar-right { display: flex; align-items: center; gap: 14px; position: relative; }
.plan-pill { font-size: 12px; background: #f1f0f4; color: #6b6873; border-radius: 999px; padding: 5px 12px; font-weight: 600; }
.bell { width: 36px; height: 36px; border-radius: 999px; cursor: pointer; display: flex; align-items: center; justify-content: center; background: #f1f0f4; font-size: 15px; border: none; }
.notif-panel { position: absolute; top: 46px; right: 0; width: 300px; background: #fff; border: 1px solid #e8e6ec; border-radius: 12px; box-shadow: 0 12px 32px rgba(20,16,30,0.14); padding: 8px; z-index: 20; }
.notif-panel .item { padding: 10px 12px; border-radius: 8px; font-size: 13px; }
.avatar { width: 32px; height: 32px; border-radius: 999px; background: #7c3aed; color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

main.content { flex: 1; overflow: auto; padding: 28px 32px 60px; }

.row-between { display: flex; justify-content: space-between; align-items: center; }
.page-title { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 24px; }

.btn { display: inline-block; border: none; border-radius: 8px; padding: 10px 18px; font-weight: 600; font-size: 14px; cursor: pointer; }
.btn-accent { color: #fff; background: var(--accent, #7c3aed); }
.btn-ghost { background: #fff; color: #16151a; border: 1px solid #d8d5e0; }
.btn-danger { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.btn:disabled { background: #d8d5e0; cursor: not-allowed; }

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.card { background: #fff; border: 1px solid #e8e6ec; border-radius: 12px; padding: 18px; }
.card-lg { border-radius: 14px; padding: 24px; }
.stat-label { font-size: 12px; color: #6b6873; margin-bottom: 6px; }
.stat-value { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 26px; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: #6b6873; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; padding: 12px 16px; border-bottom: 1px solid #e8e6ec; }
td { padding: 13px 16px; font-size: 14px; border-bottom: 1px solid #f1f0f4; }
tr.clickable { cursor: pointer; }
tr.selected { background: #faf7ff; }

.badge { border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; }
.badge-active { background: #dcfce7; color: #16a34a; }
.badge-neutral { background: #f1f0f4; color: #6b6873; }
.badge-warn { background: #fef3c7; color: #d97706; }
.badge-danger { background: #fef2f2; color: #dc2626; }

.progress { height: 8px; background: #f1f0f4; border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent, #7c3aed); border-radius: 999px; }
.progress-thin { height: 6px; }
.progress-thick { height: 10px; }

.field-label { font-size: 12px; color: #6b6873; margin-bottom: 4px; }
.field, input[type=text], input[type=email], input[type=password] { border: 1px solid #d8d5e0; border-radius: 8px; padding: 9px 12px; font-size: 14px; width: 100%; background: #fff; color: #16151a; }
.field-box { border: 1px solid #d8d5e0; border-radius: 8px; padding: 9px 12px; font-size: 14px; }

.option-card { background: #fff; border-radius: 14px; padding: 22px; cursor: pointer; border: 2px solid #e8e6ec; }
.option-card.selected { border-color: var(--accent, #7c3aed); }
.option-card h4 { font-weight: 700; font-size: 16px; margin: 0 0 6px; }
.option-card p { font-size: 13px; color: #6b6873; margin: 0; }

.center-card { max-width: 420px; margin: 40px auto; background: #fff; border: 1px solid #e8e6ec; border-radius: 16px; padding: 36px; text-align: center; }
.vote-page { max-width: 640px; margin: 20px auto; }
.vote-page.narrow { max-width: 560px; }
.vote-page.wide { max-width: 720px; }

.vote-option { display: flex; align-items: center; gap: 12px; border-radius: 10px; padding: 14px 16px; font-size: 14px; font-weight: 600; cursor: pointer; background: #fff; border: 1px solid #e8e6ec; }
.vote-option.selected { border-color: var(--accent, #7c3aed); background: rgba(124,58,237,0.08); }
.radio-dot { width: 16px; height: 16px; border-radius: 999px; display: inline-block; border: 2px solid #d8d5e0; }
.radio-dot.on { border-color: var(--accent, #7c3aed); background: var(--accent, #7c3aed); }

.visual-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.visual-option { border-radius: 12px; padding: 10px; cursor: pointer; background: #fff; border: 2px solid #e8e6ec; }
.visual-option.selected { border-color: var(--accent, #7c3aed); background: rgba(124,58,237,0.08); }
.image-placeholder { background: repeating-linear-gradient(45deg,#f1f0f4,#f1f0f4 8px,#e8e6ec 8px,#e8e6ec 16px); border-radius: 8px; height: 110px; display: flex; align-items: center; justify-content: center; font-size: 11px; color: #8a8794; font-family: monospace; text-align: center; padding: 6px; }
.check-label { text-align: center; font-size: 12px; font-weight: 700; margin-top: 8px; color: var(--accent, #7c3aed); display: none; }
.visual-option.selected .check-label { display: block; }

.candidate-card { border: 1px solid #e8e6ec; border-radius: 12px; overflow: hidden; background: #fff; }
.candidate-photo { height: 120px; background: linear-gradient(180deg,#bfe3f7,#eef8ff); position: relative; overflow: hidden; }
.candidate-body { padding: 12px 14px; }
.tier-row { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 3px 0; cursor: pointer; }
.tier-row.locked { cursor: not-allowed; color: #c7c4cf; }
.tier-box { width: 16px; height: 16px; border-radius: 4px; flex-shrink: 0; border: 2px solid #d8d5e0; }
.tier-box.checked { background: var(--accent, #7c3aed); border-color: var(--accent, #7c3aed); }
.tier-box.locked { border-color: #e8e6ec; }

.swatch { width: 34px; height: 34px; border-radius: 999px; cursor: pointer; border: 3px solid transparent; }
.swatch.selected { border-color: #16151a; }

.danger-zone { background: #fef2f2; border: 1px solid #fecaca; border-radius: 12px; padding: 20px; }
.toggle { width: 36px; height: 20px; border-radius: 999px; display: inline-block; position: relative; background: #e8e6ec; border: none; cursor: pointer; }
.toggle.on { background: var(--accent, #7c3aed); }
.toggle .knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #fff; border-radius: 999px; transition: left .12s; }
.toggle.on .knob { left: 18px; }

.dev-mail-panel { position: fixed; bottom: 12px; right: 12px; width: 360px; max-height: 200px; overflow-y: auto; background: #16151a; color: #d8d5e0; font-family: monospace; font-size: 11px; padding: 10px 12px; border-radius: 10px; z-index: 50; opacity: 0.92; }
.dev-mail-panel h5 { margin: 0 0 6px; color: #fff; font-family: 'Inter', sans-serif; font-size: 12px; }

.flash-ok { font-size: 13px; color: #16a34a; font-weight: 600; }
.flash-error { font-size: 13px; color: #dc2626; font-weight: 600; margin: 10px 0; }
