/* ============================================
   PROPOSTA FLEX — Estilos Principais
   Paleta: Azul #4361EE, Verde #06D6A0, Cinza #F0F4FF
   Fonte: Poppins
   ============================================ */

:root {
  --primary:       #4361EE;
  --primary-dark:  #3347d4;
  --primary-light: #EEF1FF;
  --green:         #06D6A0;
  --green-dark:    #04b888;
  --green-light:   #E6FBF6;
  --orange:        #FF9F1C;
  --orange-light:  #FFF4E0;
  --red:           #EF4444;
  --red-light:     #FEF2F2;
  --purple:        #7C3AED;
  --purple-light:  #F5F3FF;

  --text-primary:  #1E293B;
  --text-secondary:#64748B;
  --text-muted:    #94A3B8;

  --bg:            #F4F6FF;
  --bg-card:       #FFFFFF;
  --border:        #E2E8F0;
  --border-focus:  #4361EE;

  --sidebar-w:     250px;
  --topbar-h:      64px;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(67,97,238,.07);
  --shadow-md:     0 4px 24px rgba(67,97,238,.12);
  --transition:    .2s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; }

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

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 200;
  transition: transform var(--transition);
  box-shadow: 2px 0 16px rgba(67,97,238,.06);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-size: 1rem;
}

.logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--primary), #7B6CF6);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  flex-shrink: 0;
}

.logo-text strong { color: var(--primary); }

.sidebar-close {
  display: none;
  background: none; border: none;
  color: var(--text-secondary);
  cursor: pointer; font-size: 1.2rem;
  padding: 4px 8px;
  border-radius: 6px;
}
.sidebar-close:hover { background: var(--bg); }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

.sidebar-nav ul { list-style: none; display: flex; flex-direction: column; gap: 2px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: .875rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
}

.nav-link:hover {
  background: var(--primary-light);
  color: var(--primary);
  transform: translateX(3px);
}

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

.nav-link svg { flex-shrink: 0; opacity: .8; }
.nav-link.active svg, .nav-link:hover svg { opacity: 1; }

.sidebar-footer {
  padding: 12px 12px 20px;
  border-top: 1px solid var(--border);
}

.nav-logout { color: var(--red) !important; }
.nav-logout:hover { background: var(--red-light) !important; color: var(--red) !important; }

/* ---- MAIN WRAPPER ---- */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* ---- TOPBAR ---- */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.sidebar-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none; border: none; cursor: pointer;
  padding: 6px;
  border-radius: 6px;
}
.sidebar-toggle span { display: block; width: 20px; height: 2px; background: var(--text-secondary); border-radius: 2px; }
.sidebar-toggle:hover { background: var(--bg); }

.topbar-title { flex: 1; }
.topbar-title h1 { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); }

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

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

.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), #7B6CF6);
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700;
  flex-shrink: 0;
}

.user-details { display: flex; flex-direction: column; }
.user-name { font-size: .8rem; font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.user-company { font-size: .7rem; color: var(--text-muted); line-height: 1.2; }

/* ---- MAIN CONTENT ---- */
.main-content {
  flex: 1;
  padding: 24px;
  max-width: 1400px;
  width: 100%;
}

.app-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  font-size: .75rem;
  color: var(--text-muted);
  text-align: center;
}

/* ---- OVERLAY ---- */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 199;
}
.sidebar-overlay.active { display: block; }

/* ---- CARDS ---- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

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

.card-header h2, .card-header h3 {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body { padding: 20px; }

/* ---- STAT CARDS ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 1.3rem;
}

.stat-info { min-width: 0; }
.stat-value { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.stat-label { font-size: .75rem; color: var(--text-muted); font-weight: 500; margin-top: 2px; }

.stat-blue   .stat-icon { background: var(--primary-light); color: var(--primary); }
.stat-green  .stat-icon { background: var(--green-light);   color: var(--green-dark); }
.stat-orange .stat-icon { background: var(--orange-light);  color: var(--orange); }
.stat-purple .stat-icon { background: var(--purple-light);  color: var(--purple); }
.stat-red    .stat-icon { background: var(--red-light);     color: var(--red); }

/* ---- DASHBOARD GRID ---- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
}

/* ---- ALERTS / FLASH ---- */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: .875rem;
  font-weight: 500;
  animation: slideDown .3s ease;
}
@keyframes slideDown { from { opacity:0; transform:translateY(-10px); } to { opacity:1; transform:translateY(0); } }

