/* PM24 V299 — Critical fixes + premium mobile consolidation */
:root{--v299-blue:#0877ff;--v299-pink:#ed3f86;--v299-ink:#12345d;--v299-soft:#f5f8fd}
.pm24-v299-mobile-logo{display:block;width:94px;height:30px;object-fit:contain}
.owner-mobile-brand{display:flex!important;align-items:center;justify-content:center;min-width:110px}
.owner-sidebar-property-mini.has-cover{overflow:hidden;padding:0!important;background:#fff!important}
.owner-sidebar-property-mini.has-cover img{width:100%;height:100%;object-fit:cover;display:block}
.v299-receipt-logo{display:block;width:72px;height:34px;object-fit:contain}
.v299-receipt-logo-wrap{display:grid!important;place-items:center!important;background:#fff!important;overflow:hidden}
.v299-receipt-meta-value{margin-top:4px}
.v299-all-read{display:inline-flex;align-items:center;min-height:40px;padding:8px 13px;border-radius:999px;background:#ecfdf3;color:#087342;font-weight:850;font-size:13px}
.v299-subscription-price-note,.v299-due-hint,.v299-early-checkin-warning{display:grid;gap:5px;padding:12px 14px;border:1px solid #cfe0f6;border-radius:14px;background:#f4f8ff;color:#173866}
.v299-subscription-price-note span,.v299-due-hint,.v299-early-checkin-warning span{font-size:13px;color:#516984}
.v299-early-checkin-warning{grid-column:1/-1;border-color:#f2bf66;background:#fff9e9;color:#7b4d00}
.pm24-source-pill.is-refund{background:#fff0f3!important;color:#b01848!important;border-color:#f4bdd0!important}
.v299-friendly-error{max-width:620px;margin:48px auto}

/* More premium compact owner metrics */
.owner-simple-stat-cards,.owner-stat-cards,.summary-grid{gap:10px!important}
.owner-simple-stat-cards>*,.owner-stat-cards>*,.summary-grid>*{border-radius:16px!important;box-shadow:0 8px 24px rgba(14,54,105,.07)!important}

/* Force-close details behaves as a safe modal on small screens */
@media(max-width:700px){
  .staff-duty-live-card details[open]{position:fixed!important;inset:0!important;z-index:5000!important;display:grid!important;place-items:center!important;padding:16px!important;background:rgba(5,18,42,.58)!important;overflow:auto!important}
  .staff-duty-live-card details[open]>summary{display:none!important}
  .staff-duty-live-card details[open]>form{width:min(100%,420px)!important;max-height:calc(100dvh - 32px)!important;overflow:auto!important;margin:auto!important;padding:18px!important;border-radius:20px!important;background:#fff!important;box-shadow:0 28px 80px rgba(0,0,0,.28)!important}
  .staff-duty-live-card details[open]>form:before{content:'Force close duty';display:block;margin-bottom:12px;font-size:20px;font-weight:900;color:#9f1239}
  .staff-duty-live-card details[open] textarea{min-height:120px!important}
}

/* Owner OTP: use full mobile width, never collapse into a narrow column */
@media(max-width:760px){
 .pm24-otp-shell{padding:12px!important;min-height:100dvh!important;display:block!important}
 .pm24-otp-frame{display:grid!important;grid-template-columns:1fr!important;width:100%!important;max-width:520px!important;margin:0 auto!important;gap:12px!important}
 .pm24-otp-visual{padding:18px!important;border-radius:22px!important;min-width:0!important}
 .pm24-otp-visual>div:not(.pm24-otp-badges){display:none!important}
 .pm24-otp-brand{display:flex!important;justify-content:center!important}
 .pm24-owner-otp-logo{width:112px!important;height:44px!important;object-fit:contain!important}
 .pm24-otp-badges{display:flex!important;flex-wrap:wrap!important;gap:6px!important}
 .pm24-otp-card{width:100%!important;min-width:0!important;padding:20px 16px!important;border-radius:22px!important}
 .pm24-otp-copy,.pm24-otp-note{white-space:normal!important;word-break:normal!important;line-height:1.55!important}
 .pm24-otp-input,.pm24-otp-submit,.pm24-otp-secondary{width:100%!important;max-width:none!important;min-width:0!important;white-space:normal!important;word-break:normal!important}
 .pm24-otp-submit,.pm24-otp-secondary{min-height:48px!important;padding:12px!important;font-size:15px!important}
}

/* Selected guest detail first on mobile */
@media(max-width:760px){
 .ops-two-column.has-detail{display:flex!important;flex-direction:column!important}
 .ops-two-column.has-detail [data-v299-selected-guest-detail]{order:-1!important;width:100%!important;max-height:none!important;position:relative!important;inset:auto!important;margin-bottom:12px!important}
 .ops-two-column.has-detail .ops-list-panel{order:2!important;max-height:52dvh!important}
}

/* Mobile tables become readable cards instead of squeezed columns */
@media(max-width:760px){
 .app-room-inventory .data-table,.app-properties .data-table,.app-staff-duty .data-table,.subscription-history-section .data-table{display:block!important;width:100%!important}
 .app-room-inventory .data-table thead,.app-properties .data-table thead,.app-staff-duty .data-table thead,.subscription-history-section .data-table thead{display:none!important}
 .app-room-inventory .data-table tbody,.app-properties .data-table tbody,.app-staff-duty .data-table tbody,.subscription-history-section .data-table tbody{display:grid!important;gap:10px!important}
 .app-room-inventory .data-table tr,.app-properties .data-table tr,.app-staff-duty .data-table tr,.subscription-history-section .data-table tr{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px 12px!important;padding:14px!important;border:1px solid #dbe5f2!important;border-radius:16px!important;background:#fff!important}
 .app-room-inventory .data-table td,.app-properties .data-table td,.app-staff-duty .data-table td,.subscription-history-section .data-table td{display:block!important;min-width:0!important;padding:0!important;border:0!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;font-size:13px!important}
 .app-room-inventory .data-table td:last-child,.app-properties .data-table td:last-child,.app-staff-duty .data-table td:last-child,.subscription-history-section .data-table td:last-child{grid-column:1/-1!important}
 .table-wrap{overflow:visible!important}
}

/* Group category and room allotment mobile fixes */
@media(max-width:650px){
 .g-category-compact{grid-template-columns:1fr!important;gap:9px!important}
 .g-category-main b{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;line-height:1.3!important}
 .g-qty{grid-template-columns:1fr 90px!important;align-items:center!important}
 .g-allot-submit{padding-bottom:calc(18px + env(safe-area-inset-bottom))!important}
 .g-summary{grid-template-columns:1fr 1fr!important;gap:8px!important}
 .g-summary>div{min-width:0!important}
}

/* Booking forms */
@media(max-width:650px){
 .v101-form div:has(>b+label input[type=radio]){display:grid!important;gap:8px!important}
 .v101-form div:has(input[name=checkout_mode]) label{display:flex!important;align-items:center!important;gap:9px!important;min-height:42px!important;padding:9px 11px!important;border:1px solid #dbe5f2!important;border-radius:12px!important}
 .v101-form input[type=radio]{width:18px!important;height:18px!important;margin:0!important}
 .v101-form textarea[name=rate_override_reason]{min-height:94px!important;white-space:normal!important}
 .v101-card b,.g-card b{overflow-wrap:anywhere!important}
 .v101-side,.g-side{background:#fff!important;opacity:1!important}
}

/* Premium compact dashboard cards: 3 per row at 390+, 2 below */
@media(max-width:760px){
 .owner-simple-stat-cards,.owner-stat-cards{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:8px!important}
 .owner-simple-stat-cards>*,.owner-stat-cards>*{min-width:0!important;padding:11px 9px!important;min-height:86px!important}
 .owner-simple-stat-cards strong,.owner-stat-cards strong,.owner-simple-stat-cards b,.owner-stat-cards b{font-size:20px!important;line-height:1.1!important}
 .owner-simple-stat-cards span,.owner-stat-cards span{font-size:11px!important}
 .owner-mobile-bar{height:58px!important;padding:8px 12px!important}
 .owner-page{padding-top:10px!important}
 .owner-summary-grid,.owner-business-snapshot-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
 .owner-summary-grid>*:first-child{grid-column:span 2!important}
 .owner-floating-chat,.pm24-floating-chat,[class*=floating-chat]{right:14px!important;bottom:calc(76px + env(safe-area-inset-bottom))!important;transform:none!important;z-index:70!important}
}
@media(max-width:365px){.owner-simple-stat-cards,.owner-stat-cards{grid-template-columns:repeat(2,minmax(0,1fr))!important}}

/* Reports compact but readable */
@media(max-width:650px){
 .stay-report-actions .btn,.report-actions .btn,.history-row a{min-height:40px!important;padding:8px 10px!important;font-size:12px!important}
 .history-row{gap:6px!important;overflow-x:auto!important;scrollbar-width:thin}
 .stay-report-summary,.report-summary-grid{gap:8px!important}
 .stay-report-summary>*{padding:11px!important;min-height:76px!important}
 .daily-owner-report,.report-print-sheet{font-size:13px!important;line-height:1.45!important}
 .daily-owner-report .overall-source-breakup{display:block!important;width:100%!important}
}

/* Safer/editable modals */
@media(max-width:650px){
 dialog,.modal,.owner-modal,[role=dialog]{max-width:calc(100vw - 20px)!important;max-height:calc(100dvh - 20px)!important}
 .staff-edit-modal,.staff-access-modal{overflow:auto!important;padding-bottom:88px!important}
 .staff-edit-modal .modal-actions,.staff-access-modal .modal-actions{position:sticky!important;bottom:0!important;display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important;padding:10px!important;background:#fff!important}
}

/* Receipt preview and success-page top controls */
@media(max-width:650px){
 .gcis-top-actions,.guest-checkin-success .top-actions{position:static!important;display:grid!important;grid-template-columns:repeat(2,1fr)!important;gap:7px!important;margin:8px 0!important}
 .receipt-total>div{min-width:0!important}
 .receipt-total span{display:block!important;margin-top:4px!important}
}

/* Inputs and branding polish */
input,select,textarea{min-width:0}
.owner-upload-control input[type=file]{max-width:100%}
.v299-image-preview{width:100%;height:150px;object-fit:cover;border-radius:16px;border:1px solid #dbe5f2;margin-top:8px;background:#f5f8fd}
.v299-subscription-price-note{grid-column:1/-1}
.v299-receipt-logo-wrap img{max-width:100%;max-height:100%}
