/* Compact visitor workspace, scoped so other screens retain their layout. Mirrors the
   personnel editor's density (employee-editor.css) without sharing its class names. */
/* The 6px padding offsets the negative margin on Bootstrap rows. Without it the
   row gutters push the right-hand card 5px past the viewport. */
.visitor-page { --visitor-accent:#2563eb; font-size:.82rem; padding:0 6px; }
.visitor-hero { background:linear-gradient(115deg,#142d56,#175c87); border-radius:12px; padding:5px 14px; color:#fff; gap:10px; flex-wrap:wrap; }
.visitor-hero .page-title { color:#fff; font-size:1.2rem; margin:0; }
.visitor-hero .btn { border-color:#b5d8f5; color:#fff; font-size:.8rem; }
.visitor-hero .btn-primary { background:#fff; color:#173153; border-color:#fff; }
.visitor-hero .info-tip-btn { border-color:#b5d8f5; background:transparent; color:#fff; }

.visitor-page .card { border:1px solid #dce5f0; border-radius:10px; box-shadow:0 3px 12px #203d6110; overflow:visible; }
.visitor-page .card-header { border:0; border-radius:10px 10px 0 0; background:linear-gradient(100deg,#e8efff,#f4f8ff); color:#234c8a; font-weight:700; padding:8px 12px; border-left:4px solid #437be3; font-size:.82rem; }
.visitor-page .card-body { padding:12px; }
.visitor-page .card-body.py-2 { padding-top:.5rem!important; padding-bottom:.5rem!important; }
.visitor-page .row.g-3 { --bs-gutter-x:.75rem; --bs-gutter-y:.65rem; }

.visitor-form > .row { --bs-gutter-y:.7rem; }
.visitor-form > .row > :nth-child(2n) .card-header { background:linear-gradient(100deg,#def5ef,#f2fbf8); color:#146958; border-left-color:#25a58d; }
.visitor-form > .row > :nth-child(3n) .card-header { background:linear-gradient(100deg,#eee7fc,#f8f5ff); color:#694898; border-left-color:#9470ce; }
.visitor-form .section-lead { font-size:.74rem; color:#64748b; margin:-2px 0 6px; }

/* Opened from a request at the foot of the page: mark the form the click filled in, so the
   arrival at the top of the page reads as the result of that click and not a fresh screen. */
.visitor-form--from-approval > .row > .col-12 > .card { outline:2px solid #2563eb33; outline-offset:2px; }
.visitor-form--from-approval { animation:visitor-form-arrive .5s ease-out; }
/* The anchor is scrolled to the top of the viewport, where the app's fixed header would cover
   it; leave room for that header so the notice is actually readable on arrival. */
#checkInApprovalNotice { scroll-margin-top:72px; }
@keyframes visitor-form-arrive { from { opacity:.35; transform:translateY(-4px); } to { opacity:1; transform:none; } }
@media (prefers-reduced-motion:reduce) { .visitor-form--from-approval { animation:none; } }

.visitor-floating { position:relative; margin-top:.35rem; }
.visitor-floating > .form-control,.visitor-floating > .form-select { min-height:38px; height:38px; font-size:.8rem; padding:.55rem .6rem .3rem; border-radius:.5rem; }
.visitor-floating > textarea.form-control { min-height:60px; height:60px; }
.visitor-floating > label { position:absolute; top:50%; left:.6rem; transform:translateY(-50%); background:var(--bs-body-bg,#fff); padding:0 .25rem; margin:0; color:#64748b; font-size:.78rem; pointer-events:none; transition:top .15s,font-size .15s,color .15s; }
.visitor-floating > textarea ~ label { top:1.2rem; }
.visitor-floating:focus-within > label,.visitor-floating.always-float > label,.visitor-floating > :not(:placeholder-shown) ~ label { top:0; font-size:.68rem; font-weight:600; color:#2563eb; }
.visitor-floating:focus-within > .form-control,.visitor-floating:focus-within > .form-select { border-color:#2563eb; box-shadow:0 0 0 .15rem rgba(37,99,235,.12); }
.visitor-form .visitor-floating > .form-control[readonly] { background:#eef3f9; color:#42546e; cursor:default; }
/* flatpickr marks its visible field readonly because typing is disabled; that must not read as
   a disabled field the way the generated visitor code does. */
.visitor-form .visitor-floating > .form-control[readonly].visitor-date-input { background:#fff; color:#212529; cursor:pointer; }
.visitor-form .visitor-floating > .form-control[type="file"] { padding:.45rem .5rem; height:auto; min-height:38px; font-size:.76rem; }

.visitor-page .form-label { font-size:.76rem; font-weight:600; margin-bottom:.25rem; color:#344054; }
.visitor-page .form-control,.visitor-page .form-select { font-size:.8rem; }
.visitor-page .form-control-sm,.visitor-page .form-select-sm { font-size:.78rem; min-height:32px; padding:.3rem .5rem; }
.visitor-page textarea.form-control { font-size:.8rem; }
.visitor-page .form-text { font-size:.7rem; line-height:1.4; margin-top:4px; }
.visitor-page .form-check { min-height:1.3rem; }
.visitor-page .form-check-label { font-size:.8rem; }
.visitor-page .form-check-input { margin-top:.18em; }
.visitor-page .btn { font-size:.78rem; padding:6px 10px; }
.visitor-page .btn-sm { font-size:.74rem; padding:4px 8px; }
.visitor-page .alert { font-size:.8rem; padding:.5rem .75rem; margin-bottom:.75rem; }
.visitor-page .stat-label { font-size:.66rem; letter-spacing:.05em; text-transform:uppercase; color:#64748b; font-weight:600; }
.visitor-page .stat-value { font-size:1.15rem; font-weight:700; color:#173153; line-height:1.2; }
.visitor-page .badge { font-size:.66rem; padding:.3em .5em; }
.visitor-page code { font-size:.78rem; }
.visitor-page .table { font-size:.78rem; margin-bottom:0; }
.visitor-page .table > :not(caption) > * > * { padding:.35rem .45rem; }
.visitor-page .table thead th { font-size:.66rem; letter-spacing:.04em; }
.visitor-page .list-group-item { font-size:.8rem; padding:.4rem .6rem; }
.visitor-page .pagination { --bs-pagination-font-size:.78rem; --bs-pagination-padding-y:.25rem; --bs-pagination-padding-x:.5rem; }
.visitor-page .page-link { font-size:.78rem; }
.visitor-page .small,.visitor-page small { font-size:.74rem!important; }

.visitor-save-bar { position:sticky; bottom:0; z-index:10; padding:10px!important; background:#f4f7fcf5; border-top:1px solid #dce5f0; backdrop-filter:blur(8px); }

/* Photo drop zone on the check-in screen. */
.visitor-photo-preview { border:1px dashed #cbd5e1; border-radius:10px; padding:6px; background:#f8fafc; text-align:center; }
.visitor-photo-preview img { max-height:150px; max-width:100%; border-radius:8px; display:block; margin:0 auto; }
.visitor-photo-picker { display:flex; gap:.4rem; align-items:stretch; }
.visitor-photo-picker .form-control { flex:1 1 auto; min-width:0; }
.visitor-photo-picker .btn { white-space:nowrap; font-size:.78rem; }
.visitor-photo-picker .visitor-photo-file { flex:1 1 auto; min-width:0; align-self:center; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.74rem; color:#64748b; }
.visitor-camera { margin-top:.6rem; padding:6px; border:1px solid #cbd5e1; border-radius:10px; background:#0f172a; }
.visitor-camera-video { display:block; width:100%; max-height:240px; border-radius:7px; background:#000; object-fit:cover; }
.visitor-camera-bar { display:flex; align-items:center; gap:.4rem; flex-wrap:wrap; padding:6px 2px 1px; }
.visitor-camera-bar .small { color:#dbe4f0; }
.visitor-camera-bar .btn-outline-light { border-color:#93a8c4; color:#e8eef7; }
.visitor-photo-actions { display:flex; gap:.4rem; justify-content:center; margin-top:6px; }

/* Lookup suggestions float above the fields they fill. */
.visitor-lookup-results { position:absolute; z-index:20; top:100%; left:0; right:0; max-height:260px; overflow:auto; border:1px solid #dce5f0; border-radius:8px; background:#fff; box-shadow:0 12px 28px #17315326; margin-top:2px; }
.visitor-lookup { position:relative; }

@media(prefers-reduced-motion:reduce){.visitor-floating > label { transition:none; }}
@media(max-width:767px){
    .visitor-form .row > [class*="col-md-"] { width:50%; }
    .visitor-form .row > .col-md-7,.visitor-form .row > .col-md-6 { width:100%; }
    .visitor-form .visitor-floating > .form-control,.visitor-form .visitor-floating > .form-select { min-height:42px; height:42px; }
    .visitor-form .form-text { overflow-wrap:anywhere; }
}
@media(max-width:420px){
    .visitor-form .row > [class*="col-md-"] { width:100%; }
    .visitor-hero { padding:5px 10px; }
    .visitor-form .visitor-floating > .form-control,.visitor-form .visitor-floating > .form-select { font-size:16px; }
}

/* Date fields (js/visitor-dates.js). The visible field flatpickr builds replaces the hidden
   input but keeps the form-control class, so it needs only the room for the clear button.
   The calendar itself is moved to <body>, which is why it is tagged with its own class rather
   than found through .visitor-page. */
.visitor-floating > .visitor-date-input { padding-right:30px; }
.visitor-date-clear { position:absolute; right:3px; top:50%; transform:translateY(-50%); width:22px; height:22px; padding:0; border:0; border-radius:50%; background:transparent; color:#64748b; font-size:16px; line-height:1; }
.visitor-date-clear:hover,.visitor-date-clear:focus-visible { background:#e2e8f0; color:#173153; }
.flatpickr-calendar.visitor-flatpickr { font-size:12.5px; box-shadow:0 10px 32px #17315330; }

/* Check-in form: each field is sized for the text it actually holds and the columns pack as
   many fields per line as the card allows, so a whole arrival fits without scrolling. */
#checkInForm .checkin-grid { display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); gap:.28rem .4rem; }
#checkInForm .checkin-grid > * { min-width:0; }
#checkInForm .checkin-grid > .cg-1 { grid-column:span 1; }
#checkInForm .checkin-grid > .cg-2 { grid-column:span 2; }
#checkInForm .checkin-grid > .cg-3 { grid-column:span 3; }
#checkInForm .checkin-grid > .cg-4 { grid-column:span 4; }
#checkInForm .checkin-grid > .cg-5 { grid-column:span 5; }
#checkInForm .checkin-grid > .cg-6 { grid-column:span 6; }
#checkInForm .checkin-grid > .cg-7 { grid-column:span 7; }
#checkInForm .checkin-grid > .cg-8 { grid-column:span 8; }
#checkInForm .checkin-grid > .cg-9 { grid-column:span 9; }
#checkInForm .checkin-grid > .cg-10 { grid-column:span 10; }
#checkInForm .checkin-grid > .cg-12 { grid-column:span 12; }
#checkInForm .visitor-floating { margin-top:0; }
#checkInForm .visitor-floating > .form-control,
#checkInForm .visitor-floating > .form-select { min-height:36px; height:36px; padding:.42rem .5rem .18rem; }
#checkInForm .visitor-floating > label { left:.5rem; font-size:.72rem; }
#checkInForm .visitor-floating:focus-within > label,
#checkInForm .visitor-floating.always-float > label,
#checkInForm .visitor-floating > :not(:placeholder-shown) ~ label { font-size:.64rem; }
#checkInForm .visitor-floating > textarea.form-control { min-height:56px; height:56px; }
#checkInForm .visitor-floating > .form-control[readonly].visitor-date-input { height:36px; }
#checkInForm .form-text { margin-top:2px; font-size:.66rem; }
#checkInForm .form-label { margin-bottom:.15rem; }
#checkInForm .row.g-3 { --bs-gutter-x:.5rem; --bs-gutter-y:.35rem; }
#checkInForm .card-body { padding:8px; }
#checkInForm .card-header { padding:5px 10px; }
#checkInForm .checkin-check { display:flex; align-items:center; min-height:36px; }
#checkInForm .checkin-check .form-check { margin:0; }
#checkInForm .visitor-photo-preview { margin-top:1.25rem; }

/* The returning-visitor search stays on one line: label, query, Clear and the help icon.
   site.js moves the hint into the icon's tooltip, so the raw note is hidden only while it is
   still a direct child of the row. */
#checkInForm .visitor-lookup { display:flex; align-items:center; gap:.4rem; }
#checkInForm .visitor-lookup > .form-label { margin:0; white-space:nowrap; font-size:.74rem; }
#checkInForm .visitor-lookup > .form-control { flex:1 1 auto; min-width:0; height:36px; }
#checkInForm .visitor-lookup > .btn { height:36px; display:inline-flex; align-items:center; padding:0 .6rem; font-size:.78rem; }
#checkInForm .visitor-lookup > .form-text { display:none; }
#checkInForm .visitor-lookup .info-tip { margin:0; }
@media(max-width:991.98px){
    #checkInForm .checkin-grid { grid-template-columns:1fr; }
    #checkInForm .checkin-grid > * { grid-column:auto; }
    #checkInForm .visitor-floating > .form-control,
    #checkInForm .visitor-floating > .form-select { min-height:40px; height:40px; }
}

/* Check-in form: one card with three labelled blocks. Hairline rules and a small caption replace
   the boxed headers that used to sit between the groups, so the arrival reads as one surface
   instead of three competing panels. */
.visitor-page--checkin .checkin-section + .checkin-section { margin-top:8px; padding-top:12px; border-top:1px solid #e3eaf4; }
.visitor-page--checkin .checkin-section-title {
    display:flex; align-items:center; gap:8px; margin:2px 0 5px;
    font-size:.66rem; font-weight:700; letter-spacing:.07em; text-transform:uppercase; color:#3f6fb5;
}
.visitor-page--checkin .checkin-section-title::after { content:""; flex:1 1 auto; height:1px; background:#e3eaf4; }

/* Check-in desktop density: one step below the shared visitor density, so the arrival form and
   the request list fit a 768px-high screen without scrolling. Scoped to the page modifier and
   to >=992px, where fields no longer need to be touch-sized; phones keep the rules above. */
@media(min-width:992px){
    .visitor-page--checkin .visitor-hero { padding:4px 12px; margin-bottom:.5rem!important; }
    .visitor-page--checkin #checkInForm .card-header,
    .visitor-page--checkin #requestsCard .card-header { padding:4px 9px; font-size:.8rem; }
    .visitor-page--checkin #checkInForm .checkin-card .card-body { padding:7px 9px 6px; }
    .visitor-page--checkin .checkin-section + .checkin-section { margin-top:5px; padding-top:10px; }
    .visitor-page--checkin .checkin-section-title { margin-bottom:4px; }
    .visitor-page--checkin #checkInForm .checkin-grid { gap:.18rem .35rem; }
    .visitor-page--checkin #checkInForm .visitor-floating > .form-control,
    .visitor-page--checkin #checkInForm .visitor-floating > .form-select {
        min-height:34px; height:34px; padding:.36rem .5rem .12rem;
    }
    .visitor-page--checkin #checkInForm .visitor-floating > textarea.form-control { min-height:46px; height:46px; }
    .visitor-page--checkin #checkInForm .checkin-check { min-height:34px; }
    .visitor-page--checkin #checkInForm .visitor-lookup > .form-control,
    .visitor-page--checkin #checkInForm .visitor-lookup > .btn { height:34px; }
    .visitor-page--checkin #checkInForm .visitor-photo-preview { margin-top:0; }
    /* The lookup help icon sits at the right edge of the row: its bubble would otherwise extend
       past the viewport (adding a horizontal scrollbar) even while hidden. Open it inward. */
    .visitor-page--checkin #checkInForm .visitor-lookup .info-tip-bubble { left:auto; right:0; }
    .visitor-page--checkin #checkInForm .visitor-lookup .info-tip-bubble::before { left:auto; right:9px; }
    .visitor-page--checkin .visitor-save-bar { padding:6px 8px!important; }
    .visitor-page--checkin #requestsCard .card-body { padding:8px; }
    .visitor-page--checkin #requestsCard .tab-content { padding-top:.35rem!important; }
}
