:root {
  --navy: #0B1628;
  --navy-mid: #111D33;
  --navy-light: #1A2640;
  --sidebar-bg: #080E1A;
  --card-bg: #111B2E;
  --card-border: rgba(255, 255, 255, 0.06);
  --orange: #F05A28;
  --orange-light: #FF7A45;
  --green: #22c55e;
  --blue: #3b82f6;
  --purple: #a855f7;
  --red: #ef4444;
  --yellow: #eab308;
  --white: #FFFFFF;
  --text: rgba(255, 255, 255, 0.9);
  --text-secondary: rgba(255, 255, 255, 0.5);
  --text-muted: rgba(255, 255, 255, 0.3);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.25s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--navy);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
}
h1, h2, h3, h4 { font-family: 'Plus Jakarta Sans', sans-serif; }
img { max-width: 100%; display: block; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ─── LOGIN ─── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, #0a1020 100%);
  padding: 24px;
}

.login-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 48px 40px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}

.login-logo { margin-bottom: 28px; }
.login-logo-img { height: 56px; margin: 0 auto; }

.login-card h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.login-card > p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

.login-form .form-group {
  margin-bottom: 16px;
  text-align: left;
}

.login-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.login-form input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.login-form input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(240, 90, 40, 0.15);
}

.login-form input::placeholder { color: var(--text-muted); }

.btn-login {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--orange), var(--orange-light));
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
  box-shadow: 0 4px 20px rgba(240, 90, 40, 0.3);
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(240, 90, 40, 0.4);
}

.btn-login:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.login-error {
  color: var(--red);
  font-size: 0.85rem;
  margin-top: 12px;
  min-height: 20px;
}

.password-wrap { position: relative; }
.password-wrap input { padding-right: 44px; }
.btn-eye {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 4px;
  color: var(--text-muted); transition: color 0.2s;
}
.btn-eye:hover { color: var(--text); }
.btn-eye svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.forgot-link { color: var(--text-muted); font-size: 0.85rem; text-decoration: none; transition: color 0.2s; }
.forgot-link:hover { color: var(--orange); }

/* ─── APP LAYOUT ─── */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* ─── BOTTOM NAV (MOBILE-FIRST) ─── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--sidebar-bg);
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
  padding-bottom: env(safe-area-inset-bottom, 8px);
  z-index: 100;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  background: none;
  border: none;
  font-family: 'Inter', sans-serif;
}

.bottom-nav-item svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav-item.active {
  color: var(--orange);
}

.bottom-nav-item:hover {
  color: var(--text-secondary);
}

/* ─── TOP BAR ─── */
.app-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99;
  padding: 14px 20px;
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-logo { height: 28px; }

.topbar-badge {
  background: rgba(34, 197, 94, 0.15);
  color: var(--green);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--orange), var(--orange-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--white);
}

.topbar-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.btn-logout-sm {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.btn-logout-sm svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.2s;
}

.btn-logout-sm:hover svg { stroke: var(--red); }

/* ─── MAIN CONTENT ─── */
.main-content {
  flex: 1;
  padding: 80px 20px 100px;
  min-height: 100vh;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.page { display: none; }
.page.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* ─── DASHBOARD CARDS ─── */
.dash-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.dash-metric {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.dash-metric::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}

.dash-metric:nth-child(1)::before { background: linear-gradient(90deg, var(--orange), transparent); }
.dash-metric:nth-child(2)::before { background: linear-gradient(90deg, var(--green), transparent); }
.dash-metric:nth-child(3)::before { background: linear-gradient(90deg, var(--blue), transparent); }
.dash-metric:nth-child(4)::before { background: linear-gradient(90deg, var(--purple), transparent); }

.dash-metric-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.dash-metric-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dash-metric-icon.orange { background: rgba(240,90,40,0.12); color: var(--orange); }
.dash-metric-icon.green { background: rgba(34,197,94,0.12); color: var(--green); }
.dash-metric-icon.blue { background: rgba(59,130,246,0.12); color: var(--blue); }
.dash-metric-icon.purple { background: rgba(168,85,247,0.12); color: var(--purple); }

.dash-metric-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.dash-metric-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ─── CARD ─── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
}

.card-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
}

.card-body { padding: 16px 20px; }

/* ─── PROPERTY CARD ─── */
.property-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.property-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.property-card-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: var(--navy-light);
}

.property-card-body { padding: 16px; }

.property-card-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 4px;
}

