/* Fonte Inter servida via Google Fonts (link no <head> dos layouts). */

:root {
  --cc-primary: #1e3a5f;
  --cc-primary-600: #16304f;
  --cc-secondary: #2e8b57;
  --cc-cta: #22c55e;
  --cc-cta-hover: #16a34a;
  --cc-bg: #eef2f7;
  --cc-text: #0f172a;
  --cc-text-muted: #5b6b82;
  --cc-surface: #ffffff;

  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-bg-strong: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-shadow: 0 8px 32px rgba(15, 23, 42, 0.18);
  --glass-blur: blur(16px) saturate(160%);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--cc-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  position: relative;
  background-color: var(--cc-bg);
  overflow: clip;
}

body::before,
body::after {
  content: '';
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  pointer-events: none;
}

body::before {
  width: 520px;
  height: 520px;
  top: -160px;
  left: -120px;
  background: radial-gradient(circle at 30% 30%, #3b82f6, var(--cc-primary));
}

body::after {
  width: 460px;
  height: 460px;
  bottom: -180px;
  right: -120px;
  background: radial-gradient(circle at 70% 70%, var(--cc-cta), var(--cc-secondary));
}

main {
  flex: 1;
}

.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-lg);
}

.navbar-custocasa {
  background: rgba(30, 58, 95, 0.55);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.16);
}

.navbar-custocasa .navbar-brand {
  color: #fff;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.navbar-custocasa .navbar-brand span {
  background: linear-gradient(120deg, #fff, #b9f6c8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-title {
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: clamp(2rem, 4vw, 3rem);
  background: linear-gradient(120deg, var(--cc-primary), var(--cc-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lead-muted {
  color: var(--cc-text-muted);
  font-size: 1.05rem;
}

.card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-lg);
}

.card-body {
  padding: 2rem;
}

.text-muted-cc {
  color: var(--cc-text-muted) !important;
}

.btn-cta {
  --shadow: 0 8px 20px rgba(34, 197, 94, 0.35);
  background: linear-gradient(120deg, var(--cc-cta), var(--cc-secondary));
  border: none;
  color: #fff;
  font-weight: 600;
  padding: 0.7rem 1.6rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), filter 0.25s var(--ease);
}

.btn-cta:hover,
.btn-cta:focus {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(34, 197, 94, 0.45);
  filter: brightness(1.05);
}

.btn-cta:active {
  transform: translateY(0);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  color: var(--cc-primary);
  font-weight: 600;
  padding: 0.7rem 1.6rem;
  border-radius: var(--radius-sm);
  transition: transform 0.25s var(--ease), background 0.25s var(--ease);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.65);
  transform: translateY(-2px);
  color: var(--cc-primary-600);
}

footer {
  color: var(--cc-text-muted);
  font-size: 0.9rem;
}

#loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

#loading-overlay.active {
  display: flex;
  animation: overlay-in 0.2s var(--ease);
}

@keyframes overlay-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.loading-card {
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-md);
  padding: 1.75rem 2.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.loading-card .spinner-border {
  width: 2.75rem;
  height: 2.75rem;
  color: var(--cc-cta);
  border-width: 0.28em;
}

.loading-card span {
  font-weight: 600;
  color: var(--cc-text);
  font-size: 0.95rem;
}

body.loading-locked {
  overflow: hidden;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.auth-title {
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.form-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--cc-text);
}

.form-control {
  border-radius: var(--radius-sm);
  border: 1px solid rgba(15, 23, 42, 0.12);
  padding: 0.7rem 0.9rem;
  background: rgba(255, 255, 255, 0.75);
}

.form-control:focus {
  border-color: var(--cc-cta);
  box-shadow: 0 0 0 0.2rem rgba(34, 197, 94, 0.18);
  background: #fff;
}

.form-control.is-invalid {
  border-color: #dc2626;
}

.form-control.is-invalid:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.18);
}

.field-error {
  color: #dc2626;
  font-size: 0.8rem;
  margin-top: 0.3rem;
  display: none;
}

.field-error.show {
  display: block;
}

.alert-glass {
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: #b91c1c;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  display: none;
}

.alert-glass.show {
  display: block;
}

.alert-glass.ok {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.3);
  color: #15803d;
}

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--cc-text-muted);
  font-size: 0.92rem;
}

