/* CLQ App — Protótipo visual 7Tima · 100% visual, dados fictícios */
/* Tokens oficiais do Design System 7Tima (ds-viewer/configs/7tima.json) */
:root {
  --bg: #FAF9F5;           /* bg-100 */
  --surface: #FFFFFF;      /* bg-000 */
  --ink: #141413;          /* text-100 */
  --ink-soft: #3D3D3A;     /* text-200 */
  --ink-muted: #7C7B74;    /* text-400 */
  --line: #E3E0D6;
  --line-soft: #F0EDE8;    /* sidebar-bg */
  --accent: #3D4A3A;       /* brand-200 · verde-musgo */
  --accent-2: #5C6B4D;     /* brand-100 */
  --accent-soft: #E8EBE3;
  --ok: #4A6B3E;           /* success */
  --ok-soft: #E9EFE2;
  --warn: #B07C2A;         /* warning */
  --warn-soft: #F7EFDD;
  --danger: #8C2D3F;       /* danger */
  --danger-soft: #F5E3E7;
  --gold: #B8985A;         /* accent-pro */
  --gold-soft: #F5EEDF;
  --silver: #6E7480;
  --silver-soft: #EBEDF0;
  --bronze: #8C6F4A;       /* accent-100 */
  --bronze-soft: #F2EBDF;
  --xp: #8C6F4A;           /* gamificação em dourado-terra (accent-100) */
  --xp-soft: #F2EBDF;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Sora', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--sans); background: var(--bg); color: var(--ink); line-height: 1.5; }
a { color: inherit; }

/* Topbar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); padding: 14px 28px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; }
.brand { font-family: var(--serif); font-size: 19px; font-weight: 500; text-decoration: none; }
.brand b { color: var(--accent); font-weight: 500; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.pill { font-family: var(--mono); font-size: 10px; padding: 5px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap; }
.pill.ghost { background: var(--line-soft); color: var(--ink-muted); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-family: var(--mono); font-size: 12px; flex-shrink: 0; }

/* Layout */
.layout { display: grid; grid-template-columns: 232px 1fr; min-height: calc(100vh - 61px); }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 14px; }
.sidebar h3 { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-muted); margin: 14px 8px 6px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { padding: 8px 12px; border-radius: 8px; font-size: 13.5px; color: var(--ink-soft); text-decoration: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.nav-item:hover { background: var(--line-soft); }
.nav-item.active { background: var(--ink); color: var(--bg); }
.nav-item .count { font-family: var(--mono); font-size: 10.5px; opacity: 0.7; }
.main { padding: 28px 32px 64px; min-width: 0; }

/* Page head */
.eyebrow { font-family: var(--mono); font-size: 10.5px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 8px; }
h1 { font-family: var(--serif); font-weight: 400; font-size: 32px; letter-spacing: -0.01em; }
.lead { color: var(--ink-soft); margin-top: 6px; max-width: 640px; font-size: 14.5px; }
.page-head { margin-bottom: 26px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 26px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.kpi .label { font-family: var(--mono); font-size: 10px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; }
.kpi .value { font-family: var(--serif); font-size: 30px; font-weight: 400; line-height: 1; }
.kpi .delta { font-family: var(--mono); font-size: 11.5px; margin-top: 6px; color: var(--ok); }
.kpi .delta.bad { color: var(--danger); }

/* Panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 16px; }
.panel-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel-head h2 { font-family: var(--serif); font-size: 17px; font-weight: 500; }
.panel-head .hint { font-size: 12px; color: var(--ink-muted); }
.row2 { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; align-items: start; }

/* Health */
.health { font-family: var(--mono); font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; }
.health::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.health.ok { background: var(--ok-soft); color: var(--ok); }
.health.warn { background: var(--warn-soft); color: var(--warn); }
.health.bad { background: var(--danger-soft); color: var(--danger); }

/* Chips / badges */
.chip { font-family: var(--mono); font-size: 10px; padding: 3px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.05em; display: inline-block; background: var(--line-soft); color: var(--ink-soft); }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--danger-soft); color: var(--danger); }
.chip.xp { background: var(--xp-soft); color: var(--xp); }
.chip.gold { background: var(--gold-soft); color: var(--gold); }
.chip.silver { background: var(--silver-soft); color: var(--silver); }
.chip.bronze { background: var(--bronze-soft); color: var(--bronze); }

/* Progress steps (fases) */
.progress { display: flex; gap: 3px; }
.step { flex: 1; height: 8px; border-radius: 2px; background: var(--line); }
.step.done { background: var(--ok); }
.step.doing { background: var(--accent); animation: pulse 2s ease-in-out infinite; }
.step.blocked { background: var(--warn); }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: 0.4 } }

