/* =========================================================
   STAY & ROOMS · Allocation Board
   Reuses tokens / components from admin.css + guests.css.
   Adds: properties grid, rooms grid, drop zones, drag-drop
         visuals, picker, conflicts panel.
   ========================================================= */

/* ---------- Stats strip overrides ---------- */
.stay-stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

/* ---------- Toolbar ---------- */
.stay-toolbar-card { padding: 1rem 1.25rem; }
.stay-toolbar { gap: 0.6rem; }

/* ---------- Board layout ---------- */
.stay-board {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}
@media (max-width: 880px) {
    .stay-board { grid-template-columns: 1fr; }
}

/* ---------- Legend ---------- */
.stay-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    font-size: 0.72rem;
    color: #8a8276;
    letter-spacing: 0.04em;
}
.stay-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.stay-legend i {
    width: 9px; height: 9px; border-radius: 50%;
    display: inline-block;
}
.stay-legend .dot-need { background: #f0b157; box-shadow: 0 0 0 3px rgba(240,177,87,0.18); }
.stay-legend .dot-ok   { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.18);  }
.stay-legend .dot-over { background: #ef5a3a; box-shadow: 0 0 0 3px rgba(239,90,58,0.18);  }

/* =========================================================
   GUEST POOL (left column)
   ========================================================= */
.stay-pool {
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 1rem 0.85rem 0.85rem;
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}
.stay-pool-head {
    padding: 0 0.4rem 0.7rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 0.6rem;
}
.stay-pool-head h3 {
    font-family: 'Playfair Display', serif;
    font-weight: 500;
    font-size: 1.05rem;
    color: #f1ead8;
    margin: 0 0 0.15rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.stay-pool-head p { font-size: 0.72rem; color: #8a8276; line-height: 1.4; margin: 0; }

.stay-pool-list { display: flex; flex-direction: column; gap: 0.4rem; }
.stay-pool.is-drop-target { background: rgba(240,177,87,0.08); border-color: rgba(240,177,87,0.45); }

.stay-pool-empty {
    text-align: center;
    padding: 1.4rem 0.5rem 0.6rem;
    color: #8a8276;
}
.stay-pool-empty span { font-size: 1.7rem; display: block; margin-bottom: 0.3rem; }
.stay-pool-empty strong { display: block; font-family: 'Playfair Display', serif; color: #d4af37; font-weight: 500; font-size: 0.95rem; }
.stay-pool-empty small { font-size: 0.7rem; color: #6f6856; }

/* Pool family group separator */
.stay-pool-group {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: #6f6856;
    text-transform: uppercase;
    padding: 0.45rem 0.4rem 0.2rem;
    border-top: 1px dashed rgba(255,255,255,0.05);
    margin-top: 0.3rem;
}
.stay-pool-group:first-child { border-top: 0; margin-top: 0; padding-top: 0.1rem; }

/* =========================================================
   GUEST CHIP (drag source / occupant card)
   ========================================================= */
.stay-chip {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.65rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    cursor: grab;
    transition: transform 0.15s ease, background 0.18s, border-color 0.18s, opacity 0.15s;
    user-select: none;
    -webkit-user-select: none;
}
.stay-chip:hover { background: rgba(255,255,255,0.07); border-color: rgba(212,175,55,0.30); }
.stay-chip:active { cursor: grabbing; }
.stay-chip.dragging { opacity: 0.45; transform: scale(0.97); }

.stay-chip-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(212,175,55,0.40), rgba(193,68,14,0.30));
    color: #fff5d8;
    display: grid; place-items: center;
    font-family: 'Playfair Display', serif;
    font-weight: 500;
    font-size: 0.78rem;
    flex-shrink: 0;
    border: 1px solid rgba(245,217,166,0.25);
}
.stay-chip[data-side="bride"] .stay-chip-avatar { background: linear-gradient(135deg, #b94a73, #7a1620); }
.stay-chip[data-side="groom"] .stay-chip-avatar { background: linear-gradient(135deg, #2f6daa, #1d4063); }
.stay-chip[data-side="both"]  .stay-chip-avatar { background: linear-gradient(135deg, #b08b3e, #6b5325); }

.stay-chip-body { flex: 1; min-width: 0; }
.stay-chip-name {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.84rem;
    color: #f1ead8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stay-chip-meta {
    font-size: 0.68rem;
    color: #8a8276;
    margin-top: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stay-chip-meta b { color: #d4af37; font-weight: 500; }
.stay-chip-meta .plus {
    display: inline-block;
    background: rgba(212,175,55,0.14);
    color: #f0b157;
    font-weight: 600;
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
    font-size: 0.62rem;
    margin-left: 0.3rem;
    letter-spacing: 0.04em;
}
.stay-chip-rsvp {
    width: 5px;
    align-self: stretch;
    border-radius: 3px;
    flex-shrink: 0;
}
.stay-chip-rsvp.confirmed { background: #22c55e; }
.stay-chip-rsvp.declined  { background: #ef5a3a; }
.stay-chip-rsvp.pending   { background: #f0b157; }
.stay-chip-rsvp.maybe     { background: #6b9aff; }

.stay-chip-action {
    background: transparent;
    border: 0;
    color: #6f6856;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.stay-chip-action:hover { background: rgba(255,255,255,0.07); color: #d4af37; }
.stay-chip-action svg { width: 14px; height: 14px; }

/* When chip is inside a room (occupant) */
.stay-chip.is-occupant {
    background: rgba(212,175,55,0.05);
    border-color: rgba(212,175,55,0.18);
}

/* =========================================================
   PROPERTIES (right column)
   ========================================================= */
.stay-props { display: flex; flex-direction: column; gap: 1rem; }

.stay-prop {
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    overflow: hidden;
    position: relative;
}
.stay-prop::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--prop-color, #d4af37);
}

.stay-prop-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.1rem 0.85rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.stay-prop-info { min-width: 0; flex: 1; }
.stay-prop-name {
    font-family: 'Playfair Display', serif;
    font-weight: 500;
    font-size: 1.15rem;
    color: #fff5d8;
    line-height: 1.2;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.stay-prop-type {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: var(--prop-color, #d4af37);
    background: rgba(212,175,55,0.10);
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
    text-transform: uppercase;
    border: 1px solid rgba(212,175,55,0.25);
}
.stay-prop-meta {
    font-size: 0.72rem;
    color: #8a8276;
    line-height: 1.45;
    margin: 0.25rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 1rem;
}
.stay-prop-meta a { color: #d4af37; text-decoration: none; border-bottom: 1px dashed rgba(212,175,55,0.4); }
.stay-prop-meta a:hover { color: #f0b157; }

.stay-prop-stats {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-size: 0.72rem;
    color: #8a8276;
    flex-shrink: 0;
}
.stay-prop-occ {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.6rem;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    font-weight: 600;
    color: #f1ead8;
}
.stay-prop-occ b { color: #d4af37; }
.stay-prop-occ.over { background: rgba(239,90,58,0.10); color: #ff8a73; }
.stay-prop-occ.over b { color: #ff8a73; }
.stay-prop-occ.full { background: rgba(34,197,94,0.10); color: #84e4a3; }
.stay-prop-occ.full b { color: #84e4a3; }

.stay-prop-actions {
    display: flex;
    gap: 0.3rem;
    flex-shrink: 0;
}
.stay-icon-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #8a8276;
    width: 30px; height: 30px;
    border-radius: 8px;
    display: grid; place-items: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.stay-icon-btn:hover { background: rgba(255,255,255,0.06); color: #d4af37; border-color: rgba(212,175,55,0.25); }
.stay-icon-btn svg { width: 14px; height: 14px; }
.stay-icon-btn-danger:hover { background: rgba(239,90,58,0.15); color: #ff8a73; border-color: rgba(239,90,58,0.30); }

.stay-prop-bar {
    height: 4px;
    background: rgba(255,255,255,0.05);
    overflow: hidden;
}
.stay-prop-bar-fill {
    height: 100%;
    background: var(--prop-color, #d4af37);
    transition: width 0.35s ease;
}
.stay-prop-bar-fill.full { background: #22c55e; }
.stay-prop-bar-fill.over { background: #ef5a3a; }

/* Rooms grid */
.stay-rooms {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.7rem;
    padding: 0.85rem 1.1rem 1rem;
}
.stay-rooms-empty {
    padding: 1.4rem;
    text-align: center;
    color: #6f6856;
    font-size: 0.78rem;
}
.stay-rooms-empty button {
    margin-top: 0.6rem;
}

/* =========================================================
   ROOM CARD (drop target)
   ========================================================= */
.stay-room {
    border: 1px dashed rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 0.7rem 0.75rem 0.6rem;
    background: rgba(255,255,255,0.015);
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
    min-height: 110px;
}
.stay-room.is-drop-target {
    border-color: rgba(34,197,94,0.55);
    background: rgba(34,197,94,0.06);
    box-shadow: inset 0 0 0 1px rgba(34,197,94,0.25);
}
.stay-room.is-drop-blocked {
    border-color: rgba(239,90,58,0.55);
    background: rgba(239,90,58,0.06);
}
.stay-room.is-empty { opacity: 0.85; }
.stay-room.is-full  { border-style: solid; border-color: rgba(212,175,55,0.30); background: rgba(212,175,55,0.04); }
.stay-room.is-over  { border-color: rgba(239,90,58,0.50); background: rgba(239,90,58,0.05); }

.stay-room-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
}
.stay-room-num {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    min-width: 0;
}
.stay-room-num strong {
    font-family: 'Playfair Display', serif;
    font-weight: 500;
    font-size: 1rem;
    color: #f1ead8;
    line-height: 1;
}
.stay-room-num span {
    font-size: 0.62rem;
    color: #8a8276;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.stay-room-cap {
    font-size: 0.7rem;
    color: #8a8276;
    background: rgba(255,255,255,0.04);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    white-space: nowrap;
}
.stay-room-cap b { color: #d4af37; }
.stay-room.is-full .stay-room-cap b { color: #84e4a3; }
.stay-room.is-over .stay-room-cap   { background: rgba(239,90,58,0.12); color: #ff8a73; }
.stay-room.is-over .stay-room-cap b { color: #ff8a73; }

.stay-room-meta {
    font-size: 0.68rem;
    color: #6f6856;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.7rem;
}
.stay-room-meta span { display: inline-flex; align-items: center; gap: 0.25rem; }

.stay-room-occupants {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: 0.15rem;
    flex: 1;
}
.stay-room-occupants:empty::before {
    content: 'Empty — drop a guest here';
    display: block;
    text-align: center;
    color: #6f6856;
    font-size: 0.7rem;
    font-style: italic;
    padding: 0.6rem 0.4rem 0.4rem;
    border: 1px dashed rgba(255,255,255,0.07);
    border-radius: 8px;
}

.stay-room-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.25rem;
    gap: 0.4rem;
}
.stay-room-add {
    background: transparent;
    color: #d4af37;
    border: 1px dashed rgba(212,175,55,0.35);
    border-radius: 8px;
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    flex: 1;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.stay-room-add:hover { background: rgba(212,175,55,0.1); color: #f0b157; }
.stay-room-edit {
    background: transparent;
    border: 1px solid transparent;
    color: #6f6856;
    padding: 0.3rem 0.45rem;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}
.stay-room-edit:hover { color: #d4af37; background: rgba(255,255,255,0.04); }
.stay-room-edit svg { width: 13px; height: 13px; vertical-align: middle; }

/* Compact occupant chip inside room */
.stay-room-occupants .stay-chip {
    padding: 0.4rem 0.55rem;
    background: rgba(212,175,55,0.05);
    border-color: rgba(212,175,55,0.18);
}
.stay-room-occupants .stay-chip-name { font-size: 0.78rem; }
.stay-room-occupants .stay-chip-meta { font-size: 0.65rem; }
.stay-room-occupants .stay-chip-avatar { width: 26px; height: 26px; font-size: 0.7rem; }

/* =========================================================
   EMPTY STATE (no properties)
   ========================================================= */
.stay-empty {
    text-align: center;
    padding: 3rem 1.5rem 2.4rem;
    background: rgba(255,255,255,0.02);
    border: 1px dashed rgba(255,255,255,0.08);
    border-radius: 14px;
}
.stay-empty-art { font-size: 2.4rem; margin-bottom: 0.6rem; }
.stay-empty h3 {
    font-family: 'Playfair Display', serif;
    font-weight: 500;
    font-size: 1.25rem;
    color: #d4af37;
    margin-bottom: 0.4rem;
}
.stay-empty p { color: #8a8276; font-size: 0.86rem; margin-bottom: 1.1rem; max-width: 380px; margin-left: auto; margin-right: auto; }

/* =========================================================
   PROPERTY MODAL · color picker
   ========================================================= */
.stay-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding-top: 0.2rem;
}
.stay-colors button {
    width: 24px; height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.12s, border-color 0.15s;
    padding: 0;
}
.stay-colors button:hover { transform: scale(1.1); }
.stay-colors button.is-active { border-color: #fff5d8; transform: scale(1.12); box-shadow: 0 0 0 2px rgba(0,0,0,0.4); }

/* =========================================================
   PICKER MODAL
   ========================================================= */
.stay-picker-body {
    padding: 0.5rem 1.25rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.stay-picker-meta {
    font-size: 0.78rem;
    color: #8a8276;
    line-height: 1.5;
    padding: 0.5rem 0.6rem;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
}
.stay-picker-meta b { color: #f1ead8; font-weight: 600; }
.stay-picker-search {
    position: relative;
    display: flex;
    align-items: center;
}
.stay-picker-search svg { position: absolute; left: 0.7rem; width: 14px; height: 14px; color: #6f6856; }
.stay-picker-search input {
    width: 100%;
    padding: 0.55rem 0.7rem 0.55rem 2rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: #f1ead8;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
}
.stay-picker-search input:focus { outline: none; border-color: rgba(212,175,55,0.5); }

.stay-picker-list {
    max-height: 50vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding-right: 0.2rem;
}
.stay-picker-prop {
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    overflow: hidden;
}
.stay-picker-prop-head {
    padding: 0.55rem 0.75rem;
    background: rgba(255,255,255,0.03);
    font-family: 'Playfair Display', serif;
    color: #f1ead8;
    font-size: 0.92rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}
.stay-picker-prop-head em {
    font-family: 'Inter', sans-serif;
    font-style: normal;
    font-size: 0.7rem;
    color: #8a8276;
    font-weight: 400;
}
.stay-picker-rooms {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.4rem;
    padding: 0.5rem;
}
.stay-picker-room {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    padding: 0.5rem 0.6rem;
    cursor: pointer;
    text-align: left;
    color: #f1ead8;
    transition: background 0.15s, border-color 0.15s, transform 0.12s;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}
.stay-picker-room:hover { background: rgba(212,175,55,0.10); border-color: rgba(212,175,55,0.4); transform: translateY(-1px); }
.stay-picker-room.is-current { border-color: rgba(34,197,94,0.5); background: rgba(34,197,94,0.06); }
.stay-picker-room.is-full { opacity: 0.55; }
.stay-picker-room.is-full:hover { background: rgba(239,90,58,0.10); border-color: rgba(239,90,58,0.35); }
.stay-picker-room strong { font-family: 'Playfair Display', serif; font-weight: 500; font-size: 0.95rem; }
.stay-picker-room small { font-size: 0.65rem; color: #8a8276; }

.stay-picker-foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 0.3rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.stay-picker-foot #pickerUnassignBtn { margin-right: auto; color: #ff8a73; border-color: rgba(239,90,58,0.30); }
.stay-picker-foot #pickerUnassignBtn:hover { background: rgba(239,90,58,0.18); }

/* =========================================================
   CONFLICTS / WARNINGS PANEL
   ========================================================= */
.g-count-pill-warn { background: rgba(239,90,58,0.18); color: #ff8a73; border-color: rgba(239,90,58,0.35); }

.stay-warn-list { display: flex; flex-direction: column; gap: 0.5rem; }
.stay-warn {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.7rem 0.85rem;
    background: rgba(239,90,58,0.06);
    border: 1px solid rgba(239,90,58,0.20);
    border-radius: 10px;
}
.stay-warn.kind-info { background: rgba(240,177,87,0.06); border-color: rgba(240,177,87,0.25); }
.stay-warn-icon {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(239,90,58,0.18);
    color: #ff8a73;
    display: grid; place-items: center;
    flex-shrink: 0;
    font-weight: 700;
}
.stay-warn.kind-info .stay-warn-icon { background: rgba(240,177,87,0.18); color: #f0b157; }
.stay-warn-body { flex: 1; min-width: 0; }
.stay-warn-body strong { display: block; color: #f1ead8; font-size: 0.84rem; margin-bottom: 0.15rem; }
.stay-warn-body p { font-size: 0.72rem; color: #8a8276; margin: 0; line-height: 1.5; }
.stay-warn-action {
    background: transparent;
    color: #d4af37;
    border: 1px solid rgba(212,175,55,0.30);
    border-radius: 8px;
    padding: 0.35rem 0.7rem;
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}
.stay-warn-action:hover { background: rgba(212,175,55,0.12); }

/* =========================================================
   DRAG-AND-DROP visuals
   ========================================================= */
body.is-dragging { cursor: grabbing !important; }
body.is-dragging .stay-room { transition: border-color 0.12s, background 0.12s; }

/* =========================================================
   TOOLTIPS / SMALL UI
   ========================================================= */
.stay-tag {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.12rem 0.4rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    color: #8a8276;
}
.stay-tag.bride { background: rgba(185,74,115,0.18); color: #f0a3bd; }
.stay-tag.groom { background: rgba(47,109,170,0.18); color: #9bbef0; }
.stay-tag.both  { background: rgba(212,175,55,0.18); color: #f0c875; }

/* =========================================================
   MOBILE polish
   ========================================================= */
@media (max-width: 720px) {
    .stay-pool { position: static; max-height: none; }
    .stay-rooms { grid-template-columns: 1fr; }
    .stay-prop-head { flex-wrap: wrap; }
    .stay-prop-stats { order: 3; flex-basis: 100%; justify-content: space-between; }
    .stay-prop-actions { order: 2; }
}
