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

:root {
  --bg: #0a0a14;
  --sidebar-bg: #0f0f1a;
  --sidebar-hover: #1a1a2e;
  --main-bg: #13131f;
  --card-bg: #1a1a2e;
  --card-border: rgba(233, 69, 96, 0.12);
  --accent: #e94560;
  --accent-soft: rgba(233, 69, 96, 0.15);
  --accent-glow: rgba(233, 69, 96, 0.08);
  --green: #00d68f;
  --green-soft: rgba(0, 214, 143, 0.12);
  --amber: #f0a500;
  --amber-soft: rgba(240, 165, 0, 0.12);
  --blue: #4d9de0;
  --blue-soft: rgba(77,157,224,0.15);
  --red-soft: rgba(233,69,96,0.12);
  --text-primary: #f0edf8;
  --text-secondary: #8b879e;
  --text-muted: #4a4760;
  --border: rgba(255,255,255,0.06);
  --input-bg: rgba(255,255,255,0.04);
}

body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text-primary); font-size: 14px; }

/* ════════ LOGIN ════════ */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }

.bg-glow { position: fixed; border-radius: 50%; pointer-events: none; filter: blur(80px); opacity: 0.35; }
.bg-glow-1 { width: 500px; height: 500px; background: radial-gradient(circle, #e94560, transparent); top: -150px; left: -150px; animation: float1 8s ease-in-out infinite; }
.bg-glow-2 { width: 400px; height: 400px; background: radial-gradient(circle, #4d9de0, transparent); bottom: -100px; right: -100px; animation: float2 10s ease-in-out infinite; }
@keyframes float1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(30px,40px) scale(1.1); } }
@keyframes float2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-20px,-30px) scale(1.05); } }
.bg-dots { position: fixed; inset: 0; background-image: radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px); background-size: 32px 32px; pointer-events: none; }

.login-wrapper { position: relative; z-index: 10; width: 100%; max-width: 420px; padding: 20px; animation: slideUp 0.6s cubic-bezier(0.16,1,0.3,1) both; }
@keyframes slideUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