.auth-switch a {
  color: var(--cc-primary);
  font-weight: 700;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.auth-forgot {
  display: block;
  text-align: right;
  margin-top: 0.4rem;
  font-size: 0.82rem;
  color: var(--cc-text-muted);
  text-decoration: none;
}

.auth-forgot:hover {
  color: var(--cc-primary);
}

.construction-emoji {
  font-size: 3.5rem;
  line-height: 1;
}

.onboarding-card {
  width: 100%;
  max-width: 520px;
}

.steps {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.step-dot {
  width: 34px;
  height: 6px;
  border-radius: 99px;
  background: rgba(15, 23, 42, 0.15);
}

.step-dot.active {
  background: var(--cc-cta);
}

.option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}

@media (max-width: 520px) {
  .option-grid {
    grid-template-columns: 1fr;
  }
}

.option-card {
  position: relative;
  cursor: pointer;
  text-align: center;
  padding: 1.6rem 1rem;
  border-radius: var(--radius-md);
  border: 2px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.55);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease),
    background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.option-card:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 197, 94, 0.4);
}

.option-card.selected {
  border-color: var(--cc-cta);
  background: rgba(34, 197, 94, 0.08);
  box-shadow: 0 8px 20px rgba(34, 197, 94, 0.18);
}

.option-icon {
  font-size: 2.6rem;
  line-height: 1;
}

.option-title {
  font-weight: 700;
  margin-top: 0.6rem;
}

.option-desc {
  font-size: 0.85rem;
  color: var(--cc-text-muted);
  margin-top: 0.25rem;
}

.option-check {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--cc-cta);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.option-card.selected .option-check {
  display: flex;
}

.btn-cta:disabled,
.btn-cta.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: none;
}

