:root {
  --bg: #0b1020;
  --bg-soft: #121a33;
  --panel: #161f3d;
  --panel-2: #1c2749;
  --line: #26325c;
  --txt: #e8edff;
  --txt-dim: #9aa8d4;
  --accent: #4f7cff;
  --accent-2: #22d3ee;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 20% -10%, #1b2a5c 0%, transparent 60%),
              radial-gradient(900px 500px at 100% 0%, #10304d 0%, transparent 55%),
              var(--bg);
  color: var(--txt);
  min-height: 100vh;
}

/* ---------------- topbar ---------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 18px 28px;
  background: rgba(15, 22, 44, .72);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 800; font-size: 15px; color: #06122b; letter-spacing: .5px;
}
.brand-mark.lg { width: 56px; height: 56px; font-size: 19px; margin: 0 auto 14px; }
.topbar h1 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.2px; }
.brand-sub { margin: 2px 0 0; font-size: 13px; color: var(--txt-dim); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.progress-pill { display: flex; align-items: center; gap: 10px; }
.progress-track {
  width: 160px; height: 8px; border-radius: 99px;
  background: #223; overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 99px; transition: width .35s ease;
}
#progress-label { font-size: 13px; font-weight: 700; color: var(--txt-dim); min-width: 40px; }

/* ---------------- layout ---------------- */
.content { max-width: 1220px; margin: 0 auto; padding: 26px 28px 60px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }

.card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.card h2 { margin: 0 0 14px; font-size: 15px; font-weight: 700; letter-spacing: .2px; }
.hint { font-size: 12.5px; color: var(--txt-dim); margin: -6px 0 12px; }

label { display: block; font-size: 12px; color: var(--txt-dim); margin: 12px 0 6px; }
input {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: #0e1730; color: var(--txt);
  font-size: 14px; font-family: inherit; outline: none;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,124,255,.16); }
.row { display: flex; gap: 10px; }
.row-add { margin-top: 12px; }
.row-add input:first-child { flex: 2; }
.row-add input:nth-child(2) { flex: 1; }

.btn {
  padding: 10px 16px; border-radius: 10px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--accent), #6b5cff); color: #fff; margin-top: 16px; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--txt); }
.btn-danger { background: rgba(248,113,113,.12); border-color: rgba(248,113,113,.45); color: #fca5a5; }
.btn.block { width: 100%; margin-top: 18px; }

/* ---------------- checklist ---------------- */
.secoes { display: grid; gap: 18px; margin-top: 18px; }
.secao {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.secao-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.secao-head h3 { margin: 0; font-size: 14.5px; font-weight: 700; }
.secao-head .meta { font-size: 12.5px; color: var(--txt-dim); }
.secao-desc { padding: 12px 20px 0; font-size: 12.5px; color: var(--txt-dim); }

.item {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 13px 20px; border-bottom: 1px solid rgba(38,50,92,.55);
  cursor: pointer; transition: background .12s ease;
}
.item:last-child { border-bottom: none; }
.item:hover { background: rgba(79,124,255,.06); }
.item .check {
  flex: 0 0 21px; width: 21px; height: 21px; margin-top: 1px;
  border-radius: 7px; border: 2px solid #44518c; display: grid; place-items: center;
  font-size: 12px; color: transparent; transition: all .15s ease;
}
.item.done .check {
  background: var(--ok); border-color: var(--ok); color: #06251a;
}
.item .txt { font-size: 14px; line-height: 1.5; }
.item.done .txt { color: var(--txt-dim); text-decoration: line-through; text-decoration-color: rgba(154,168,212,.5); }
.item .placeholder { color: var(--warn); }
.item .valor { color: var(--accent-2); font-weight: 600; }

/* ---------------- tabelas ---------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid rgba(38,50,92,.55); }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--txt-dim); font-weight: 600; }
td input { padding: 7px 9px; font-size: 13px; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 700;
}
.badge.ok { background: rgba(52,211,153,.15); color: var(--ok); }
.badge.warn { background: rgba(251,191,36,.15); color: var(--warn); }

.metas-list, .destaques-list { display: grid; gap: 10px; }
.meta-row { display: grid; grid-template-columns: 1fr 110px 110px; gap: 8px; align-items: center; }
.destaque-row { display: grid; grid-template-columns: 150px 1fr; gap: 8px; align-items: center; }
.destaque-row span { font-size: 13px; color: var(--txt-dim); }

.apuracao { margin-top: 18px; }
.footer-actions { display: flex; align-items: center; gap: 14px; margin-top: 22px; }
.footer-actions .btn { margin-top: 0; }

/* ---------------- modal / toast ---------------- */
.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0; background: rgba(5,10,25,.72);
  display: grid; place-items: center; z-index: 50; padding: 20px;
}
.modal-box {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; max-width: 620px; width: 100%;
  max-height: 80vh; overflow: auto; position: relative;
}
.modal-box h2 { margin: 0 0 16px; font-size: 17px; }
.modal-close {
  position: absolute; top: 12px; right: 14px; background: none; border: none;
  color: var(--txt-dim); font-size: 26px; cursor: pointer; line-height: 1;
}
.historico-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 0; border-bottom: 1px solid rgba(38,50,92,.55); font-size: 13.5px;
}

.toast[hidden] { display: none; }
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: #1d2a52; border: 1px solid var(--line); color: var(--txt);
  padding: 11px 20px; border-radius: 10px; font-size: 13.5px; z-index: 60;
  box-shadow: 0 10px 34px rgba(0,0,0,.45);
}

/* ---------------- login ---------------- */
.login-body { display: grid; place-items: center; min-height: 100vh; }
.login-card {
  width: 100%; max-width: 380px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 18px; padding: 34px 28px;
  text-align: center;
}
.login-card h1 { margin: 0; font-size: 18px; }
.login-card .brand-sub { margin-bottom: 22px; }
.login-card input { text-align: left; }
.login-error { color: #fca5a5; font-size: 13px; margin-top: 14px; }

@media (max-width: 640px) {
  .content { padding: 18px 14px 48px; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .meta-row { grid-template-columns: 1fr 1fr; }
  .destaque-row { grid-template-columns: 1fr; }
}