.logo-area { text-align: center; margin-bottom: 32px; }
.logo-icon-lg { width: 56px; height: 56px; background: linear-gradient(135deg, var(--accent), #b02040); border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 24px; margin: 0 auto 14px; box-shadow: 0 8px 32px rgba(233,69,96,0.4); }
.logo-title { font-family: 'DM Serif Display', serif; font-size: 26px; letter-spacing: -0.02em; margin-bottom: 4px; }
.logo-subtitle { font-size: 12px; color: var(--text-muted); letter-spacing: 0.1em; text-transform: uppercase; font-weight: 500; }

.login-card { background: var(--main-bg); border: 1px solid var(--card-border); border-radius: 20px; padding: 32px; box-shadow: 0 24px 80px rgba(0,0,0,0.5); }
.card-header { margin-bottom: 24px; }
.card-title { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.card-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

.members-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 20px; }
.member-chip { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: all 0.15s; }
.member-chip:hover { background: rgba(255,255,255,0.06); }
.member-chip.selected { background: var(--accent-soft); border-color: rgba(233,69,96,0.3); }
.member-chip.selected .chip-name { color: var(--accent); }
.member-chip .chip-status { margin-left: auto; font-size: 9px; }

.chip-avatar { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; color: white; }
.avatar-j { background: linear-gradient(135deg, #e94560, #b02040); }
.avatar-r { background: linear-gradient(135deg, #4d9de0, #2a6fa8); }
.avatar-f { background: linear-gradient(135deg, #00b894, #007055); }
.avatar-g { background: linear-gradient(135deg, #f0a500, #c47d00); }

.chip-name { font-size: 13px; font-weight: 500; }
.chip-role { font-size: 10px; color: var(--text-muted); }

.divider { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.divider-line { flex: 1; height: 1px; background: var(--border); }
.divider-text { font-size: 11px; color: var(--text-muted); }

.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 7px; }
.form-input { width: 100%; padding: 11px 14px; background: var(--input-bg); border: 1px solid var(--border); border-radius: 10px; color: var(--text-primary); font-size: 14px; font-family: 'DM Sans', sans-serif; outline: none; transition: all 0.2s; }
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus { border-color: rgba(233,69,96,0.4); box-shadow: 0 0 0 3px rgba(233,69,96,0.08); }
textarea.form-input { resize: vertical; }

.input-wrapper { position: relative; }
.input-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); cursor: pointer; user-select: none; }

.login-error { background: var(--red-soft); border: 1px solid rgba(233,69,96,0.3); color: #ff8fa3; padding: 10px 14px; border-radius: 10px; font-size: 12px; margin-bottom: 14px; }

.btn-login { width: 100%; padding: 13px; background: linear-gradient(135deg, var(--accent), #c03050); border: none; border-radius: 12px; color: white; font-size: 15px; font-weight: 600; font-family: 'DM Sans', sans-serif; cursor: pointer; margin-top: 4px; transition: all 0.2s; box-shadow: 0 4px 20px rgba(233,69,96,0.35); }
.btn-login:hover { transform: translateY(-1px); }
.btn-login:disabled { opacity: 0.6; cursor: wait; }

.card-footer { margin-top: 18px; text-align: center; }
.locked-notice { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted); }
.locked-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: blink 2s ease-in-out infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.bottom-note { text-align: center; margin-top: 20px; font-size: 11px; color: var(--text-muted); }
.bottom-note strong { color: var(--text-secondary); }

/* ════════ APP ════════ */
.app-body { height: 100vh; display: flex; overflow: hidden; background: var(--main-bg); }

.sidebar { width: 240px; min-width: 240px; background: var(--sidebar-bg); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: relative; overflow: hidden; }
.sidebar::before { content: ''; position: absolute; top: -60px; left: -60px; width: 200px; height: 200px; background: radial-gradient(circle, rgba(233,69,96,0.12) 0%, transparent 70%); pointer-events: none; }

.sidebar-top { padding: 20px 16px 0; }
.logo { display: flex; align-items: center; gap: 10px; padding: 12px; margin-bottom: 4px; }
.logo-icon { width: 32px; height: 32px; background: linear-gradient(135deg, var(--accent), #b02040); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 15px; box-shadow: 0 4px 12px rgba(233,69,96,0.35); }
.logo-text { font-family: 'DM Serif Display', serif; font-size: 15px; }
.logo-sub { font-size: 9px; color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; }

.app-link { display: flex; align-items: center; gap: 8px; margin: 12px; padding: 9px 12px; background: var(--accent-soft); border: 1px solid rgba(233,69,96,0.25); border-radius: 8px; color: var(--accent); font-size: 12px; font-weight: 600; cursor: pointer; text-decoration: none; transition: all 0.2s; }
.app-link:hover { background: rgba(233,69,96,0.22); }
.app-link span:first-child { flex: 1; }

.section-label { padding: 16px 24px 6px; font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }

.nav-item { display: flex; align-items: center; gap: 9px; padding: 8px 12px; margin: 1px 12px; border-radius: 8px; cursor: pointer; color: var(--text-secondary); font-size: 13px; transition: all 0.15s; position: relative; }
.nav-item:hover { background: var(--sidebar-hover); color: var(--text-primary); }
.nav-item.active { background: var(--accent-soft); color: var(--text-primary); font-weight: 500; }
.nav-item.active::before { content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%); width: 3px; height: 60%; background: var(--accent); border-radius: 0 3px 3px 0; }
.nav-emoji { font-size: 14px; width: 18px; text-align: center; }
.nav-badge { margin-left: auto; background: var(--accent); color: white; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 10px; min-width: 18px; text-align: center; }
.nav-badge:empty { display: none; }

.sidebar-bottom { margin-top: auto; padding: 12px 16px; border-top: 1px solid var(--border); }
.members-label { font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }
.members { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.member-avatar { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; position: relative; border: 2px solid var(--sidebar-bg); color: white; }
.member-avatar.claimed::after { content: ''; position: absolute; bottom: 0; right: 0; width: 8px; height: 8px; background: var(--green); border: 2px solid var(--sidebar-bg); border-radius: 50%; }
.member-avatar.unclaimed { opacity: 0.4; }

.me-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text-secondary); }
.btn-logout { background: none; border: 1px solid var(--border); color: var(--text-muted); font-size: 11px; padding: 4px 10px; border-radius: 6px; cursor: pointer; font-family: 'DM Sans', sans-serif; }
.btn-logout:hover { color: var(--accent); border-color: rgba(233,69,96,0.3); }

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar { height: 52px; border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 28px; gap: 12px; flex-shrink: 0; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.breadcrumb .current { color: var(--text-primary); font-weight: 500; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; }

.btn-ghost { padding: 6px 12px; border-radius: 7px; background: transparent; border: 1px solid var(--border); color: var(--text-secondary); font-size: 12px; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all 0.15s; }
.btn-ghost:hover { background: var(--card-bg); color: var(--text-primary); }
.btn-accent { padding: 6px 14px; border-radius: 7px; background: var(--accent); border: none; color: white; font-size: 12px; font-weight: 600; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all 0.15s; box-shadow: 0 2px 8px rgba(233,69,96,0.3); }
.btn-accent:hover { background: #d63050; }

.content { flex: 1; overflow-y: auto; padding: 36px 48px; }
.content::-webkit-scrollbar { width: 4px; }
.content::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 4px; }

.page-header { margin-bottom: 28px; }
.page-emoji { font-size: 36px; margin-bottom: 10px; display: block; }
.page-title { font-family: 'DM Serif Display', serif; font-size: 28px; font-weight: 400; margin-bottom: 6px; letter-spacing: -0.02em; }
.page-meta { display: flex; gap: 16px; font-size: 12px; color: var(--text-muted); }

.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 28px; }
.stat-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; display: flex; align-items: center; gap: 10px; }
.stat-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.stat-icon.red { background: var(--accent-soft); }
.stat-icon.green { background: var(--green-soft); }
.stat-icon.amber { background: var(--amber-soft); }
.stat-num { font-family: 'DM Serif Display', serif; font-size: 22px; line-height: 1; }
.stat-label { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.section-header { display: flex; align-items: center; gap: 10px; margin: 24px 0 14px; }
.section-title { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.section-line { flex: 1; height: 1px; background: var(--border); }

.question-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 12px; margin-bottom: 14px; overflow: hidden; transition: border-color 0.2s; }
.question-card:hover { border-color: rgba(233,69,96,0.25); }

.q-header { padding: 16px 20px; display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.q-num { width: 22px; height: 22px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.q-num.done { background: var(--green-soft); color: var(--green); }
.q-content { flex: 1; min-width: 0; }
.q-title { font-size: 14px; font-weight: 500; margin-bottom: 6px; line-height: 1.4; }
.q-body-text { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; line-height: 1.5; }
.q-footer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.status-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.status-badge.discussao { background: var(--blue-soft); color: var(--blue); }
.status-badge.pendente { background: var(--amber-soft); color: var(--amber); }
.status-badge.aprovado { background: var(--green-soft); color: var(--green); }
.status-badge.rejeitado { background: var(--red-soft); color: var(--accent); }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.q-date { font-size: 11px; color: var(--text-muted); }
.q-replies { font-size: 11px; color: var(--text-muted); margin-left: auto; }

.q-body { border-top: 1px solid var(--border); }

.reply { padding: 14px 20px; display: flex; gap: 11px; border-bottom: 1px solid rgba(255,255,255,0.04); animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.reply-avatar { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0; color: white; }
.reply-author { font-size: 11px; font-weight: 600; color: var(--text-secondary); margin-bottom: 3px; }
.reply-time { font-weight: 400; color: var(--text-muted); }
.reply-text { font-size: 13px; line-height: 1.5; }
.reply audio { margin-top: 8px; height: 36px; max-width: 280px; display: block; }

.decision-block { margin: 12px 20px 16px; padding: 12px 14px; background: var(--green-soft); border: 1px solid rgba(0,214,143,0.2); border-radius: 9px; display: flex; gap: 10px; }
.decision-block.rejeitado { background: var(--red-soft); border-color: rgba(233,69,96,0.25); }
.decision-label { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--green); margin-bottom: 3px; }
.decision-block.rejeitado .decision-label { color: var(--accent); }
.decision-text { font-size: 13px; line-height: 1.4; }

.reply-input-area { padding: 12px 20px; display: flex; gap: 8px; align-items: center; background: rgba(255,255,255,0.02); }
.reply-input { flex: 1; padding: 9px 12px; background: rgba(255,255,255,0.05); border: 1px solid var(--border); border-radius: 8px; color: var(--text-primary); font-size: 13px; font-family: 'DM Sans', sans-serif; outline: none; }
.reply-input:focus { border-color: rgba(233,69,96,0.35); }

.icon-btn { width: 34px; height: 34px; border-radius: 8px; background: var(--accent-soft); border: 1px solid rgba(233,69,96,0.2); color: var(--accent); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 14px; flex-shrink: 0; transition: all 0.15s; }
.icon-btn:hover { background: rgba(233,69,96,0.25); }
.icon-btn.recording { background: var(--accent); color: white; animation: blink 1s ease-in-out infinite; }
.icon-btn.send { background: var(--green-soft); border-color: rgba(0,214,143,0.25); color: var(--green); }

.audio-preview { display: flex; align-items: center; gap: 8px; padding: 6px 12px 12px 20px; font-size: 11px; color: var(--blue); }
.audio-preview button { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 12px; }

.q-actions { display: flex; gap: 6px; padding: 10px 20px; border-top: 1px solid rgba(255,255,255,0.04); flex-wrap: wrap; }
.q-action-btn { padding: 5px 10px; border-radius: 6px; font-size: 11px; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: transparent; color: var(--text-secondary); font-family: 'DM Sans', sans-serif; transition: all 0.15s; }
.q-action-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.q-action-btn.approve:hover { color: var(--green); border-color: rgba(0,214,143,0.3); }
.q-action-btn.reject:hover { color: var(--accent); border-color: rgba(233,69,96,0.3); }

.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); font-size: 13px; }
.empty-state .emoji { font-size: 32px; display: block; margin-bottom: 12px; }

.new-question-btn { width: 100%; padding: 14px; margin-top: 8px; background: transparent; border: 1px dashed rgba(255,255,255,0.1); border-radius: 12px; color: var(--text-muted); font-size: 13px; font-family: 'DM Sans', sans-serif; cursor: pointer; transition: all 0.2s; }
.new-question-btn:hover { border-color: rgba(233,69,96,0.3); color: var(--accent); background: var(--accent-glow); }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: var(--main-bg); border: 1px solid var(--card-border); border-radius: 16px; padding: 28px; width: 100%; max-width: 480px; box-shadow: 0 24px 80px rgba(0,0,0,0.6); animation: slideUp 0.3s cubic-bezier(0.16,1,0.3,1); }
.modal-title { font-size: 17px; font-weight: 600; margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.modal-actions .btn-accent { padding: 9px 18px; font-size: 13px; }
.modal-actions .btn-ghost { padding: 9px 18px; font-size: 13px; }

* { scrollbar-width: thin; scrollbar-color: var(--text-muted) transparent; }

@media (max-width: 768px) {
  .sidebar { display: none; }
  .content { padding: 20px; }
  .stats-row { grid-template-columns: 1fr; }
}
