/* ==========================================================================
   FYNANS DESIGN SYSTEM ADAPTED FOR GESTÃO PARLAMENTAR CURITIBA
   Fontes: Poppins, Inter, JetBrains Mono
   Cores: Verde Fynans #6AB94C, Verde Ink #2C6B34, Ardósia #0f172a, Âmbar #F59E0B
   Layout: Sidebar Lateral (AppShell) + Topbar com Breadcrumb + Conteúdo Fluido
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700;800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* Fynans Palette */
  --primary: #6AB94C;
  --primary-hover: #58a23d;
  --primary-light: #f0fdf4;
  --primary-border: #bbf7d0;
  --primary-ink: #2C6B34;

  --accent-amber: #F59E0B;
  --accent-amber-light: #fef3c7;
  --destructive: #ef4444;

  --background: #f6f8fa;
  --foreground: #0f172a;
  --card: #ffffff;
  --card-foreground: #0f172a;
  
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --border: #e2e8f0;
  --input: #e2e8f0;
  --ring: #6AB94C;

  --sidebar-bg: #ffffff;
  --sidebar-border: #e2e8f0;
  --sidebar-width: 260px;
  --header-height: 64px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

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

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* ==================== FYNANS UTILITIES ==================== */
.fy-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.fy-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.fy-card:hover {
  box-shadow: var(--shadow-md);
}

.fy-rule {
  position: relative;
  padding-left: 0.875rem;
}

.fy-rule::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2em;
  bottom: 0.2em;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6AB94C 0%, #7ec662 100%);
}

/* ==================== APP SHELL LAYOUT ==================== */
.app-shell {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  flex-shrink: 0;
  z-index: 100;
  transition: width 0.25s ease;
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: 0 2px 6px rgba(106, 185, 76, 0.3);
}

.brand-text h2 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--foreground);
  line-height: 1.15;
}

.sidebar-content {
  flex: 1;
  padding: 1.25rem 0.85rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-group-title {
  padding: 0 0.75rem 0.4rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  color: var(--muted-foreground);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: all 0.15s ease;
  position: relative;
}

.nav-item:hover {
  background-color: var(--muted);
  color: var(--foreground);
}

.nav-item.active {
  background-color: var(--primary-light);
  color: var(--primary-ink);
  font-weight: 600;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 3px;
  border-radius: 999px;
  background-color: var(--primary);
}

.nav-item-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  background-color: var(--muted);
  color: var(--muted-foreground);
}

.nav-item.active .nav-badge {
  background-color: #dcfce7;
  color: var(--primary-ink);
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background-color: #fafbfc;
}

.wa-status-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-md);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary-ink);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--primary);
  box-shadow: 0 0 0 0 rgba(106, 185, 76, 0.7);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(106, 185, 76, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(106, 185, 76, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(106, 185, 76, 0); }
}

.user-profile-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6AB94C 0%, #2C6B34 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

/* ==================== MAIN CONTENT AREA ==================== */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100vh;
}

/* Topbar Header */
.top-header {
  height: var(--header-height);
  background-color: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 50;
}

.breadcrumb-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumb-parent {
  font-size: 0.82rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

.breadcrumb-separator {
  color: var(--border);
}

.breadcrumb-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--foreground);
}

.top-header-right {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.fynans-search {
  position: relative;
  width: 170px;
}

.fynans-search input {
  width: 100%;
  padding: 0.45rem 2rem 0.45rem 2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background-color: var(--background);
  font-size: 0.82rem;
  outline: none;
  transition: all 0.2s;
  color: var(--foreground);
}

.fynans-search input:focus {
  background-color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(106, 185, 76, 0.2);
}

.fynans-search svg {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
}

.kbd-badge {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  background-color: #ffffff;
  border: 1px solid var(--border);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  color: var(--muted-foreground);
}

/* Button Variants */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 0.95rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
  font-family: var(--font-body);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 2px 6px rgba(106, 185, 76, 0.3);
}

