/* ORVO Datepicker — dark-themed popover replacement for <input type="date">.
   Shared across every ORVO subdomain (my., staff., admin., setup., auth., help.).
   Wired by orvo-datepicker.js. Mirrors the style block originally inlined in
   my/css/my.css; lives here so staff.orvopos.com (and any future subdomain)
   can pick up the same look without duplicating CSS. */

.dp-anchor {
    position: relative;
    display: inline-block;
    width: 100%;
}
.orvo-datepicker {
    width: 300px;
    background: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8);
    font-family: 'Outfit', sans-serif;
}
.dp-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 9999;
}
/* While open the popover is moved to <body> and positioned from the input's viewport rect
   (orvo-datepicker.js `_portal`). FIXED, so no scrolling or clipping ancestor can cut it off —
   the failure that reads as "the calendar is behind the buttons" and that no z-index can fix.
   The inline left/top set by _place() supply the position. */
.dp-popover.dp-portal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100000;
    /* AND NOTHING SHIFTS IT AFTERWARDS. my.css has an old phone rule that centres the calendar with
       transform: translate(-50%, -50%) (a media block from before it was portalled). The rules above
       out-specify its position/top/left, but it never declared a transform — so the translate was
       still landing on top of the coordinates _place() had just worked out, and the calendar came up
       half its width to the left and half its height above where it was put. On a phone that is
       mostly off the screen, which is exactly what Stephen saw on 2026-08-12. Stating transform here
       is what makes the portal's placement the last word on where it goes. */
    transform: none;
    /* AND IT NEVER OUTGROWS THE SCREEN. _place() can only choose where to put the calendar; it
       cannot make one that is wider than the phone fit. Capping it here means the placement maths
       is always solvable, and on a narrow phone the grid simply tightens instead of hanging off
       the edge (Stephen, 2026-08-12). */
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    overflow: auto;
    box-sizing: border-box;
}
.dp-popover[hidden] { display: none; }
/* Optional backdrop on mobile so the centred picker reads as a modal,
   not a floating panel over scrollable form content. */