.onboarding-back {
  display: inline-block;
  margin-bottom: 0.75rem;
  color: var(--cc-text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.onboarding-back:hover {
  color: var(--cc-primary);
}

.input-group-text {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  font-weight: 700;
  color: var(--cc-text-muted);
}

.input-group .form-control {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.page-narrow {
  max-width: 560px;
  margin: 0 auto;
}

.obra-context {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0 0.25rem;
}

.obra-sobra {
  font-size: 0.85rem;
  color: var(--cc-text-muted);
}

.obra-context .obra-nome {
  font-weight: 700;
  font-size: 1.05rem;
}

.obra-saldo-label {
  font-size: 0.78rem;
  color: var(--cc-text-muted);
  display: block;
  text-align: right;
}

.obra-saldo {
  font-weight: 800;
  color: var(--cc-secondary);
}

.valor-input {
  font-size: 1.5rem;
  font-weight: 800;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border-radius: 99px;
  border: 1.5px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--cc-text);
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
  user-select: none;
}

.chip:hover {
  border-color: rgba(34, 197, 94, 0.45);
}

.chip.selected {
  border-color: var(--cc-cta);
  background: rgba(34, 197, 94, 0.12);
  color: var(--cc-primary-600);
  font-weight: 700;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
}

.hub-link {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 1.2rem;
  transition: transform 0.2s var(--ease);
}

.hub-link:hover {
  transform: translateY(-3px);
  color: inherit;
}

.hub-step {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--cc-cta);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hub-title {
  font-weight: 700;
  margin-top: 0.2rem;
}

.hub-desc {
  font-size: 0.84rem;
  color: var(--cc-text-muted);
  margin-top: 0.2rem;
}

.resumo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 520px) {
  .resumo-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.resumo-card {
  padding: 1.1rem 0.6rem;
  text-align: center;
  min-width: 0;
}

.resumo-label {
  font-size: 0.78rem;
  color: var(--cc-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.resumo-valor {
  font-size: 1.1rem;
  font-weight: 800;
  margin-top: 0.3rem;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.resumo-valor.saldo {
  color: var(--cc-secondary);
}

.resumo-valor.negativo {
  color: #dc2626;
}

.orcamento-bar-track {
  height: 14px;
  border-radius: 99px;
  background: rgba(15, 23, 42, 0.1);
  overflow: hidden;
}

.orcamento-bar-fill {
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: var(--cc-cta);
  transition: width 0.8s var(--ease);
}

.orcamento-bar-fill.warn {
  background: #f59e0b;
}

.orcamento-bar-fill.danger {
  background: #dc2626;
}

.orcamento-pct-text {
  margin-top: 0.7rem;
  font-weight: 600;
  color: var(--cc-text);
}

.empty-msg {
  color: var(--cc-text-muted);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.form-select {
  border-radius: var(--radius-sm);
  border: 1px solid rgba(15, 23, 42, 0.12);
  padding: 0.7rem 0.9rem;
  background-color: rgba(255, 255, 255, 0.75);
}

.form-select:focus {
  border-color: var(--cc-cta);
  box-shadow: 0 0 0 0.2rem rgba(34, 197, 94, 0.18);
}

.form-control[readonly] {
  background: rgba(15, 23, 42, 0.04);
}

.form-check-input:checked {
  background-color: var(--cc-cta);
  border-color: var(--cc-cta);
}

.form-check-input:focus {
  border-color: var(--cc-cta);
  box-shadow: 0 0 0 0.2rem rgba(34, 197, 94, 0.18);
}

.optional-tag {
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--cc-text-muted);
}

textarea.form-control {
  resize: vertical;
}

.cc-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1.3rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  z-index: 1090;
}

.cc-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.cc-toast.success {
  color: #15803d;
}

.cc-toast.error {
  color: #b91c1c;
}

.cc-toast::before {
  margin-right: 0.5rem;
  content: '✓';
}

.cc-toast.error::before {
  content: '⚠';
}

.lancamentos-list {
  display: flex;
  flex-direction: column;
}

.lancamento-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
}

.lancamento-item:last-child {
  border-bottom: none;
}

.lancamento-icon {
  font-size: 1.25rem;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.lancamento-main {
  flex: 1 1 auto;
  min-width: 0;
}

.lancamento-desc {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lancamento-sub {
  font-size: 0.8rem;
  color: var(--cc-text-muted);
}

.lancamento-valor {
  font-weight: 700;
  white-space: nowrap;
}

.lancamento-item.novo {
  animation: flash-novo 1.3s var(--ease);
}

@keyframes flash-novo {
  0% {
    background: rgba(34, 197, 94, 0.2);
  }
  100% {
    background: transparent;
  }
}

.cat-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.cat-row:last-child {
  margin-bottom: 0;
}

.cat-icon {
  font-size: 1.1rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.cat-body {
  flex: 1 1 auto;
  min-width: 0;
}

.cat-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.cat-label {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.cat-valor {
  font-weight: 700;
  white-space: nowrap;
}

.cat-bar-track {
  height: 8px;
  border-radius: 99px;
  background: rgba(15, 23, 42, 0.08);
  margin-top: 0.35rem;
  overflow: hidden;
}

.cat-bar-fill {
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: var(--cc-secondary);
  transition: width 0.6s var(--ease);
}

.cat-toggle {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.06);
  border-radius: 99px;
  padding: 3px;
  flex: 0 0 auto;
}

.cat-toggle button {
  border: none;
  background: transparent;
  padding: 0.3rem 0.8rem;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cc-text-muted);
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.cat-toggle button.active {
  background: #fff;
  color: var(--cc-primary);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.pie-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

@media (min-width: 480px) {
  .pie-wrap {
    flex-direction: row;
    gap: 1.5rem;
  }
}

.pie {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  flex: 0 0 auto;
  box-shadow: var(--glass-shadow);
}

.pie-legend {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
}

.pie-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.pie-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex: 0 0 auto;
}

.pie-leg-label {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
}

.pie-leg-valor {
  font-weight: 700;
  white-space: nowrap;
}

.lancamento-link {
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-sm);
  transition: background 0.15s var(--ease);
}

.lancamento-link:hover {
  color: inherit;
  background: rgba(15, 23, 42, 0.04);
}

.busca-wrap {
  position: relative;
}

.busca-wrap .form-control {
  padding-right: 2.2rem;
}

.busca-limpar {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--cc-text-muted);
  cursor: pointer;
  padding: 0 0.3rem;
}

.busca-limpar:hover {
  color: var(--cc-text);
}

.busca-dots {
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.25rem 0.75rem;
}

.busca-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cc-cta);
  animation: busca-bounce 1s infinite ease-in-out;
}

.busca-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.busca-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes busca-bounce {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-5px);
  }
}

.btn-danger {
  background: linear-gradient(120deg, #ef4444, #dc2626);
  border: none;
  color: #fff;
  font-weight: 600;
  padding: 0.7rem 1.6rem;
  border-radius: var(--radius-sm);
  transition: filter 0.2s var(--ease);
}

.btn-danger:hover,
.btn-danger:focus {
  color: #fff;
  filter: brightness(1.06);
}

.cc-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1095;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}