.btn-outline {
  background: #ffffff;
  border-color: var(--border);
  color: var(--foreground);
}

.btn-outline:hover {
  background-color: var(--muted);
}

.btn-portal {
  background: linear-gradient(135deg, #2C6B34 0%, #6AB94C 100%);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(44, 107, 52, 0.25);
}

.btn-portal:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(44, 107, 52, 0.35);
}

/* Page Workspace View Area */
.view-workspace {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.5rem;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.view-section {
  display: none;
  animation: fadeIn 0.2s ease-in-out;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.view-section.active {
  display: block;
}

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

/* ==================== DASHBOARD / KPIS ==================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.kpi-val {
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--foreground);
  line-height: 1.2;
}

.kpi-footer {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-top: 0.4rem;
}

/* ==================== MAPA DE CURITIBA & MUNICÍPIOS ==================== */
.map-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.25rem;
  height: calc(100vh - 170px);
  min-height: 620px;
}

@media (max-width: 1024px) {
  .map-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
}

.map-container-box {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.map-toolbar {
  padding: 0.75rem 1rem;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.map-select {
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  background-color: #ffffff;
  color: var(--foreground);
  outline: none;
}

#map-view {
  width: 100%;
  flex: 1;
  min-height: 520px;
}

/* Leaflet Custom Municipalities Layer tooltip */
.municipality-tooltip {
  background: #0f172a !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 6px !important;
  padding: 4px 8px !important;
  font-family: var(--font-body) !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2) !important;
}

.municipality-tooltip::before {
  border-top-color: #0f172a !important;
}

/* ==================== CALENDÁRIO COM TODOS OS DIAS (AGENDA) ==================== */
.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.25rem;
  align-items: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

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

.calendar-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  background: #ffffff;
}

.calendar-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.calendar-month-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--foreground);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background-color: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  width: 100%;
  min-width: 0;
}

.month-weekday-header {
  background-color: #fafbfc;
  padding: 0.65rem 0.25rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted-foreground);
  text-transform: uppercase;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-day-cell {
  background-color: #ffffff;
  min-height: 105px;
  height: 110px;
  padding: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
  position: relative;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.month-day-cell:hover {
  background-color: #f8fafc;
}

.month-day-cell.other-month {
  background-color: #fafbfc;
  opacity: 0.4;
}

.month-day-cell.today {
  background-color: #f0fdf4;
}

.month-day-cell.today .day-number {
  background-color: var(--primary);
  color: #ffffff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.day-cell-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.2rem;
  min-width: 0;
}

.day-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--foreground);
}

.day-events-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow-y: auto;
  max-height: 75px;
  min-width: 0;
  width: 100%;
}

.event-pill {
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 3px solid var(--primary);
  background-color: var(--muted);
  color: var(--foreground);
  max-width: 100%;
  display: block;
  box-sizing: border-box;
}