.dp-popover::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: -1;
    display: none;
}
.dp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.dp-nav-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #2a2a2a;
    background: transparent;
    color: #CCCCCC;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-family: inherit;
}
.dp-nav-btn:hover { background: #222222; color: #FFFFFF; }
.dp-nav-btn svg { width: 14px; height: 14px; }
.dp-title {
    font-weight: 600;
    font-size: 14px;
    color: #FFFFFF;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    flex: 1;
    text-align: center;
    background: none;
    border: none;
    font-family: inherit;
}
.dp-title:hover { background: #1a1a1a; }
.dp-weekdays,
.dp-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.dp-weekday {
    font-size: 10px;
    text-transform: uppercase;
    color: #555555;
    text-align: center;
    padding: 6px 0;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.dp-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #CCCCCC;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.1s;
    font-family: inherit;
    padding: 0;
}
.dp-day:hover:not(:disabled) { background: #222222; color: #FFFFFF; }
.dp-day:disabled { cursor: not-allowed; opacity: 0.4; }
.dp-day.dp-day-disabled { color: #444; cursor: not-allowed; }
.dp-day.dp-day-disabled:hover { background: transparent; color: #444; }
/* A date you can't pick -- you're already off it, or its week's roster is
   already posted. A soft shaded chip (muted number on a faint fill) rather
   than a strike-through line through the number, which read as lame. The fill
   sets a blocked day apart from a plain past/out-of-range day (which has none),
   so a blocked stretch reads as deliberately closed off. */
.dp-day.dp-day-blocked { color: #808080; background: rgba(255, 255, 255, 0.06); cursor: not-allowed; }
.dp-day.dp-day-blocked:hover { background: rgba(255, 255, 255, 0.06); color: #808080; }
.dp-day.dp-today { box-shadow: inset 0 0 0 1px #188796; color: #188796; font-weight: 600; }
.dp-day.dp-selected { background: #188796; color: #FFFFFF; font-weight: 600; }
.dp-day.dp-selected.dp-today { box-shadow: none; }
.dp-day.dp-outside { color: #333333; }
.dp-day.dp-inside-range { background: rgba(24, 135, 150, 0.2); color: #FFFFFF; border-radius: 0; }
.dp-day.dp-range-start { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.dp-day.dp-range-end { border-top-left-radius: 0; border-bottom-left-radius: 0; }
/* Status decoration -- paints a tiny coloured dot below the day number
   when the consumer has registered a status for that ISO via
   OrvoDatepicker.setDayStatuses(input, map). The default palette covers
   common 'draft' / 'published' / 'empty' statuses used by the roster
   page; consumers can add their own dp-status-X rules in page CSS. */
.dp-day.dp-has-status { position: relative; }
.dp-day.dp-has-status::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 3px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    transform: translateX(-50%);
    background: #8a9396;
    pointer-events: none;
}
.dp-day.dp-status-draft::after     { background: #73D1DE; }
.dp-day.dp-status-published::after { background: #0CAB41; }
.dp-day.dp-status-empty::after     { background: transparent; }
/* Week-select mode (opt-in via data-week-select on the input). The whole
   Mon-Sun row highlights on hover, and the chosen week stays highlighted,
   so the picker reads as choosing a week rather than a single day. The
   highlight is one bar per calendar row: middle cells are square, the
   first (col 1) and last (col 7) cells of the row carry the rounding. */
.dp-week-select .dp-day.dp-week-hover { background: rgba(115, 209, 222, 0.14); color: #FFFFFF; }
.dp-week-select .dp-day.dp-week-selected { background: rgba(24, 135, 150, 0.32); color: #FFFFFF; }
.dp-week-select .dp-days .dp-week-hover,
.dp-week-select .dp-days .dp-week-selected { border-radius: 0; }
.dp-week-select .dp-days .dp-week-hover:nth-child(7n+1),
.dp-week-select .dp-days .dp-week-selected:nth-child(7n+1) {
    border-top-left-radius: 6px; border-bottom-left-radius: 6px;
}
.dp-week-select .dp-days .dp-week-hover:nth-child(7n),
.dp-week-select .dp-days .dp-week-selected:nth-child(7n) {
    border-top-right-radius: 6px; border-bottom-right-radius: 6px;
}
/* In week mode the per-day hover background would fight the row bar. */
.dp-week-select .dp-day:hover:not(:disabled) { background: transparent; }

.dp-footer {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #222222;
}
/* Year grid view (shown when the month title is clicked) */
.dp-years {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.dp-year {
    padding: 10px 0;
    text-align: center;
    color: #CCCCCC;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    background: transparent;
    border: none;
    font-family: inherit;
}
.dp-year:hover { background: #222222; color: #FFFFFF; }
.dp-year.dp-year-selected { background: #188796; color: #FFFFFF; }
@media (max-width: 600px) {
    .orvo-datepicker { width: calc(100vw - 32px); max-width: 320px; }
    /* On phones the anchor-relative popover overflows tiny date columns
       (the input lives in a 50%-width grid cell ~150px wide while the
       picker itself is 300px). Pin it as a centred overlay above all
       page chrome instead. */
    .dp-popover {
        position: fixed;
        top: 50%;
        left: 50%;
        right: auto;
        transform: translate(-50%, -50%);
    }
    .dp-popover::before { display: block; }
}
/* Replace native date input cosmetics when upgraded. Matches the
   .field input / .field select + OrvoSelect token (background #1a1a1a,
   border #333, 6px radius, 9px padding) so text inputs, custom
   dropdowns and date pickers all carry the same recessed look on a
   card. Focus border stays teal to keep the picker identifiable. */
input.dp-input {
    width: 100%;
    background: #1a1a1a;
    border: 1px solid #333333;
    border-radius: 8px;
    padding: 9px 14px;
    color: #FFFFFF;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
input.dp-input:hover:not(:focus) { border-color: #444444; }
input.dp-input:focus {
    border-color: #188796;
    box-shadow: 0 0 0 3px rgba(24, 135, 150, 0.18);
}
input.dp-input::placeholder { color: #6b6b6b; opacity: 1; }