/* Buttons */
.btn { font-family: var(--sans); font-size: 13px; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; transition: transform 0.08s ease; }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.small { font-size: 12px; padding: 6px 12px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* XP bar */
.xpwrap { display: flex; align-items: center; gap: 10px; }
.xpbar { flex: 1; height: 10px; border-radius: 999px; background: var(--xp-soft); overflow: hidden; }
.xpfill { height: 100%; border-radius: 999px; background: var(--xp); transition: width 0.9s cubic-bezier(.2,.8,.2,1); }
.xplabel { font-family: var(--mono); font-size: 11px; color: var(--xp); white-space: nowrap; }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(26,24,20,0.45); display: none; align-items: flex-start; justify-content: center; padding: 4vh 16px; z-index: 100; overflow-y: auto; }
.modal-back.open { display: flex; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 760px; overflow: hidden; box-shadow: 0 24px 64px rgba(26,24,20,0.25); animation: rise 0.25s ease; }
@keyframes rise { from { transform: translateY(16px); opacity: 0 } to { transform: none; opacity: 1 } }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { font-family: var(--serif); font-size: 19px; font-weight: 500; }
.modal-body { padding: 22px; }
.modal-close { border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--ink-muted); line-height: 1; }

/* Stepper */
.stepper { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.stepper .st { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; padding: 6px 10px; border-radius: 999px; background: var(--line-soft); color: var(--ink-muted); display: flex; align-items: center; gap: 6px; }
.stepper .st.cur { background: var(--ink); color: var(--bg); }
.stepper .st.ok { background: var(--ok-soft); color: var(--ok); }

/* Toasts */
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 200; max-width: 92vw; }
.toast { background: var(--ink); color: var(--bg); padding: 13px 18px; border-radius: 12px; font-size: 13.5px; display: flex; gap: 10px; align-items: center; box-shadow: 0 12px 32px rgba(26,24,20,0.3); animation: rise 0.3s ease; }
.toast .ico { font-size: 16px; }
.toast.ok { background: var(--ok); color: #fff; }
.toast.xp { background: var(--xp); color: #fff; }

/* Table-ish rows */
.trow { display: grid; align-items: center; padding: 13px 18px; border-bottom: 1px solid var(--line-soft); gap: 12px; cursor: pointer; }
.trow:hover { background: var(--line-soft); }
.trow:last-child { border-bottom: 0; }
.tname { font-family: var(--serif); font-size: 15.5px; }
.tname small { display: block; font-family: var(--sans); font-size: 11.5px; color: var(--ink-muted); margin-top: 1px; }
.tmeta { font-family: var(--mono); font-size: 11px; color: var(--ink-muted); }

/* Item de lista com texto secundário */
.risk-item { padding: 13px 18px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.risk-item:last-child { border-bottom: 0; }
.risk-item .why { color: var(--ink-muted); font-size: 12px; margin-top: 2px; }

/* Skeleton / generating */
.skel { border-radius: 8px; background: linear-gradient(90deg, var(--line-soft) 25%, var(--line) 50%, var(--line-soft) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Certificado */
.cert { border: 1px solid var(--line); border-radius: 16px; padding: 32px 28px; text-align: center; background: linear-gradient(180deg, #FFFDF8 0%, #FAF4E6 100%); position: relative; overflow: hidden; }
.cert::before { content: ''; position: absolute; inset: 10px; border: 1px solid rgba(168,121,0,0.35); border-radius: 10px; pointer-events: none; }
.cert .selo { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center; font-size: 30px; background: radial-gradient(circle at 30% 30%, #F3D98A, #C9A227 70%); box-shadow: 0 6px 18px rgba(168,121,0,0.35); }
.cert.prata .selo { background: radial-gradient(circle at 30% 30%, #E8EBEF, #9AA3B0 70%); box-shadow: 0 6px 18px rgba(110,116,128,0.35); }
.cert.bronze .selo { background: radial-gradient(circle at 30% 30%, #E2B98B, #96633a 70%); box-shadow: 0 6px 18px rgba(140,90,43,0.35); }
.cert h3 { font-family: var(--serif); font-weight: 500; font-size: 22px; margin-bottom: 2px; }
.cert .sub { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--gold); margin-bottom: 12px; }
.cert p { font-size: 13px; color: var(--ink-soft); max-width: 380px; margin: 0 auto; }
.cert .mes { font-family: var(--serif); font-size: 15px; margin-top: 12px; }

/* Mobile */
.menubtn { display: none; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .sidebar.open { display: block; position: fixed; top: 61px; left: 0; right: 0; z-index: 60; border-bottom: 1px solid var(--line); box-shadow: 0 20px 40px rgba(26,24,20,0.15); }
  .menubtn { display: inline-flex; }
  .main { padding: 20px 16px 64px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .row2 { grid-template-columns: 1fr; }
  h1 { font-size: 26px; }
}
