/* Sobrescrita leve por cima do Tailwind */
html { -webkit-text-size-adjust: 100%; }
body { -webkit-font-smoothing: antialiased; }

/* Scrollbar discreto */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 9999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: padding-box; }

/* ===== Year picker (range) ===== */
.yp-popup {
  position: fixed; z-index: 9999; display: none;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  box-shadow: 0 20px 40px -10px rgba(15,23,42,.18), 0 8px 16px -8px rgba(15,23,42,.10);
  padding: 14px; width: 760px; max-width: calc(100vw - 24px);
  max-height: calc(100vh - 120px); overflow-y: auto;
  font-family: Inter, system-ui, sans-serif; color: #0f172a;
}
.yp-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.yp-spacer { flex: 1 1 auto; }
.yp-year { font-size: 17px; font-weight: 600; min-width: 60px; text-align: center; }
.yp-nav {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid #e2e8f0; background: #fff;
  font-size: 18px; line-height: 1; cursor: pointer; color: #475569;
}
.yp-nav:hover { background: #f1f5f9; color: #2563eb; border-color: #cbd5e1; }
.yp-preset {
  font-size: 11px; padding: 4px 9px; border-radius: 999px; border: 1px solid #e2e8f0;
  background: #f8fafc; color: #475569; cursor: pointer;
}
.yp-preset:hover { background: #eff8ff; color: #2563eb; border-color: #bfdfff; }

.yp-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
@media (max-width: 720px) {
  .yp-grid { grid-template-columns: repeat(3, 1fr); }
  .yp-popup { width: calc(100vw - 24px); }
}
@media (max-width: 480px) {
  .yp-grid { grid-template-columns: repeat(2, 1fr); }
}

.yp-month {
  border: 1px solid #e2e8f0; border-radius: 8px; padding: 6px;
}
.yp-month-head {
  display: block; width: 100%; text-align: center;
  font-size: 11px; font-weight: 600; letter-spacing: 0.5px; color: #334155;
  background: #f8fafc; border: 0; border-radius: 6px;
  padding: 5px 0; margin-bottom: 6px; cursor: pointer;
}
.yp-month-head:hover { background: #dbedff; color: #2563eb; }
.yp-cal {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px;
  font-size: 10px;
}
.yp-dow {
  text-align: center; padding: 2px 0; font-weight: 600; color: #94a3b8;
}
.yp-dow.yp-weekend { color: #ef4444; }
.yp-day {
  text-align: center; padding: 3px 0; line-height: 1.2;
  border: 0; background: transparent; cursor: pointer; color: #0f172a;
  border-radius: 4px;
}
.yp-day.yp-empty { visibility: hidden; }
.yp-day.yp-weekend { color: #ef4444; }
.yp-day:hover:not(.yp-empty) { background: #eff8ff; }
.yp-day.yp-today { box-shadow: inset 0 0 0 1px #2563eb; }
.yp-day.yp-in-range { background: #dbedff; color: #1d4ed8; border-radius: 0; }
.yp-day.yp-start, .yp-day.yp-end {
  background: #2563eb; color: #fff; font-weight: 600;
}
.yp-day.yp-start { border-radius: 4px 0 0 4px; }
.yp-day.yp-end   { border-radius: 0 4px 4px 0; }
.yp-day.yp-start.yp-end { border-radius: 4px; }

.yp-footer {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid #e2e8f0;
  font-size: 13px; color: #475569;
}
.yp-status strong { color: #0f172a; }
.yp-btn {
  font-size: 13px; padding: 6px 14px; border-radius: 8px; cursor: pointer; border: 1px solid transparent;
}
.yp-btn-ghost { background: transparent; color: #475569; border-color: #e2e8f0; }
.yp-btn-ghost:hover { background: #f1f5f9; color: #0f172a; }
.yp-btn-primary { background: #2563eb; color: #fff; }
.yp-btn-primary:hover { background: #1d4ed8; }

/* =========================================================================
   Design system (camada fina, opcional). Prefixo .ds- pra nao colidir com
   Tailwind. Adotar incrementalmente: trocar blocos manuais por estas classes.
   ========================================================================= */
:root {
  --ds-brand: #2563eb; --ds-brand-700: #1d4ed8;
  --ds-ok: #059669;   --ds-ok-bg: #ecfdf5;   --ds-ok-bd: #a7f3d0;
  --ds-warn: #d97706; --ds-warn-bg: #fffbeb; --ds-warn-bd: #fde68a;
  --ds-danger: #dc2626; --ds-danger-bg: #fef2f2; --ds-danger-bd: #fecaca;
  --ds-info: #0284c7; --ds-info-bg: #eff8ff; --ds-info-bd: #bfdfff;
  --ds-ink: #0f172a; --ds-muted: #64748b; --ds-line: #e2e8f0;
  --ds-radius: 1rem; --ds-shadow: 0 1px 2px 0 rgba(15,23,42,.04);
}

/* Card unico (substitui rounded-2xl ring-1 ... e rounded-lg shadow-sm border) */
.ds-card {
  background: #fff; border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius); box-shadow: var(--ds-shadow);
  padding: 1rem 1.25rem;
}
.ds-card + .ds-card { margin-top: 1rem; }

/* Cabecalho de pagina padronizado */
.ds-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.ds-page-header h2 { font-size: 1.125rem; font-weight: 600; color: var(--ds-ink); line-height: 1.3; }
.ds-page-header p { font-size: .875rem; color: var(--ds-muted); margin-top: .25rem; }
.ds-page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Botoes com hierarquia clara (acaba com o arco-iris de 6 cores) */
.ds-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .875rem; font-weight: 500; line-height: 1;
  padding: .5rem .9rem; border-radius: .5rem; border: 1px solid transparent;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s; text-decoration: none;
}
.ds-btn:active { transform: translateY(.5px); }
.ds-btn-primary { background: var(--ds-brand); color: #fff; }
.ds-btn-primary:hover { background: var(--ds-brand-700); }
.ds-btn-secondary { background: #fff; color: #334155; border-color: var(--ds-line); }
.ds-btn-secondary:hover { background: #f8fafc; border-color: #cbd5e1; }
.ds-btn-ghost { background: transparent; color: var(--ds-muted); }
.ds-btn-ghost:hover { background: #f1f5f9; color: var(--ds-ink); }
.ds-btn-danger { background: var(--ds-danger); color: #fff; }
.ds-btn-danger:hover { background: #b91c1c; }

/* Badges/pills semanticos (centraliza o dicionario de cores repetido) */
.ds-badge {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .75rem; font-weight: 500; line-height: 1;
  padding: .2rem .55rem; border-radius: 999px; border: 1px solid transparent;
}
.ds-badge-neutral { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.ds-badge-ok      { background: var(--ds-ok-bg); color: var(--ds-ok); border-color: var(--ds-ok-bd); }
.ds-badge-warn    { background: var(--ds-warn-bg); color: var(--ds-warn); border-color: var(--ds-warn-bd); }
.ds-badge-danger  { background: var(--ds-danger-bg); color: var(--ds-danger); border-color: var(--ds-danger-bd); }
.ds-badge-info    { background: var(--ds-info-bg); color: var(--ds-info); border-color: var(--ds-info-bd); }
