/* datepicker-suave — botão de calendário discreto DENTRO dos campos de data
   mascarados (dd/mm/aaaa) + mini-calendário popup. Vanilla, sem dependências.
   Tema claro/escuro via html[data-theme="dark"]. */

.dp-wrap { position: relative; display: block; }

/* espaço à direita p/ o botão não sobrepor o texto digitado */
.dp-input.dp-input { padding-right: 2.1rem; }

.dp-btn {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    opacity: .7;
    transition: opacity .15s ease, background .15s ease, color .15s ease;
    z-index: 2;
}
.dp-btn:hover { opacity: 1; background: rgba(99, 102, 241, .12); color: #4f46e5; }
.dp-btn:focus-visible { outline: 2px solid #6366f1; outline-offset: 1px; opacity: 1; }
.dp-btn svg { width: 15px; height: 15px; display: block; }

.dp-popup {
    position: fixed;
    z-index: 1085;                 /* acima de modais Bootstrap (~1055) */
    width: 270px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .17);
    padding: 10px;
    font-size: .82rem;
    color: #1f2937;
    user-select: none;
    animation: dp-in .12s ease;
}
@keyframes dp-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.dp-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.dp-nav {
    border: 0; background: transparent; cursor: pointer;
    width: 28px; height: 28px; border-radius: 7px; color: #4b5563;
    display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; line-height: 1;
}
.dp-nav:hover { background: rgba(99, 102, 241, .12); color: #4f46e5; }
.dp-selects { display: flex; gap: 6px; flex: 1; }
.dp-selects select {
    flex: 1; min-width: 0; font-size: .8rem; padding: 3px 4px;
    border: 1px solid #e5e7eb; border-radius: 6px; background: #fff; color: #1f2937; cursor: pointer;
}

.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-wd { text-align: center; font-size: .64rem; font-weight: 700; color: #9ca3af; padding: 3px 0; text-transform: uppercase; }
.dp-day {
    text-align: center; padding: 6px 0; border-radius: 7px; cursor: pointer; color: #374151;
    transition: background .1s ease;
}
.dp-day:hover { background: rgba(99, 102, 241, .12); }
.dp-day.dp-other { color: #cbd5e1; }
.dp-day.dp-today { box-shadow: inset 0 0 0 1px #6366f1; }
.dp-day.dp-sel { background: #4f46e5; color: #fff; }
.dp-day.dp-sel:hover { background: #4338ca; }

.dp-foot { display: flex; justify-content: space-between; margin-top: 8px; }
.dp-foot button {
    border: 0; background: transparent; cursor: pointer; font-size: .76rem;
    color: #4f46e5; padding: 3px 8px; border-radius: 6px; font-weight: 600;
}
.dp-foot button:hover { background: rgba(99, 102, 241, .1); }

/* -------- tema escuro -------- */
html[data-theme="dark"] .dp-btn { color: #94a3b8; }
html[data-theme="dark"] .dp-btn:hover { background: rgba(129, 140, 248, .2); color: #c7d2fe; }
html[data-theme="dark"] .dp-popup { background: #1e293b; border-color: #334155; color: #e2e8f0; box-shadow: 0 12px 34px rgba(0, 0, 0, .5); }
html[data-theme="dark"] .dp-nav { color: #cbd5e1; }
html[data-theme="dark"] .dp-nav:hover { background: rgba(129, 140, 248, .2); color: #c7d2fe; }
html[data-theme="dark"] .dp-selects select { background: #0f172a; border-color: #334155; color: #e2e8f0; }
html[data-theme="dark"] .dp-wd { color: #64748b; }
html[data-theme="dark"] .dp-day { color: #cbd5e1; }
html[data-theme="dark"] .dp-day:hover { background: rgba(129, 140, 248, .2); }
html[data-theme="dark"] .dp-day.dp-other { color: #475569; }
html[data-theme="dark"] .dp-day.dp-sel { background: #6366f1; color: #fff; }
html[data-theme="dark"] .dp-foot button { color: #a5b4fc; }
html[data-theme="dark"] .dp-foot button:hover { background: rgba(129, 140, 248, .15); }