.property-card-address {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.property-card-stats {
  display: flex;
  gap: 16px;
}

.property-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.property-stat svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.property-stat .value {
  color: var(--text);
  font-weight: 600;
}

/* ─── STATUS BADGES ─── */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge.ativo { background: rgba(34,197,94,0.12); color: var(--green); }
.badge.inativo { background: rgba(239,68,68,0.12); color: var(--red); }
.badge.pendente { background: rgba(234,179,8,0.12); color: var(--yellow); }
.badge.assinado { background: rgba(34,197,94,0.12); color: var(--green); }
.badge.concluida { background: rgba(59,130,246,0.12); color: var(--blue); }
.badge.aprovado { background: rgba(34,197,94,0.12); color: var(--green); }
.badge.reprovado { background: rgba(239,68,68,0.12); color: var(--red); }
.badge.aguardando { background: rgba(240,90,40,0.12); color: var(--orange); }
.badge.em_andamento { background: rgba(59,130,246,0.12); color: var(--blue); }
.badge.concluido { background: rgba(34,197,94,0.12); color: var(--green); }
.badge.pago { background: rgba(34,197,94,0.12); color: var(--green); }
.badge.atrasado { background: rgba(239,68,68,0.12); color: var(--red); }

/* ─── LIST ITEMS ─── */
.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--card-border);
  transition: background 0.2s;
  cursor: pointer;
}

.list-item:last-child { border-bottom: none; }
.list-item:hover { background: rgba(255, 255, 255, 0.03); }

.list-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.list-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.list-icon.orange { background: rgba(240,90,40,0.12); color: var(--orange); }
.list-icon.green { background: rgba(34,197,94,0.12); color: var(--green); }
.list-icon.blue { background: rgba(59,130,246,0.12); color: var(--blue); }
.list-icon.purple { background: rgba(168,85,247,0.12); color: var(--purple); }
.list-icon.yellow { background: rgba(234,179,8,0.12); color: var(--yellow); }
.list-icon.red { background: rgba(239,68,68,0.12); color: var(--red); }

.list-info { flex: 1; min-width: 0; }

.list-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.list-right {
  text-align: right;
  flex-shrink: 0;
}

.list-value {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.list-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── PHOTO GALLERY ─── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 16px 20px;
}

.photo-thumb {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--navy-light);
  cursor: pointer;
  transition: var(--transition);
}

.photo-thumb:hover {
  opacity: 0.8;
  transform: scale(1.03);
}

/* ─── DETAIL VIEW ─── */
.detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.btn-back {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.btn-back svg {
  width: 22px;
  height: 22px;
  stroke: var(--text-secondary);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-back:hover svg { stroke: var(--text); }

.detail-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--card-border);
  gap: 12px;
}

.detail-row:last-child { border-bottom: none; }

.detail-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  flex-shrink: 0;
}

.detail-value {
  font-size: 0.88rem;
  color: var(--text);
  text-align: right;
}

/* ─── APPROVE/REJECT BUTTONS ─── */
.action-buttons {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.btn-approve, .btn-reject {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.btn-approve {
  background: rgba(34,197,94,0.15);
  color: var(--green);
  border: 1px solid rgba(34,197,94,0.3);
}

.btn-approve:hover {
  background: rgba(34,197,94,0.25);
}

.btn-reject {
  background: rgba(239,68,68,0.15);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.3);
}

.btn-reject:hover {
  background: rgba(239,68,68,0.25);
}

/* ─── EMPTY STATE ─── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.85rem;
}

/* ─── BILLING TABLE ─── */
.billing-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--card-border);
}

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

.billing-periodo {
  font-size: 0.88rem;
  font-weight: 600;
}

.billing-valor {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--green);
}

/* ─── LOADING ─── */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--card-border);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── RESPONSIVE ─── */
@media (min-width: 768px) {
  .main-content {
    padding: 80px 32px 40px;
  }

  .bottom-nav {
    top: 0;
    bottom: auto;
    left: 0;
    right: auto;
    width: 260px;
    height: 100vh;
    flex-direction: column;
    justify-content: flex-start;
    padding: 80px 12px 24px;
    gap: 4px;
    border-top: none;
    border-right: 1px solid var(--card-border);
  }

  .bottom-nav-item {
    flex-direction: row;
    gap: 12px;
    padding: 12px 16px;
    font-size: 0.9rem;
    width: 100%;
    justify-content: flex-start;
  }

  .main-content {
    margin-left: 260px;
    padding-bottom: 40px;
    max-width: none;
  }

  .dash-metrics {
    grid-template-columns: repeat(4, 1fr);
  }

  .photo-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
