/* Promotion module styling, ported from the approved HPN Promotion.html design.
   Scoped under .promotion-page (rather than :root) so it never touches
   the rest of this app's global theme. */
.promotion-page {
    --orange:        #FFB70F;
    --blue:          #5D92F4;
    --blue-hover:    #4A7AD9;
    --ink:           #333;
    --muted:         #727891;
    --border:        #EBEDF2;
    --field-bg:      #FAFAFA;
    --section-bg:    #F4F7FA;
    --section-border:#EBEDF2;
    --green:         #00D014;
    --red:           #FF3739;
    --card-shadow:   0 1px 15px 1px rgba(69,65,78,0.08);

    /* inherit the app's Bootstrap font like the Rate Plan pages */
    color: var(--ink);
    font-size: 14px;
}
.promotion-page * { box-sizing: border-box; }

/* CARD */
.promotion-page .card { border: 1px solid #ddd; border-radius: 4px; margin-bottom: 20px; background: #fff; overflow: hidden; box-shadow: 0 1px 1px rgba(0,0,0,.05); }
.promotion-page .card-head { background: #f5f5f5; padding: 10px 15px; font-weight: 700; font-size: 16px; color: var(--ink); border-bottom: 1px solid #ddd; }
.promotion-page .card-body { padding: 15px; }

/* FIELDS */
.promotion-page .field { background: #fff; border: 1px solid #ccc; border-radius: 4px; padding: 6px 12px; height: 34px; font: inherit; font-size: 14px; line-height: 1.42857143; color: #555; width: 100%; box-shadow: inset 0 1px 1px rgba(0,0,0,.075); }
.promotion-page .req { color: var(--red); margin-left: 2px; }

/* Jump-to-field highlight after a failed save validation */
.promotion-page .field.field-error { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255,55,57,.12); }
.promotion-page ms-dropdown.field-error .ms-field { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255,55,57,.12); }
.promotion-page .room-chips { display: flex; flex-wrap: wrap; gap: 14px 22px; }
.promotion-page .room-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; user-select: none; }
.promotion-page .room-chip input { width: 15px; height: 15px; accent-color: var(--blue); }

