/* Nuvora — área interna (menu lateral + início) */
.app { min-height: 100vh; display: flex; flex-wrap: wrap; animation: fade-in .7s ease-out both; }

.side {
  flex: 1 1 232px; background: var(--side); border-right: 1px solid var(--line-soft);
  padding: 24px 16px; display: flex; flex-direction: column; gap: 28px;
}
.side-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.side-brand img { width: 40px; height: 40px; border-radius: 11px; background: #06050F; object-fit: cover; }
.side-brand span { font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: .01em; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-title { padding: 0 12px 6px; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.nav-item {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px;
  border-radius: 10px; color: var(--muted);
}
.nav-item svg { width: 20px; height: 20px; flex: none; }
.nav-item.is-active { background: #1B1B2C; color: #fff; font-weight: 600; }
.nav-item.is-active svg { color: var(--accent); }
.nav-item.is-soon { color: var(--faint); }
.nav-note { padding: 0 12px; color: var(--faint); font-size: 13px; }
.side-user { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding: 16px 12px 0; border-top: 1px solid var(--line-soft); }
.side-user .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; background: #2A2350; color: #DAD0FF; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; }
.who-text { min-width: 0; }
.who-name { font-weight: 600; }
.who-mail { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-ghost { min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--text-2); font-weight: 500; }
.btn-ghost:hover { border-color: #45456A; }

.main { flex: 999 1 560px; min-width: 0; padding: 32px 32px 48px; display: flex; flex-direction: column; gap: 24px; }
.main h1 { font-family: var(--display); font-size: 34px; font-weight: 600; letter-spacing: -.01em; }
.lead { margin-top: 6px; color: var(--muted); font-size: 16px; }

.stats { display: flex; flex-wrap: wrap; gap: 16px; }
.stat { flex: 1 1 200px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.stat-label { color: var(--muted); font-size: 14px; }
.stat-value { margin-top: 8px; font-family: var(--display); font-size: 40px; font-weight: 600; line-height: 1; }

.row { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.card { min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.card.wide { flex: 2 1 520px; }
.card.narrow { flex: 1 1 320px; }
.card h2, .section-head h2 { font-family: var(--display); font-size: 20px; font-weight: 600; }
.empty { margin-top: 16px; padding: 28px 20px; border: 1px dashed var(--line-strong); border-radius: 12px; text-align: center; }
.empty strong { display: block; font-weight: 600; }
.empty span { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; }

.usage { margin-top: 14px; display: flex; align-items: baseline; gap: 8px; }
.usage b { font-family: var(--display); font-size: 28px; font-weight: 600; line-height: 1; }
.usage span { color: var(--muted); font-size: 14px; }
.meter { margin-top: 10px; height: 8px; border-radius: 4px; background: #2A2A40; overflow: hidden; }
.meter i { display: block; width: 0; height: 100%; border-radius: 4px; background: var(--accent); }

.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 12px; }
.section-head p { color: var(--muted); font-size: 14px; }
.pros { display: flex; flex-wrap: wrap; gap: 16px; }
.pro {
  flex: 1 1 200px; display: flex; flex-direction: column; gap: 10px; background: var(--card);
  border: 1px solid var(--line); border-radius: 16px; padding: 20px; color: var(--text);
}
.pro:hover { border-color: #45456A; color: var(--text); }
.pro svg { width: 22px; height: 22px; color: var(--accent); }
.pro strong { font-size: 16px; font-weight: 600; }
.pro span { color: var(--muted); font-size: 14px; }

/* ------------------------------------------------ Clientes e Projetos */
.nav-item:not(.is-active):not(.is-soon):hover { background: #151522; color: var(--text); }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
.page-head .lead { margin-top: 4px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 14px; font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: 12px; border: 1px solid var(--line-strong); background: var(--field); color: var(--text); font-weight: 600;
}
.btn:hover:not(:disabled) { border-color: #45456A; color: var(--text); }
.btn.primary { border: 0; background: linear-gradient(135deg, #7C4DFF, #4A63F5); color: #fff; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn.danger { background: transparent; border-color: #5A2A33; color: var(--danger); }
.btn.icon { width: 44px; padding: 0; }
.btn svg { width: 18px; height: 18px; flex: none; }

.search { flex: 1 1 260px; max-width: 420px; }
.search input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
}
.search input::placeholder { color: var(--faint); }

.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.client-card {
  display: flex; align-items: center; gap: 14px; min-width: 0; padding: 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; color: var(--text);
}
.client-card:hover { border-color: #45456A; color: var(--text); }
.client-badge {
  width: 44px; height: 44px; flex: none; border-radius: 12px; background: #2A2350; color: #DAD0FF;
  display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: 18px; font-weight: 600;
}
.client-badge.big { width: 60px; height: 60px; border-radius: 16px; font-size: 26px; }
.client-card .txt { min-width: 0; }
.client-card strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-card span { display: block; color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.client-head { display: flex; align-items: center; gap: 16px; min-width: 0; }
.client-head h1 { overflow-wrap: anywhere; }
.info { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px 24px; margin-top: 16px; }
.info dt { color: var(--faint); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.info dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.notes { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-soft); color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }

.proj-list { margin-top: 8px; }
.proj-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.proj-row:last-child { border-bottom: 0; padding-bottom: 0; }
.proj-main { flex: 1 1 220px; min-width: 0; }
.proj-main strong { display: block; font-weight: 600; overflow-wrap: anywhere; }
.proj-main span, .proj-main a { display: block; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.proj-main a:hover { color: var(--link); }
.proj-side { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.tracker { display: flex; gap: 4px; }
.tracker i { width: 22px; height: 6px; border-radius: 3px; background: #2A2A40; }
.tracker i.on { background: var(--accent); }
.stage-select { height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--field); color: var(--text); }
.due { color: var(--muted); font-size: 14px; white-space: nowrap; }

.board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { min-width: 0; background: #0F0F1A; border: 1px solid var(--line-soft); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-family: var(--display); font-weight: 600; }
.col-head span { color: var(--muted); font-family: var(--body); font-size: 13px; font-weight: 500; }
.proj-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.proj-card strong { font-weight: 600; overflow-wrap: anywhere; }
.proj-card a { font-size: 14px; overflow-wrap: anywhere; }
.proj-card .stage-select { width: 100%; }
.col-empty { color: var(--faint); font-size: 14px; padding: 8px 2px; }

dialog.modal {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; overflow: auto;
  border: 1px solid var(--line-strong); border-radius: 18px; background: var(--card); color: var(--text);
}
dialog.modal::backdrop { background: rgba(5, 4, 12, .72); }
.modal form, .modal .modal-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.modal h2 { font-family: var(--display); font-size: 22px; font-weight: 600; }
.modal p { color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }
.main-stack { display: flex; flex-direction: column; gap: 24px; }

/* Telas estreitas: o menu vira uma faixa no topo, só com as áreas que já funcionam */
@media (max-width: 791px) {
  .side { flex-basis: 100%; padding: 12px 16px; gap: 10px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .side .nav { flex-direction: row; overflow-x: auto; }
  .side .nav + .nav, .side .nav-note, .side .nav-item.is-soon { display: none; }
  .side .nav-item { flex: none; }
  .side-user { margin-top: 0; padding: 0; border-top: 0; flex-direction: row; align-items: center; justify-content: space-between; }
  .main { padding: 20px 16px 40px; }
}
