/* ==============================================================================
   SÍNDICO IA — CONDOMÍNIO RESIDENCIAL BOA VISTA (CÓDIGO 4702)
   Design System: Dark Glassmorphism, Micro-animations & High-End Aesthetics
   ============================================================================== */

:root {
  --bg-primary: #070a12;
  --bg-secondary: #0d1322;
  --bg-surface: rgba(19, 27, 46, 0.75);
  --bg-surface-hover: rgba(28, 39, 64, 0.85);
  --bg-card: rgba(15, 23, 42, 0.65);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(14, 165, 233, 0.35);
  --border-gold: rgba(245, 158, 11, 0.4);

  --accent-cyan: #06b6d4;
  --accent-blue: #0ea5e9;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #8b5cf6;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --font-display: 'Outfit', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-glow-cyan: 0 0 25px rgba(6, 182, 212, 0.25);
  --shadow-glow-emerald: 0 0 25px rgba(16, 185, 129, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(14, 165, 233, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(16, 185, 129, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.05) 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar estilizada */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Layout Principal */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 10, 18, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0284c7, #0f766e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: var(--shadow-glow-cyan);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.brand-logo-img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.5);
  border: 2px solid rgba(6, 182, 212, 0.6);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: block;
}

.brand-logo-img:hover {
  transform: scale(1.06);
  box-shadow: 0 0 25px rgba(6, 182, 212, 0.8);
}

.login-logo-img {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  margin: 0 auto 1rem;
  display: block;
  box-shadow: 0 0 25px rgba(6, 182, 212, 0.6);
  border: 2px solid rgba(6, 182, 212, 0.7);
}

.tab-mascote-badge {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(14, 165, 233, 0.25);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.tab-mascote-img {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1.5px solid rgba(6, 182, 212, 0.4);
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.3);
  flex-shrink: 0;
}

.brand-info h1 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid transparent;
}

.badge-live {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

.badge-live::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.badge-ago {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

.badge-code {
  background: rgba(14, 165, 233, 0.12);
  color: #38bdf8;
  border-color: rgba(14, 165, 233, 0.3);
  font-family: var(--font-mono);
}

/* User switcher no topo */
.role-switch-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.role-switch-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-glow);
}

.btn-google {
  background: #ffffff !important;
  color: #1f2937 !important;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid #e5e7eb;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
  font-size: 0.92rem;
}

.btn-google:hover {
  background: #f9fafb !important;
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

/* Navigation Tabs */
.app-nav {
  background: rgba(13, 19, 34, 0.95);
  backdrop-filter: blur(15px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.25rem 1.5rem;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.nav-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.nav-tab.active {
  color: #38bdf8;
  background: rgba(14, 165, 233, 0.12);
  border-bottom: 2px solid #38bdf8;
}

/* Conteúdo Principal */
.main-content {
  flex: 1;
  padding: 1.75rem 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-pane.active {
  display: block;
}

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

/* Grid de KPIs */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}

.kpi-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-glow);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-emerald));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.kpi-card:hover::before {
  opacity: 1;
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.kpi-title {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.icon-blue { background: rgba(14, 165, 233, 0.15); color: #38bdf8; }
.icon-emerald { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.icon-amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.icon-purple { background: rgba(139, 92, 246, 0.15); color: #c084fc; }

.kpi-value {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.kpi-subtext {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 0.4rem;
}

/* Sections & Cards */
.section-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Two Column Layout */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .grid-2col {
    grid-template-columns: 1fr;
  }
}

/* Mural de Avisos */
.mural-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-cyan);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 0.85rem;
  transition: all 0.2s ease;
}

.mural-item:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-glow);
}

.mural-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.mural-item-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
}

.mural-item-date {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.mural-item-body {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Formulários */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #025cb3);
  color: #fff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1, #024a91);
  transform: translateY(-1px);
}

.btn-emerald {
  background: linear-gradient(135deg, #059669, #047857);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-emerald:hover {
  background: linear-gradient(135deg, #047857, #065f46);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #fff;
}

/* Tabela de Unidades / Dados */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.5);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.data-table th {
  background: rgba(30, 41, 59, 0.8);
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
}

.data-table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Chat Síndico IA */
.chat-window {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  height: 620px;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-bubble {
  max-width: 80%;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.5;
}

.bubble-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.bubble-bot {
  align-self: flex-start;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid var(--border-subtle);
  color: #f1f5f9;
  border-bottom-left-radius: 4px;
}

.chat-input-area {
  padding: 0.85rem 1.25rem;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 0.75rem;
}

.chat-input-area input {
  flex: 1;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.75rem 1.25rem;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
}

.chat-input-area input:focus {
  border-color: var(--accent-cyan);
}

/* Footer */
.app-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.app-footer a {
  color: var(--accent-cyan);
  text-decoration: none;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: #0f172a;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.25rem;
  cursor: pointer;
}

.modal-close:hover {
  color: #fff;
}