/* Form grid (identity fields) */
.promotion-page .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 48px; align-items: start; }
.promotion-page .form-row { display: grid; grid-template-columns: 170px 1fr; gap: 14px; align-items: center; }
.promotion-page .form-row.full { grid-column: 1 / -1; }
.promotion-page .lbl-r { text-align: right; font-weight: 700; color: #333; font-size: 14px; }


/* Sections */
.promotion-page .pd-section { border-top: 1px solid var(--border); padding-top: 18px; margin-top: 18px; }
.promotion-page .pd-section.first { border-top: none; padding-top: 2px; margin-top: 6px; }
.promotion-page .pd-section-head { font-size: 16px; font-weight: 700; color: var(--ink); }
.promotion-page .pd-section-sub { font-size: 12.5px; color: var(--muted); margin: 4px 0 18px; }
.promotion-page .pd-row { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: center; margin-bottom: 14px; }
.promotion-page .pd-row.top { align-items: flex-start; }
.promotion-page .pd-row .lbl { font-size: 14px; font-weight: 700; color: var(--ink); }
.promotion-page .pd-hint { font-size: 11.5px; color: #8a93a5; margin-top: 6px; }
.promotion-page .pd-los { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.promotion-page .pd-los select { max-width: 170px; }
.promotion-page .pd-los .sep { color: var(--muted); font-size: 13px; }
.promotion-page .opt-tag { display: inline-block; margin-left: 8px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: #8a93a5; background: #eef1f5; border: 1px solid #e2e6ec; border-radius: 999px; padding: 2px 9px; }

/* Promotion Type condition cards */
.promotion-page .module-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.promotion-page .module-card { background: #fff; border: 1.5px solid var(--border); border-radius: 8px; padding: 12px 15px; cursor: pointer; text-align: left; transition: all .15s; font: inherit; }
.promotion-page .module-card:hover { border-color: var(--blue); box-shadow: 0 4px 12px rgba(93,146,244,.16); }
.promotion-page .module-card.sel { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue) inset, 0 6px 16px rgba(93,146,244,.20); }
.promotion-page .mc-title { font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.promotion-page .mc-sub { font-size: 12.5px; color: var(--muted); line-height: 1.45; }

.promotion-page .sub-panel { margin-top: 16px; background: #fcfdff; border: 1px solid #d8e3f0; border-radius: 8px; padding: 15px; max-width: 680px; }
.promotion-page .sub-label { font-size: 11.5px; font-weight: 700; color: #5a6772; text-transform: uppercase; margin-bottom: 10px; }
.promotion-page .subseg { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.promotion-page .subseg button { background: #fff; border: 1px solid #ccc; border-radius: 4px; padding: 6px 12px; font: inherit; font-size: 14px; font-weight: 400; color: #333; cursor: pointer; }
.promotion-page .subseg button.active { background: #5cb85c; border-color: #4cae4c; color: #fff; }
.promotion-page .val-row { display: grid; grid-template-columns: 210px 1fr; gap: 14px; align-items: center; margin-bottom: 14px; }
.promotion-page .val-row .ctl { display: flex; align-items: center; gap: 8px; }
.promotion-page .val-row .ctl input.field { max-width: 140px; }
.promotion-page .val-suffix { font-size: 12.5px; color: var(--muted); }
.promotion-page .cond-field, .promotion-page .disc-group, .promotion-page .bonus-group, .promotion-page .los-group, .promotion-page .res-group { margin-bottom: 18px; }
.promotion-page .res-grid { display: flex; flex-direction: column; gap: 12px; max-width: 560px; }
.promotion-page .res-pair { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; }
.promotion-page .res-f { display: flex; flex-direction: column; gap: 6px; }
.promotion-page .res-f label { font-size: 12px; font-weight: 600; color: #5a6772; }
.promotion-page .res-f input.field { max-width: none; }
.promotion-page .res-chk { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink); background: #fff; border: 1px solid #ccc; border-radius: 4px; padding: 6px 12px; cursor: pointer; }
.promotion-page .res-chk input { width: 16px; height: 16px; accent-color: var(--blue); }

/* Booking / Stay period */
.promotion-page .wb-dates { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.promotion-page .wb-field { display: flex; flex-direction: column; gap: 5px; }
.promotion-page .wb-field label { font-size: 12px; color: #667085; font-weight: 600; }
.promotion-page .date-wrap { position: relative; display: inline-flex; align-items: center; width: 100%; max-width: 100%; }
.promotion-page .date-wrap input { flex: 1; padding-right: 38px !important; }
.promotion-page .date-wrap .cal-btn { position: absolute; right: 1px; top: 1px; bottom: 1px; width: 34px; border: none; background: transparent; color: #666; font-size: 16px; cursor: pointer; border-left: 1px solid #ccc; display: inline-flex; align-items: center; justify-content: center; border-radius: 0 4px 4px 0; }
.promotion-page .date-wrap .cal-btn:hover { color: var(--blue); }
.promotion-page .wb-dow .wb-dow-label { font-size: 12px; color: #667085; font-weight: 600; margin-bottom: 10px; }

/* Blackout */
.promotion-page .bo-explicit { display: flex; flex-direction: column; gap: 14px; max-width: 780px; }
.promotion-page .bo-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.promotion-page .bo-line-label { font-size: 13px; font-weight: 600; color: var(--ink); min-width: 150px; }
.promotion-page .bo-sub { font-size: 12.5px; color: var(--muted); }
.promotion-page .bo-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.promotion-page .bo-chip { display: inline-flex; align-items: center; gap: 7px; background: #FCE6E6; color: #b23030; border: 1px solid #f0c4c4; border-radius: 4px; padding: 3px 7px 3px 9px; font-size: 12px; font-weight: 600; }
.promotion-page .bo-chip .x { cursor: pointer; font-weight: 700; font-size: 14px; }
.promotion-page .bo-empty { color: #a33; font-size: 11.5px; font-style: italic; }

/* Inclusions */
.promotion-page .incl-add { display: flex; gap: 8px; }
.promotion-page .incl-box { border: 1px solid var(--border); border-radius: 8px; background: #fcfdff; padding: 12px; min-height: 46px; display: flex; flex-direction: column; gap: 8px; max-width: 520px; }
.promotion-page .incl-box .incl-empty { color: #aaa; font-size: 12.5px; font-style: italic; }
.promotion-page .incl-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff; border: 1px solid #e3e9f0; border-radius: 6px; padding: 8px 12px; font-size: 13px; color: var(--ink); }
.promotion-page .incl-item .it-desc { color: #667085; }
.promotion-page .incl-item .x { cursor: pointer; color: #5a7ca8; font-weight: 700; font-size: 16px; }

/* Publishing / status switch */
.promotion-page .pub-row { display: flex; align-items: center; gap: 14px; }
.promotion-page .pub-label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.promotion-page .status-switch { position: relative; width: 52px; height: 28px; border-radius: 999px; background: var(--green); cursor: pointer; transition: background .15s; display: inline-block; flex: none; }
.promotion-page .status-switch::after { content: ""; position: absolute; top: 3px; left: 27px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s; }
.promotion-page .status-switch.off { background: #c4c4c4; }
.promotion-page .status-switch.off::after { left: 3px; }
.promotion-page .pub-state { font-size: 13px; font-weight: 700; }
.promotion-page .pub-state.on { color: #2E7D32; }
.promotion-page .pub-state.off { color: #8a93a5; }

/* Save bar */
.promotion-page .cancel-save-bar { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 10px; padding-top: 15px; border-top: 1px dashed #d8d8d8; flex-wrap: wrap; }
.promotion-page .cp-btn { display: inline-block; padding: 6px 12px; background: #337ab7; color: #fff; border: 1px solid #2e6da4; border-radius: 4px; font: inherit; font-weight: 400; font-size: 14px; line-height: 1.42857143; text-align: center; white-space: nowrap; cursor: pointer; }
.promotion-page .cp-btn:hover { background: #286090; border-color: #204d74; }
.promotion-page .cp-btn:disabled { opacity: .65; cursor: not-allowed; }
.promotion-page .cp-btn.outline { background: #fff; color: #333; border: 1px solid #ccc; }
.promotion-page .cp-btn.outline:hover { background: #e6e6e6; border-color: #adadad; }

/* List page uses the app's own Bootstrap look (same as the Rate Plan list); only the cell widgets below are custom. */
.promotion-list-page { --blue: #5D92F4; --ink: #464D69; --muted: #727891; --border: #EBEDF2; --red: #FF3739; }
.promotion-list-page .promo-sortable { cursor: pointer; user-select: none; }
.promotion-list-page .switch { vertical-align: middle; margin: 0; }
.promotion-list-page .promo-life { margin-left: 8px; }

/* ===== List view widgets ===== */

.promotion-page .tag-pill, .promotion-list-page .tag-pill { display: inline-block; background: #EEF2F7; color: #475569; border: 1px solid #e2e8f0; border-radius: 6px; padding: 5px 11px; font-size: 12.5px; font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.promotion-page .tag-pill.sm, .promotion-list-page .tag-pill.sm { padding: 3px 8px; font-size: 11.5px; margin-right: 4px; }

/* Selected Rate Plans — count pill + hover popover. The popover itself is
   appended to <body> by ratePlanPopover.directive.js (position: fixed), not
   nested in the table cell, so its rules are intentionally unscoped here —
   .promotion-page's overflow-x:auto table wrapper would otherwise clip it
   (per spec, overflow-x:auto on one axis forces the other axis to auto too). */
.promotion-page .rp-count-badge, .promotion-list-page .rp-count-badge { position: relative; font-family: inherit; font-weight: 600; background: var(--section-bg); color: var(--blue); border-color: #cfe0f7; cursor: default; }
.promotion-page .rp-count-badge.none, .promotion-list-page .rp-count-badge.none { color: var(--muted); background: #F4F4F5; border-color: #e5e5e8; }
.rp-pop { min-width: 200px; max-width: 280px; background: #fff; border: 1px solid #EBEDF2; border-radius: 8px; box-shadow: 0 10px 24px rgba(16,24,40,.14); font-family: 'Heebo', system-ui, sans-serif; }
.rp-pop-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: #667085; font-weight: 700; padding: 10px 13px 8px; border-bottom: 1px solid #F0F2F6; }
.rp-pop ul { margin: 0; list-style: none; padding: 5px; max-height: 200px; overflow-y: auto; }
.rp-pop li { font-size: 12.5px; font-weight: 500; color: #464D69; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 6px 8px; }
.rp-pop li.rp-empty { color: #727891; font-style: italic; white-space: normal; }

/* Promotion Type pill + Stay Period day-of-week mini row (list view) */
.promotion-page .type-cell, .promotion-list-page .type-cell { display: flex; flex-direction: column; gap: 6px; }
.promotion-page .mod-pill, .promotion-list-page .mod-pill { align-self: flex-start; display: inline-flex; align-items: center; padding: 3px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .01em; background: #EEF2F7; color: #475569; }
.promotion-page .mod-pill.standard, .promotion-list-page .mod-pill.standard { background: #EAF4FB; color: #1E5C9A; }
.promotion-page .mod-pill.earlybird, .promotion-list-page .mod-pill.earlybird { background: #E0F8F5; color: #0d6b62; }
.promotion-page .mod-pill.lastminute, .promotion-list-page .mod-pill.lastminute { background: #FFF1DE; color: #8a4a14; }
.promotion-page .mod-pill.bonusnight, .promotion-list-page .mod-pill.bonusnight { background: #E8F6EA; color: #2b6b2b; }
.promotion-page .mod-pill.longstay, .promotion-list-page .mod-pill.longstay { background: #EFE9FB; color: #5b3fa8; }
.promotion-page .mod-leaf, .promotion-list-page .mod-leaf { font-size: 12px; color: var(--muted); }
.promotion-page .win-cell.single, .promotion-list-page .win-cell.single { display: flex; flex-direction: column; gap: 6px; min-width: 160px; }
.promotion-page .win-cell .win-dates, .promotion-list-page .win-cell .win-dates { font-size: 13px; color: var(--ink); font-weight: 500; }
.promotion-page .dow-mini, .promotion-list-page .dow-mini { display: inline-flex; gap: 3px; }
.promotion-page .dow-mini span, .promotion-list-page .dow-mini span { width: 18px; height: 18px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; background: #eef1f5; color: #b3bcc9; }
.promotion-page .dow-mini span.on, .promotion-list-page .dow-mini span.on { background: var(--blue); color: #fff; }

/* Status life label (LIVE / INACTIVE / EXPIRED) next to the toggle switch */
.promotion-page .promo-life, .promotion-list-page .promo-life { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 3px 9px; border-radius: 5px; vertical-align: middle; }
.promotion-page .promo-life.live, .promotion-list-page .promo-life.live { background: #E1F5E5; color: #2E7D32; }
.promotion-page .promo-life.expired, .promotion-list-page .promo-life.expired { background: #FCE6E6; color: #b23030; }
.promotion-page .promo-life.inactive, .promotion-list-page .promo-life.inactive { background: #ECEEF1; color: #7a8294; }

/* Dropdown-chip multiselect (Rate Plans / Room Categories), ported from the design */
.promotion-page .ms { position: relative; max-width: 520px; }
.promotion-page .ms-field { min-height: 34px; border: 1px solid #ccc; border-radius: 4px; background: #fff; padding: 6px 34px 6px 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; cursor: pointer; position: relative; }
.promotion-page .ms-field:hover { border-color: var(--blue); }
.promotion-page .ms-field.open { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(93,146,244,.15); }
.promotion-page .ms-field::after { content: ""; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid #8a93a5; pointer-events: none; }
.promotion-page .ms-placeholder { color: #aaa; font-size: 13px; padding: 3px 2px; }
.promotion-page .ms-tag { display: inline-flex; align-items: center; gap: 7px; background: #EAF4FB; color: #1a4870; border: 1px solid #c5dcef; border-radius: 4px; padding: 3px 7px 3px 9px; font-size: 12px; font-weight: 600; }
.promotion-page .ms-tag .x { cursor: pointer; color: #5a7ca8; font-weight: 700; font-size: 14px; line-height: 1; }
.promotion-page .ms-tag .x:hover { color: var(--red); }
.promotion-page .ms-tag-warn { background: #EDEDED; color: #777; border-color: #d8d8d8; }
.promotion-page .ms-tag-warn .x { color: #888; }
.promotion-page .ms-list { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40; background: #fff; border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 260px; overflow-y: auto; padding: 4px 0; }
.promotion-page .ms-opt { display: flex; align-items: center; gap: 10px; padding: 9px 14px; cursor: pointer; font-size: 13px; color: var(--ink); }
.promotion-page .ms-opt:hover { background: #F4F7FA; }
.promotion-page .ms-opt input { accent-color: var(--blue); width: 15px; height: 15px; }
.promotion-page .ms-opt .o-sub { color: #999; font-size: 12px; margin-left: auto; }
.promotion-page .ms-opt .o-sub-warn { color: var(--red); font-weight: 600; }
.promotion-page .ms-opt .o-type { color: var(--muted); font-weight: 600; }
.promotion-page .ms-empty { padding: 16px; text-align: center; color: #999; font-size: 12.5px; }
.promotion-page .ms-allrow { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid #eef1f5; position: sticky; top: 0; background: #fff; z-index: 2; }
.promotion-page .ms-allrow a { color: var(--blue); font-size: 12px; font-weight: 700; cursor: pointer; }
.promotion-page .ms-allrow a:hover { text-decoration: underline; }
.promotion-page .ms-allrow .sep { color: #d0d5dd; }