.alert-icon { font-size: 1rem; font-weight: 700; flex-shrink: 0; }
.alert-success { background: var(--green-light);  color: #065f46; border: 1px solid #a7f3d0; }
.alert-error   { background: var(--red-light);    color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning { background: var(--orange-light); color: #92400e; border: 1px solid #fcd34d; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: 'Poppins', sans-serif;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); border-color: var(--primary-dark); color: white; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(67,97,238,.3); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover:not(:disabled) { background: var(--primary-light); color: var(--primary); }

.btn-green {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.btn-green:hover:not(:disabled) { background: var(--green-dark); border-color: var(--green-dark); color: white; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(6,214,160,.3); }

.btn-danger {
  background: transparent;
  color: var(--red);
  border-color: var(--red);
}
.btn-danger:hover:not(:disabled) { background: var(--red-light); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover:not(:disabled) { background: var(--bg); color: var(--text-primary); }

.btn-sm { padding: 6px 12px; font-size: .78rem; }
.btn-icon { padding: 7px; width: 32px; height: 32px; justify-content: center; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; gap: 16px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

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

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Poppins', sans-serif;
  font-size: .875rem;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(67,97,238,.1);
}

select { cursor: pointer; }
textarea { resize: vertical; min-height: 90px; }

input::placeholder, textarea::placeholder { color: var(--text-muted); }

.input-hint { font-size: .72rem; color: var(--text-muted); margin-top: 4px; }

/* ---- TABLES ---- */
.table-wrapper { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

thead tr {
  background: var(--bg);
  border-bottom: 2px solid var(--border);
}

th {
  padding: 12px 14px;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}

td {
  padding: 13px 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(67,97,238,.025); }

.td-actions { display: flex; gap: 6px; align-items: center; }

/* ---- BADGES ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
}

.badge-draft    { background: #F1F5F9; color: #64748B; }
.badge-sent     { background: #EFF6FF; color: #3B82F6; }
.badge-approved { background: var(--green-light); color: var(--green-dark); }
.badge-rejected { background: var(--red-light); color: var(--red); }

/* ---- PAGE HEADER ---- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

.page-header p {
  font-size: .85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---- FILTERS ---- */
.filters-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.filters-bar select, .filters-bar input {
  flex: 1;
  min-width: 140px;
  max-width: 200px;
  padding: 7px 12px;
  font-size: .82rem;
}

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 10px; }
.empty-state p { font-size: .9rem; }

/* ---- MODAL ---- */
.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .25s ease;
}
@keyframes modalIn { from { opacity:0; transform:scale(.95) translateY(-10px); } to { opacity:1; transform:scale(1) translateY(0); } }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1rem; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 1.3rem; color: var(--text-muted); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.modal-close:hover { background: var(--bg); color: var(--text-primary); }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ---- AUTH PAGES ---- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #F0F4FF 0%, #E8F5E9 100%);
  padding: 20px;
}

.auth-card {
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(67,97,238,.15);
  padding: 40px;
  width: 100%;
  max-width: 420px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo .logo-icon {
  width: 52px; height: 52px; margin: 0 auto 10px;
  font-size: 1.5rem;
}

.auth-logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.auth-logo h1 span { color: var(--primary); }
.auth-logo p { font-size: .85rem; color: var(--text-muted); margin-top: 4px; }

.auth-divider {
  text-align: center;
  margin: 20px 0;
  font-size: .82rem;
  color: var(--text-muted);
  position: relative;
}

.auth-switch { text-align: center; margin-top: 20px; font-size: .85rem; color: var(--text-muted); }

/* ---- PROPOSALS TABLE SPECIFIC ---- */
.proposal-num { font-weight: 700; color: var(--primary); font-size: .85rem; }

/* ---- FOLLOWUP LIST ---- */
.followup-list { display: flex; flex-direction: column; gap: 10px; }
.followup-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  gap: 10px;
  border-left: 3px solid var(--primary);
}
.followup-info { flex: 1; min-width: 0; }
.followup-title { font-size: .85rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.followup-client { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }
.followup-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

/* ---- PROPOSAL ITEMS ---- */
.items-table-wrapper { overflow-x: auto; margin-bottom: 14px; }
.items-table td input, .items-table td select { padding: 6px 8px; font-size: .82rem; }
.items-total { text-align: right; font-size: .9rem; font-weight: 700; color: var(--primary); padding: 10px 0; }

/* ---- PUBLIC PROPOSAL ---- */
.public-page {
  min-height: 100vh;
  background: var(--bg);
  font-family: 'Poppins', sans-serif;
}

.public-header {
  background: linear-gradient(135deg, var(--primary) 0%, #7B6CF6 100%);
  color: white;
  padding: 32px 24px;
  text-align: center;
}

.public-header .logo-text { color: white; font-size: 1.1rem; }
.public-header .logo-icon { background: rgba(255,255,255,.2); }

.public-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 20px;
}

.public-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 32px;
  margin-bottom: 20px;
}

.public-proposal-title { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.public-proposal-meta { color: var(--text-muted); font-size: .85rem; }

.action-buttons-public {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 20px;
}

.btn-approve { background: var(--green); color: white; border-color: var(--green); font-size: 1rem; padding: 14px; }
.btn-approve:hover { background: var(--green-dark); border-color: var(--green-dark); color: white; }
.btn-reject  { background: var(--red); color: white; border-color: var(--red); font-size: 1rem; padding: 14px; }
.btn-reject:hover  { background: #dc2626; border-color: #dc2626; color: white; }

/* ---- SETTINGS TABS ---- */
.settings-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.tab-btn {
  padding: 10px 20px;
  font-family: 'Poppins', sans-serif;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: none; border: none; cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn:hover:not(.active) { color: var(--text-primary); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- STATUS SELECTOR ---- */
.status-select {
  padding: 4px 8px !important;
  font-size: .78rem !important;
  border-radius: 20px !important;
  font-weight: 600 !important;
  cursor: pointer;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,.15);
  }
  .sidebar-close { display: block; }
  .sidebar-toggle { display: flex; }

  .main-wrapper { margin-left: 0; }

  .topbar { padding: 0 16px; }

  .main-content { padding: 16px; }

  .stats-grid { grid-template-columns: 1fr 1fr; }

  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }

  .page-header { flex-direction: column; align-items: flex-start; }

  .user-details { display: none; }

  .auth-card { padding: 28px 20px; }

  .action-buttons-public { grid-template-columns: 1fr; }

  .public-card { padding: 20px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .td-actions { flex-wrap: wrap; }
}




/* ============================================
   DATEPICKER — Estilo Moderno / Minimalista
   ============================================ */

.datepicker-wrapper {
  position: relative;
  display: block;
}

.datepicker-wrapper input {
  padding-right: 38px !important;
  cursor: pointer;
}

.datepicker-icon {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: color .15s;
  z-index: 1;
}
.datepicker-wrapper:focus-within .datepicker-icon { color: var(--primary); }

/* ---- POPUP ---- */
/* Fixado no viewport via JS para nunca ser cortado por overflow de pai */
.datepicker-popup {
  position: fixed;           /* <-- chave: sai do fluxo do DOM */
  z-index: 9999;
  width: 310px;
  background: #fff;
  border-radius: 16px;
  box-shadow:
    0 0 0 1px rgba(0,0,0,.06),
    0 4px 6px rgba(0,0,0,.04),
    0 16px 40px rgba(0,0,0,.13);
  padding: 18px 16px 14px;
  font-family: 'Poppins', sans-serif;
  animation: dpIn .16s cubic-bezier(.22,1,.36,1);
  user-select: none;
  box-sizing: border-box;
}

@keyframes dpIn {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- HEADER ---- */
.dp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 8px;
}

.dp-month-year {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.dp-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  min-width: 0;
}

/* Neutraliza TODOS os estilos globais que afetam inputs/selects dentro do popup */
.datepicker-popup select,
.datepicker-popup select.dp-select {
  /* Reset completo */
  all: unset;
  /* Estilos próprios */
  font-family: 'Poppins', sans-serif !important;
  font-size: .88rem !important;
  font-weight: 500 !important;
  color: #444 !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  cursor: pointer !important;
  padding: 2px 0 !important;
  margin: 0 !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  flex: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  line-height: 1.4 !important;
  border-radius: 0 !important;
}
.datepicker-popup select:hover,
.datepicker-popup select:focus { color: #111 !important; }

.dp-select-arrow {
  width: 12px;
  height: 12px;
  color: #bbb;
  flex-shrink: 0;
  margin-right: 4px;
  display: block;
}

.dp-nav-group {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.dp-nav-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .12s, color .12s;
  flex-shrink: 0;
  padding: 0;
}
.dp-nav-btn:hover  { background: #f2f2f2; color: #333; }
.dp-nav-btn:active { background: #e8e8e8; }

/* ---- DIAS DA SEMANA ---- */
.dp-weekdays-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 6px;
}

.dp-weekday {
  text-align: center;
  font-size: .62rem;
  font-weight: 600;
  color: #c0c0c0;
  padding: 2px 0;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ---- GRID DE DIAS ---- */
.dp-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  margin-top: 4px;
}

/* Neutraliza qualquer herança de botão */
.datepicker-popup button.dp-day,
.datepicker-popup button.dp-nav-btn,
.datepicker-popup button.dp-today-btn,
.datepicker-popup button.dp-clear-btn {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
}

.dp-day {
  aspect-ratio: 1;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-family: 'Poppins', sans-serif !important;
  font-size: .84rem !important;
  font-weight: 400 !important;
  color: #333 !important;
  border-radius: 50% !important;
  transition: background .1s, color .1s !important;
  cursor: pointer !important;
  margin: 2px auto !important;
  width: 34px !important;
  height: 34px !important;
}

.dp-day:not(.dp-day-empty):not(.dp-day-selected):hover {
  background: #eef1ff !important;
  color: var(--primary) !important;
}

.dp-day-empty {
  pointer-events: none !important;
  background: transparent !important;
}

/* Dias de outro mês — cinza claro */
.dp-day-other {
  color: #ccc !important;
  font-weight: 300 !important;
}

/* Hoje — azul claro */
.dp-day-today:not(.dp-day-selected) {
  background: #eef1ff !important;
  color: var(--primary) !important;
  font-weight: 600 !important;
}

/* Selecionado — círculo azul sólido */
.dp-day-selected {
  background: var(--primary) !important;
  color: #fff !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 8px rgba(67,97,238,.3) !important;
}

/* ---- FOOTER ---- */
.dp-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f2f2f2;
}

.dp-today-btn {
  font-family: 'Poppins', sans-serif !important;
  font-size: .75rem !important;
  font-weight: 600 !important;
  color: var(--primary) !important;
  background: transparent !important;
  border: none !important;
  padding: 5px 0 !important;
  cursor: pointer !important;
  transition: opacity .15s !important;
}
.dp-today-btn:hover { opacity: .7 !important; }

.dp-clear-btn {
  font-family: 'Poppins', sans-serif !important;
  font-size: .75rem !important;
  font-weight: 500 !important;
  color: #bbb !important;
  background: transparent !important;
  border: none !important;
  padding: 5px 0 !important;
  cursor: pointer !important;
  transition: color .15s !important;
}
.dp-clear-btn:hover { color: var(--red) !important; }
