:root {
  --bg: #f3f3f5; --card: #fff; --line: #e6e6ea; --ink: #16161d; --muted: #77778a; --soft: #f6f6f8;
  --brand: #3b5bdb; --brand-soft: #e8edff; --violet: #7c6cf0;
  --yellow: #f5b700; --red: #ef4b2c; --green: #2fbf71; --purple: #7046c9;
  --radius: 18px; --shadow: 0 1px 2px rgba(20,20,40,.04);
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 14px; background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-weight: 500; margin: 0; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------- layout ---------- */
.shell { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 1fr 340px; min-height: 100vh; background: var(--bg); }
.main { padding: 22px 24px 40px; min-width: 0; }
.aside { background: var(--card); border-left: 1px solid var(--line); padding: 22px 22px 40px; }
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.logo { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #8f7ff5, #5a4bd6); display: grid; place-items: center; flex: none; }
.logo svg { width: 20px; }
.hello h1 { font-size: 20px; }
.hello p { margin: 0; font-size: 12px; color: var(--muted); }
.topbar .spacer { flex: 1; }
.search { position: relative; }
.search input { border: 0; background: #e9e9ee; border-radius: 99px; padding: 10px 16px 10px 38px; width: 220px; outline: none; }
.search input:focus { background: #fff; box-shadow: 0 0 0 2px var(--brand-soft); }
.search svg { position: absolute; left: 13px; top: 50%; translate: 0 -50%; width: 16px; }
.search-results { position: absolute; right: 0; top: calc(100% + 6px); width: 320px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.08); padding: 6px; z-index: 20; }
.search-results a { display: block; padding: 8px 10px; border-radius: 10px; }
.search-results a:hover { background: var(--soft); }
.round-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; overflow: hidden; padding: 0; }
.round-btn img { width: 100%; height: 100%; object-fit: cover; }
.round-btn svg { width: 18px; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.08); padding: 6px; min-width: 200px; z-index: 20; }
.menu a, .menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 10px; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--soft); }