.event-pill.fiscalizacao { border-left-color: var(--accent-amber); background: var(--accent-amber-light); }
.event-pill.reuniao { border-left-color: #3b82f6; background: #eff6ff; }
.event-pill.oficial { border-left-color: #8b5cf6; background: #f5f3ff; }

/* ==================== KANBAN CENTRAL ==================== */
.kanban-wrapper {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  padding-bottom: 1.5rem;
  min-height: 640px;
}

.kanban-col {
  flex: 0 0 295px;
  background-color: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 210px);
}

.kanban-col-header {
  padding: 0.75rem 0.95rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #ffffff;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.kanban-cards-area {
  padding: 0.65rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
}

.kanban-card {
  background-color: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  cursor: grab;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.kanban-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.kanban-card.dragging {
  opacity: 0.4;
  border-style: dashed;
}

/* ==================== WHATSAPP SIMULATOR ==================== */
.whatsapp-grid {
  display: grid;
  grid-template-columns: 350px 1fr 1fr;
  gap: 1.25rem;
  min-height: 650px;
}

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

.phone-mockup {
  background: #111827;
  border-radius: 36px;
  padding: 10px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4);
  border: 3px solid #374151;
  display: flex;
  flex-direction: column;
  height: 610px;
}

.phone-screen {
  background: #efeae2;
  border-radius: 26px;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.whatsapp-chat-header {
  background: #075e54;
  color: #ffffff;
  padding: 0.75rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.whatsapp-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #075e54;
  font-size: 0.82rem;
}

.whatsapp-chat-body {
  flex: 1;
  padding: 0.85rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background-image: radial-gradient(#d1d5db 1px, transparent 1px);
  background-size: 16px 16px;
}

.wa-bubble {
  max-width: 86%;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.78rem;
  line-height: 1.4;
  position: relative;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
  white-space: pre-line;
}

.wa-bubble.outbound {
  background: #dcf8c6;
  align-self: flex-end;
  border-top-right-radius: 2px;
}

.wa-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.62rem;
  color: #64748b;
  margin-top: 0.25rem;
}

/* ==================== MODALS ==================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

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

.modal-box {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 580px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  animation: modalScale 0.15s ease-out;
}

@keyframes modalScale {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-body {
  padding: 1.25rem;
  max-height: 75vh;
  overflow-y: auto;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.35rem;
}

.form-control {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-size: 0.84rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(106, 185, 76, 0.2);
}

.modal-footer {
  padding: 0.85rem 1.25rem;
  background-color: #fafbfc;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  box-shadow: var(--shadow-lg);
  border-left: 3px solid var(--primary);
  animation: slideRight 0.2s ease-out;
}

@keyframes slideRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==================== PROPOSIÇÕES & SPL STYLES ==================== */
.code-search-container {
  position: relative;
  width: 220px;
}

.code-search-input-wrap {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 0.35rem 0.65rem;
  gap: 0.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.code-search-input-wrap:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.code-search-input-wrap input {
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.82rem;
  flex: 1;
  color: var(--foreground);
}

.code-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 380px;
  overflow-y: auto;
  z-index: 1000;
}

.code-dropdown-item {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

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

.code-dropdown-item:hover {
  background: #f8fafc;
}

.code-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  text-decoration: none;
  cursor: pointer;
}

.code-badge:hover {
  background: #0284c7;
  color: #ffffff;
}

/* Response Status Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
}

.badge-status-aguardando {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  animation: pulseAmber 2.5s infinite;
}

@keyframes pulseAmber {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.badge-status-tramitacao {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.badge-status-concluida {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.badge-status-arquivada {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

/* Organ Badge */
.badge-orgao {
  background: #f3e8ff;
  color: #6b21a8;
  border: 1px solid #e9d5ff;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  padding: 0.15rem 0.5rem;
  font-weight: 600;
}

/* Bairro Badge */
.badge-bairro {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  padding: 0.15rem 0.5rem;
  font-weight: 600;
}

/* Pagination Controls */
.fynans-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.25rem;
  background: #fafbfc;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted-foreground);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pagination-btn-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.page-num-btn {
  min-width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--foreground);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.page-num-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.page-num-btn.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

/* Pill Filter Buttons */
.filter-pills {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.filter-pill {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--muted-foreground);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s;
  white-space: nowrap;
}

.filter-pill:hover {
  background: #f8fafc;
  color: var(--foreground);
}

.filter-pill.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.filter-pill.active .pill-count {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.pill-count {
  background: #f1f5f9;
  color: var(--foreground);
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-family: var(--font-mono);
}

/* Proposicao Detail Modal Grid */
.prop-modal-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 1.25rem;
}

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

.prop-section-card {
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 0.85rem;
}

.prop-section-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.prop-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  font-size: 0.8rem;
}

.prop-meta-item label {
  display: block;
  font-size: 0.68rem;
  color: var(--muted-foreground);
  text-transform: uppercase;
  font-weight: 600;
}

.prop-meta-item strong {
  color: var(--foreground);
  font-size: 0.82rem;
}

