/* ══════════════════════════════════════════════════════════════
   PtDatePicker (Components/Shared/PtDatePicker.razor)
   Project-wide date picker - replaces native <input type="date"> and RadzenDatePicker.
   ══════════════════════════════════════════════════════════════ */

.ptdp {
    --ptdp-accent: #00695c;
    --ptdp-accent-2: #00897b;
    --ptdp-soft: #e0f2f1;
    --ptdp-soft-2: #f1f8f7;
    --ptdp-text: #263238;
    --ptdp-muted: #90a4ae;
    --ptdp-border: #d5dbe0;
    position: relative;
    display: block;
    width: 100%;
    font-family: inherit;
}

/* ── Field ── */
.ptdp-field {
    display: flex; align-items: center; gap: 6px;
    height: 38px; padding: 0 8px 0 10px;
    background: #fff; border: 1px solid var(--ptdp-border); border-radius: 8px;
    transition: border-color .15s, box-shadow .15s;
    cursor: text;
}
.ptdp-field:hover { border-color: #b0bec5; }
.ptdp.is-open .ptdp-field,
.ptdp-field:focus-within { border-color: var(--ptdp-accent); box-shadow: 0 0 0 3px rgba(0,105,92,.14); }
.ptdp.is-invalid .ptdp-field { border-color: #c62828; box-shadow: 0 0 0 3px rgba(198,40,40,.10); }
.ptdp.is-disabled .ptdp-field { background: #f3f5f6; cursor: not-allowed; border-color: #e3e7ea; }

.ptdp-ico { color: var(--ptdp-accent); font-size: 14px; cursor: pointer; flex-shrink: 0; }
.ptdp.is-disabled .ptdp-ico { color: #b0bec5; cursor: not-allowed; }

.ptdp-input {
    flex: 1 1 auto; min-width: 0; height: 100%;
    border: none !important; outline: none !important; box-shadow: none !important; background: transparent !important;
    padding: 0 !important; margin: 0; font-size: 13.5px; color: var(--ptdp-text); font-family: inherit;
}
.ptdp-input::placeholder { color: #b0bec5; }
.ptdp-input:disabled { color: #78909c; cursor: not-allowed; }

.ptdp-rel {
    flex-shrink: 0; font-size: 10.5px; font-weight: 700; white-space: nowrap;
    color: var(--ptdp-accent); background: var(--ptdp-soft); border-radius: 999px; padding: 2px 8px;
}
.ptdp-rel.past { color: #b71c1c; background: #fdecea; }

.ptdp-clear {
    flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; border: none; padding: 0;
    background: #eceff1; color: #607d8b; font-size: 11px; line-height: 20px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
.ptdp-clear:hover { background: #cfd8dc; color: #263238; }

/* Compact variant for filter bars / inline boxes */
.ptdp.ptdp-sm .ptdp-field { height: 32px; border-radius: 6px; }
.ptdp.ptdp-sm .ptdp-input { font-size: 12.5px; }

/* ── Popup ── */
.ptdp-pop {
    position: fixed; z-index: 2000; top: 0; left: 0;
    display: flex; overflow: hidden; visibility: hidden;
    background: #fff; color: var(--ptdp-text);
    border-radius: 14px; border: 1px solid #e6eaed;
    box-shadow: 0 16px 40px rgba(0,0,0,.18), 0 2px 6px rgba(0,0,0,.06);
    font-size: 12.5px; outline: none;
    animation: ptdpIn .14s ease-out;
}
.ptdp-pop.ptdp-ready { visibility: visible; }
@keyframes ptdpIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ptdp-pop { animation: none; } }

/* Presets column */
.ptdp-presets {
    background: var(--ptdp-soft-2); padding: 12px 8px; min-width: 104px;
    display: flex; flex-direction: column; gap: 3px; border-right: 1px solid #e6efed;
}
.ptdp-presets-title { font-size: 9.5px; font-weight: 800; color: var(--ptdp-muted); text-transform: uppercase; letter-spacing: .06em; padding: 0 8px 4px; }
.ptdp-preset {
    border: none; background: none; text-align: left; cursor: pointer; white-space: nowrap;
    font-size: 12px; font-weight: 600; color: var(--ptdp-accent); padding: 6px 9px; border-radius: 7px;
}
.ptdp-preset:hover { background: #d7ece9; }
.ptdp-preset.on { background: var(--ptdp-accent); color: #fff; }
.ptdp-preset:disabled { color: #b0bec5; cursor: not-allowed; background: none; }
.ptdp-preset.danger { color: #b71c1c; margin-top: auto; }
.ptdp-preset.danger:hover { background: #fdecea; }

/* Calendar */
.ptdp-main { padding: 12px 12px 10px; width: 264px; }
.ptdp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ptdp-nav {
    width: 30px; height: 30px; border-radius: 8px; border: none; background: none; cursor: pointer;
    color: #546e7a; font-size: 12px; display: inline-flex; align-items: center; justify-content: center;
}
.ptdp-nav:hover { background: #eef2f4; color: var(--ptdp-text); }
.ptdp-nav:disabled { opacity: .3; cursor: default; background: none; }
.ptdp-title {
    border: none; background: none; cursor: pointer; font-size: 14px; font-weight: 800; color: var(--ptdp-text);
    padding: 5px 10px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px;
}
.ptdp-title:hover { background: #eef2f4; }
.ptdp-title i { font-size: 9px; color: var(--ptdp-muted); }

.ptdp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.ptdp-wd { text-align: center; font-size: 10px; font-weight: 800; color: var(--ptdp-muted); text-transform: uppercase; padding: 4px 0 6px; }
.ptdp-day {
    height: 33px; border: none; background: none; border-radius: 9px; cursor: pointer;
    font-size: 12.5px; color: var(--ptdp-text); font-family: inherit; position: relative;
}
.ptdp-day:hover { background: var(--ptdp-soft); color: var(--ptdp-accent); }
.ptdp-day.out { color: #c5cfd4; }
.ptdp-day.today { font-weight: 800; color: var(--ptdp-accent); }
.ptdp-day.today::after {
    content: ''; position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px;
    border-radius: 50%; background: var(--ptdp-accent);
}
.ptdp-day.sel {
    background: linear-gradient(135deg, var(--ptdp-accent-2), var(--ptdp-accent)); color: #fff; font-weight: 800;
    box-shadow: 0 3px 9px rgba(0,105,92,.35);
}
.ptdp-day.sel::after { background: #fff; }
.ptdp-day:disabled { color: #d5dde1; text-decoration: line-through; cursor: not-allowed; background: none; }

.ptdp-mgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px 0; }
.ptdp-cell {
    height: 44px; border: none; background: #f7f9fa; border-radius: 10px; cursor: pointer;
    font-size: 12.5px; font-weight: 600; color: var(--ptdp-text); font-family: inherit;
}
.ptdp-cell:hover { background: var(--ptdp-soft); color: var(--ptdp-accent); }
.ptdp-cell.cur { box-shadow: inset 0 0 0 1.5px var(--ptdp-accent); color: var(--ptdp-accent); }
.ptdp-cell.sel { background: var(--ptdp-accent); color: #fff; }
.ptdp-cell:disabled { opacity: .35; cursor: not-allowed; }

/* Time row */
.ptdp-time { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid #eef1f3; }
.ptdp-time label { font-size: 10.5px; font-weight: 800; color: var(--ptdp-muted); text-transform: uppercase; letter-spacing: .04em; margin: 0 auto 0 0; }
.ptdp-time select {
    height: 30px; border: 1px solid var(--ptdp-border); border-radius: 7px; font-size: 12.5px; padding: 0 6px; background: #fff; font-family: inherit;
}

/* Footer */
.ptdp-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    border-top: 1px solid #eef1f3; margin-top: 8px; padding-top: 8px; font-size: 11px; color: #607d8b;
}
.ptdp-foot b { color: var(--ptdp-accent); font-weight: 800; white-space: nowrap; }
.ptdp-foot-link { border: none; background: none; color: var(--ptdp-accent); font-weight: 700; font-size: 11.5px; cursor: pointer; padding: 2px 4px; }
.ptdp-foot-link:hover { text-decoration: underline; }

/* Phones: bottom sheet */
.ptdp-pop.ptdp-sheet {
    top: auto !important; left: 0 !important; right: 0; bottom: 0;
    border-radius: 18px 18px 0 0; flex-direction: column-reverse;
    box-shadow: 0 -12px 36px rgba(0,0,0,.22); animation: ptdpUp .18s ease-out;
    padding-bottom: env(safe-area-inset-bottom);
}
@keyframes ptdpUp { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.ptdp-sheet .ptdp-main { width: 100%; padding: 14px 16px 10px; }
.ptdp-sheet .ptdp-day { height: 40px; font-size: 14px; }
.ptdp-sheet .ptdp-presets {
    flex-direction: row; overflow-x: auto; border-right: none; border-top: 1px solid #e6efed;
    padding: 10px 12px; gap: 6px; min-width: 0;
}
.ptdp-sheet .ptdp-presets-title { display: none; }
.ptdp-sheet .ptdp-preset { background: #fff; border: 1px solid #d7ece9; border-radius: 999px; padding: 6px 12px; }
.ptdp-sheet .ptdp-preset.danger { margin-top: 0; }