.tabs { display: flex; gap: 6px; margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 8px 16px; border-radius: 99px; color: var(--muted); white-space: nowrap; border: 1px solid transparent; position: relative; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { background: #fff; color: var(--ink); border-color: var(--line); }
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11px; margin-left: 6px; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.card h2 { font-size: 17px; }
.grid-top { display: grid; grid-template-columns: 1.1fr 1fr 1fr; grid-template-rows: auto auto; gap: 14px; }
.profile-card { grid-row: span 2; display: flex; flex-direction: column; }
.ring-wrap { position: relative; width: 150px; height: 150px; margin: 14px auto 18px; }
.ring-wrap svg { position: absolute; inset: 0; }
.ring-wrap .avatar { position: absolute; inset: 20px; border-radius: 50%; background: #dfe6ff; overflow: hidden; display: grid; place-items: center; font-size: 36px; font-weight: 500; color: var(--brand); }
.ring-wrap .avatar img { width: 100%; height: 100%; object-fit: cover; }
.ring-label { text-align: center; margin-top: -8px; margin-bottom: 14px; font-size: 12px; color: var(--muted); }
.chips { display: flex; justify-content: space-between; gap: 8px; margin-top: auto; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; font-size: 13px; }
.chip svg { width: 15px; color: var(--red); }

.grad { border: 0; color: #2a2a35; position: relative; overflow: hidden; min-height: 170px; display: flex; flex-direction: column; }
.grad.warm { background: linear-gradient(135deg, #fbe0b8 0%, #f6a7b4 55%, #f3a2c8 100%); }
.grad.cool { background: linear-gradient(135deg, #a5e6ec 0%, #a8c8f3 55%, #b9b4f0 100%); }
.grad h3 { font-size: 16px; line-height: 1.2; max-width: 70%; }
.grad .ico { position: absolute; right: 16px; top: 16px; width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.55); display: grid; place-items: center; }
.grad .ico svg { width: 18px; }
.grad .big { font-size: 46px; font-weight: 400; margin-top: auto; line-height: 1; }
.grad .sub { font-size: 12px; opacity: .75; }
.wide { grid-column: span 2; display: flex; align-items: center; gap: 14px; background: #ececf0; border: 1px solid var(--line); }
.wide .grow { flex: 1; }
.avatars { display: flex; }
.avatars span { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #fff; margin-left: -8px; background: #dfe6ff; display: grid; place-items: center; font-size: 12px; font-weight: 500; color: var(--brand); overflow: hidden; }
.avatars span img { width: 100%; height: 100%; object-fit: cover; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 26px 0 12px; flex-wrap: wrap; }
.section-head h2 { font-size: 20px; }
.section-head p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart-tip { position: absolute; pointer-events: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.08); white-space: nowrap; }

/* ---------- aside ---------- */
.aside-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.aside-head h2 { font-size: 19px; }
.meeting { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.meeting .when { font-size: 11px; color: var(--muted); width: 66px; flex: none; }
.meeting .when b { display: block; color: var(--ink); font-weight: 500; font-size: 12px; }
.meeting .what { flex: 1; font-weight: 500; }
.meeting .what span { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.see-all { display: block; text-align: center; padding: 14px; font-weight: 500; font-size: 13px; }
.bar-row { display: grid; grid-template-columns: 1fr 1fr 40px; align-items: center; gap: 10px; margin: 14px 0; font-size: 13px; }
.bar { height: 7px; background: #e9e9ee; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; }
.bar-row .pct { text-align: right; color: var(--muted); font-size: 12px; }
.fb-mini { padding: 12px 0; border-bottom: 1px solid var(--line); }
.fb-mini p { margin: 4px 0 0; font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- lists / pages ---------- */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; }
.btn { border: 0; background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 99px; cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; }
.btn.light { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: #fff; color: var(--red); border: 1px solid #f6c9c0; }
.btn.sm { padding: 6px 12px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.link-btn { background: none; border: 0; cursor: pointer; color: var(--brand); padding: 0; font-weight: 500; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.filters button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 14px; cursor: pointer; font-size: 13px; }
.filters button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.list { display: grid; gap: 12px; }
.works { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.work { display: flex; flex-direction: column; gap: 8px; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.work:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(20,20,40,.06); }
.work .thumb { height: 130px; border-radius: 12px; background: linear-gradient(135deg, #e7ecff, #f4e8ff); margin: -4px -6px 4px; overflow: hidden; display: grid; place-items: center; color: var(--brand); }
.work .thumb img { width: 100%; height: 100%; object-fit: cover; }
.work .thumb svg { width: 34px; opacity: .6; }
.work h3 { font-size: 15px; }
.work p { margin: 0; color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.tag { background: var(--soft); border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; font-size: 11px; color: var(--ink); }
.tag.praise { background: #fff6d6; border-color: #f7e3a1; }
.tag.critique { background: #ffe7e2; border-color: #f8c6bb; }
.tag.suggestion { background: #e6f0ff; border-color: #c4d6fb; }
.tag.note { background: #eef0f3; }
.tag.priority { background: #ffe9ef; border-color: #f8c8d6; }
.tag.development { background: #e3f6fa; border-color: #bde6ee; }
.tag.done { background: #e2f7ec; border-color: #b6e8cc; }

.goal { display: grid; gap: 10px; }
.goal-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.goal-top h3 { font-size: 16px; }
.goal .bar { height: 9px; }
.kr { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 13px; }
.kr input { width: 17px; height: 17px; accent-color: var(--green); }
.kr.done span { text-decoration: line-through; color: var(--muted); }

.fb { display: flex; gap: 14px; }
.fb .av { width: 40px; height: 40px; border-radius: 50%; background: #dfe6ff; flex: none; display: grid; place-items: center; font-weight: 500; color: var(--brand); overflow: hidden; }
.fb .av img { width: 100%; height: 100%; object-fit: cover; }
.fb .body { flex: 1; min-width: 0; }
.fb .body p { margin: 6px 0 0; white-space: pre-wrap; line-height: 1.55; }
.fb-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.req { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.req.open { border-left: 4px solid var(--yellow); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty svg { width: 40px; opacity: .4; margin-bottom: 8px; }

.detail-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.files { display: grid; gap: 8px; }
.file { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.file .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 10px; }
.preview a { border-radius: 12px; overflow: hidden; aspect-ratio: 4/3; background: var(--soft); }
.preview img { width: 100%; height: 100%; object-fit: cover; }
.prose { white-space: pre-wrap; line-height: 1.65; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 500; color: var(--muted); }
.field input, .field select, .field textarea { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; outline: none; width: 100%; }
.field textarea { min-height: 100px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.type-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.type-pick label { cursor: pointer; }
.type-pick input { display: none; }
.type-pick span { display: inline-block; border: 1px solid var(--line); border-radius: 99px; padding: 7px 14px; font-size: 13px; color: var(--ink); }
.type-pick input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.kr-edit { display: flex; gap: 8px; margin-bottom: 6px; }
.kr-edit input[type=text] { flex: 1; }
.kr-edit button { border: 0; background: var(--soft); border-radius: 10px; width: 38px; cursor: pointer; }
.error { color: var(--red); font-size: 13px; min-height: 18px; }

.modal-bg { position: fixed; inset: 0; background: rgba(20,20,30,.35); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .15s; }
.modal { background: #fff; border-radius: 20px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 22px 24px; }
.modal h2 { font-size: 19px; margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
@keyframes fade { from { opacity: 0; } }
#toast { position: fixed; bottom: 22px; left: 50%; translate: -50% 0; background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 99px; z-index: 60; font-size: 13px; }

/* ---------- login ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background:
  radial-gradient(60% 50% at 15% 10%, #fbe0c4 0%, transparent 70%),
  radial-gradient(50% 50% at 90% 20%, #c4e3f6 0%, transparent 70%),
  radial-gradient(60% 60% at 70% 100%, #e1d6fb 0%, transparent 70%), var(--bg); }
.auth-card { background: rgba(255,255,255,.86); backdrop-filter: blur(16px); border: 1px solid #fff; border-radius: 26px; padding: 34px 32px; width: min(420px, 100%); box-shadow: 0 30px 60px rgba(40,30,90,.08); }
.auth-card .logo { width: 52px; height: 52px; margin-bottom: 18px; }
.auth-card h1 { font-size: 24px; }
.auth-card p.lead { color: var(--muted); margin: 6px 0 22px; }
.auth-card .btn { width: 100%; justify-content: center; padding: 12px; }

/* ---------- responsivo ---------- */
@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; }
  .aside { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .main, .aside { padding: 16px; }
  .grid-top { grid-template-columns: 1fr 1fr; }
  .profile-card { grid-column: span 2; grid-row: auto; }
  .wide { grid-column: span 2; }
  .detail-grid { grid-template-columns: 1fr; }
  .search input { width: 140px; }
  .hello h1 { font-size: 17px; }
  .grad .big { font-size: 36px; }
}
@media (max-width: 480px) {
  .search { display: none; }
  .row2 { grid-template-columns: 1fr; }
  .grad h3 { max-width: 100%; padding-right: 38px; font-size: 13px; overflow-wrap: anywhere; }
  .wide { flex-wrap: wrap; }
  .wide .grow { flex-basis: 100%; }
}