.cc-confirm-overlay.show {
  opacity: 1;
}

.cc-confirm-card {
  width: 100%;
  max-width: 360px;
  padding: 1.5rem;
  text-align: center;
}

.cc-confirm-msg {
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.cc-confirm-actions {
  display: flex;
  gap: 0.75rem;
}

.cc-confirm-actions > button {
  flex: 1;
}

body.has-shell {
  display: block;
  height: auto;
  min-height: 100dvh;
}

.app-sidebar {
  display: none;
}

.app-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  min-height: 52px;
  padding: env(safe-area-inset-top) 1rem 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  background: rgba(30, 58, 95, 0.6);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.app-bottomnav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  min-height: 58px;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 1030;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--glass-border);
}

.app-content {
  padding-top: calc(52px + env(safe-area-inset-top) + 1rem);
  padding-bottom: calc(58px + env(safe-area-inset-bottom) + 3rem);
  padding-left: 1rem;
  padding-right: 1rem;
}

.app-obra-m {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: none;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}

.app-obra-chevron {
  color: rgba(255, 255, 255, 0.7);
}

.app-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--cc-text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  padding-top: 0.3rem;
}

.app-tab-ico {
  font-size: 1.15rem;
  line-height: 1;
}

.app-tab.active {
  color: var(--cc-primary);
}

.btn-ghost.w-100,
.btn-cta.w-100 {
  display: block;
  text-align: center;
}

.conta-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
}

.conta-item:last-child {
  border-bottom: none;
}

.conta-item-title {
  font-weight: 600;
}

.conta-item-sub {
  font-size: 0.82rem;
  color: var(--cc-text-muted);
}

.dashboard {
  max-width: 1000px;
  margin: 0 auto;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.dashboard-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.app-topbar-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 100%;
}

.app-topbar-logo {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.app-topbar-logo span {
  color: var(--cc-cta);
}

.app-topbar-sep {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.85rem;
}

.app-obra-nome:hover {
  color: #fff;
}

.app-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.app-nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.app-nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.app-nav-item.active {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.app-sidebar-cta {
  display: block;
  text-align: center;
  text-decoration: none;
  margin-top: auto;
}

.app-sidebar-cta .cta-ico {
  filter: brightness(0) invert(1);
}

@media (min-width: 768px) {
  .app-topbar {
    left: 240px;
  }

  .app-bottomnav {
    display: none;
  }

  .app-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 240px;
    padding: 1.5rem 1rem;
    background: rgba(30, 58, 95, 0.55);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid rgba(255, 255, 255, 0.18);
    z-index: 1030;
  }

  .app-content {
    margin-left: 240px;
    padding: calc(52px + 2rem) 2.5rem 2rem;
  }

  .app-brand {
    color: #fff;
    font-weight: 800;
    font-size: 1.2rem;
    text-decoration: none;
    letter-spacing: -0.02em;
    padding: 0 0.5rem;
  }

  .app-brand span {
    background: linear-gradient(120deg, #fff, #b9f6c8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  .app-obra-saldo {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.8);
  }

  .app-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .app-nav-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.8rem;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 600;
  }

  .app-nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
  }

  .app-nav-item.active {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
  }

  .app-sidebar-cta {
    margin-top: auto;
    text-align: center;
    text-decoration: none;
  }
}

.app-obra-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.app-obra-btn::after {
  content: '▾';
  font-size: 0.8rem;
  margin-left: 0.3rem;
  flex-shrink: 0;
}

.app-obra-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
}

.project-dropdown {
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--glass-shadow);
  min-width: 200px;
  padding: 0.5rem 0;
}

.project-dropdown .dropdown-item {
  color: var(--cc-text);
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
}

.project-dropdown .dropdown-item:hover {
  background: rgba(30, 58, 95, 0.15);
  color: var(--cc-primary);
}

.project-dropdown .dropdown-item.active {
  background: rgba(34, 197, 94, 0.15);
  color: var(--cc-cta);
  font-weight: 600;
}

.project-dropdown .dropdown-divider {
  margin: 0.25rem 0;
  border-color: rgba(15, 23, 42, 0.1);
}

@media (min-width: 900px) {
  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}
