/* =========================================================================
   INVENTORY PAGE STYLES
   Ported from the Lovable Tailwind prototype to plain CSS so the markup
   stays clean and MudBlazor doesn't fight us. Class names are prefixed
   with `inv-` to avoid colliding with the rest of the app.
   ========================================================================= */

/* ─── Page shell ────────────────────────────────────────────────── */
.inv-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #0f172a;
}

.inv-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.inv-page-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 30px;
    font-weight: 400;
    margin: 0;
    color: #000000;
}

.inv-icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }
.inv-muted { color: #94a3b8; }
.inv-text-muted { color: #94a3b8; font-size: 11px; }
.inv-text-blue { color: #2563eb; }
.inv-text-orange { color: #ea580c; font-weight: 500; }
.inv-required { color: #f43f5e; margin-left: 2px; }


/* ─── Toolbar ───────────────────────────────────────────────────── */
.inv-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 8px;
    background: linear-gradient(to right, #f8fafc, rgba(239, 246, 255, 0.5));
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    /* Sit above the dropdown backdrop so the triggers stay clickable (single-click switching)
       while an outside click on the backdrop closes the open menu. This also caps the panel's
       stacking context below the modal overlay (1000) so a dropdown never covers a modal. */
    position: relative;
    z-index: 900;
}

.inv-toolbar-spacer { flex: 1; }


/* ─── Dropdown button ───────────────────────────────────────────── */
.inv-dropdown { position: relative; }

.inv-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 13px;
    min-width: 170px;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: background-color 0.15s, border-color 0.15s;
}

.inv-dropdown-trigger:hover { background: rgba(241, 245, 249, 0.5); }

.inv-dropdown-trigger.is-primary {
    background: linear-gradient(to right, #3b82f6, #2563eb);
    color: #fff;
    border-color: #3b82f6;
}

.inv-dropdown-trigger.is-primary:hover {
    background: linear-gradient(to right, #2563eb, #1d4ed8);
}

.inv-dropdown-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.inv-dropdown-icon-text { font-size: 12px; }
.inv-dropdown-caret { font-size: 9px; opacity: 0.7; }

.inv-dropdown-panel {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    width: 288px;
    max-height: 384px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    z-index: 9999;
    padding: 6px 0;
}


/* ─── Menu items ────────────────────────────────────────────────── */
.inv-menu-section {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: none;
}

.inv-menu-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 12px;
    font-size: 13px;
}

.inv-menu-item.is-toggle { cursor: pointer; }
.inv-menu-item:hover { background: #f1f5f9; }

.inv-menu-check {
    width: 16px;
    flex-shrink: 0;
    display: inline-flex;
    justify-content: center;
}

.inv-menu-label { flex: 1; }


/* ─── Platform pill (read-only) ─────────────────────────────────── */
.inv-platform {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 13px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.inv-platform-label { color: #94a3b8; font-size: 11px; }

.inv-platform-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    background: #0073b1;
    color: #fff;
    font-weight: 600;
    font-size: 11px;
    border-radius: 4px;
}

.inv-platform-monogram {
    width: 14px;
    height: 14px;
    background: #fff;
    color: #0073b1;
    font-weight: 900;
    font-size: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
}


/* ─── Toolbar buttons ──────────────────────────────────────────── */
.inv-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s;
}

.inv-btn-bulk {
    background: linear-gradient(to right, #3b82f6, #2563eb);
    color: #fff;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.inv-btn-bulk:hover {
    background: linear-gradient(to right, #2563eb, #1d4ed8);
}

.inv-btn-save {
    background: linear-gradient(to right, #10b981, #059669);
    color: #fff;
}

.inv-btn-save:hover {
    background: linear-gradient(to right, #059669, #047857);
}

.inv-btn-editor {
    background: #fff;
    color: #0f172a;
    border-color: #e2e8f0;
    padding: 8px 12px;
}

.inv-btn-editor:hover { background: #f1f5f9; }

.inv-btn-editor:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
    cursor: not-allowed;
    opacity: 0.65;
}

.inv-btn-editor.is-on {
    background: linear-gradient(to right, #ef4444, #dc2626);
    color: #fff;
    border-color: #ef4444;
}

.inv-btn-editor.is-on:hover {
    background: linear-gradient(to right, #dc2626, #b91c1c);
}

.inv-editor-check {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    border: 1px solid #94a3b8;
}

.inv-btn-editor.is-on .inv-editor-check {
    background: #fff;
    border-color: #fff;
    color: #ef4444;
}


/* ─── Date navigation ───────────────────────────────────────────── */
.inv-datenav {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.inv-navbtn {
    padding: 8px 10px;
    background: transparent;
    border: none;
    border-right: 1px solid #e2e8f0;
    color: #94a3b8;
    cursor: pointer;
    transition: background 0.15s;
}

.inv-navbtn:hover { background: #f1f5f9; }

.inv-datenav-current {
    padding: 8px 24px;
    font-weight: 600;
    font-size: 13px;
    border-right: 1px solid #e2e8f0;
}

.inv-day-headers {
    flex: 1;
    display: grid;
}

.inv-day-header {
    text-align: center;
    padding: 6px 0;
    border-left: 1px solid #e2e8f0;
    font-size: 11px;
}

.inv-day-header.is-weekend { background: #fff7ed; }

.inv-day-dow { color: #94a3b8; }
.inv-day-number { font-weight: 700; font-size: 16px; line-height: 1; }
.inv-day-number.is-highlight { color: #f97316; }
.inv-day-month { font-size: 10px; color: #94a3b8; }


/* ─── Filter chips ──────────────────────────────────────────────── */
.inv-filter-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.inv-filter-chips-label { font-size: 11px; color: #64748b; font-weight: 500; }

.inv-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid;
}

.inv-chip button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 2px;
    display: inline-flex;
}

.inv-chip-dot { width: 6px; height: 6px; border-radius: 50%; }

.inv-chip.is-amber  { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.inv-chip.is-amber  .inv-chip-dot { background: #f59e0b; }
.inv-chip.is-amber  button { color: #d97706; }

.inv-chip.is-orange { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.inv-chip.is-orange .inv-chip-dot { background: #f97316; }
.inv-chip.is-orange button { color: #ea580c; }

.inv-chip.is-purple { background: #faf5ff; border-color: #e9d5ff; color: #6b21a8; }
.inv-chip.is-purple .inv-chip-dot { background: #a855f7; }
.inv-chip.is-purple button { color: #9333ea; }


/* ─── Legend ────────────────────────────────────────────────────── */
.inv-legend {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 11px;
    color: #64748b;
    flex-wrap: wrap;
}

.inv-legend-label { font-weight: 500; }

.inv-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.inv-legend-swatch {
    width: 12px; height: 12px; border-radius: 3px;
}

.inv-legend-swatch.is-unchanged { background: #fff; border: 1px solid #cbd5e1; }
.inv-legend-swatch.is-changed   { background: #fb923c; }
.inv-legend-swatch.is-nodata    { background: #0f172a; }
.inv-legend-swatch.is-inactive  { background: #cbd5e1; }


/* ─── Room cards / grid ─────────────────────────────────────────── */
.inv-rooms {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 12px;
}

.inv-room-card {
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.inv-room-card.is-inactive {
    border-color: #fcd34d;
    opacity: 0.85;
}

.inv-room-header { display: grid; }

.inv-room-name-cell {
    padding: 8px;
    border-right: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.inv-room-name-cell.is-amber { background: #fffbeb; }

.inv-room-name {
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
}

.inv-room-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inv-room-code { color: #94a3b8; font-weight: 400; }

.inv-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.inv-badge.is-inactive { background: #fde68a; color: #78350f; }
.inv-badge.is-nodates  { background: #ffedd5; color: #9a3412; }

.inv-btn-addrate {
    flex-shrink: 0;
    align-self: flex-start;
    font-size: 11px;
    padding: 6px 10px;
    background: linear-gradient(to right, #3b82f6, #2563eb);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.inv-btn-addrate:hover {
    background: linear-gradient(to right, #2563eb, #1d4ed8);
}

.inv-room-empty-cell {
    border-left: 1px solid #e2e8f0;
    background: rgba(241, 245, 249, 0.4);
}

.inv-room-empty-cell.is-weekend { background: #fff7ed; }

.inv-room-norates {
    border-top: 1px solid #e2e8f0;
    padding: 10px 12px;
    font-size: 11px;
    color: #64748b;
    background: rgba(241, 245, 249, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}


/* ─── Rate rows ─────────────────────────────────────────────────── */
.inv-rate-block { border-top: 1px solid #e2e8f0; }

.inv-rate-grid { display: grid; }

.inv-rate-name-cell {
    padding: 8px;
    border-right: 1px solid #e2e8f0;
    font-size: 11px;
    display: flex;
    align-items: flex-start;
}

.inv-rate-name-cell.is-cyan   { background: #ecfeff; }
.inv-rate-name-cell.is-amber  { background: #fffbeb; }
.inv-rate-name-cell.is-orange { background: #fff7ed; }

.inv-rate-name-content > * { line-height: 1.4; }
.inv-rate-name { font-weight: 500; }
.inv-rate-code { color: #94a3b8; }

.inv-rate-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #10b981;
    color: #fff;
    font-size: 9px;
    border: none;
    margin-left: 4px;
    cursor: pointer;
}

.inv-rate-nodates {
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #c2410c;
    font-weight: 500;
    font-size: 10px;
}

.inv-occupancy-tags {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 10px;
}

.inv-occ-tag {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid;
}

.inv-occ-tag.is-base   { background: #f1f5f9; color: #334155; border-color: #e2e8f0; }
.inv-occ-tag.is-adult  { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.inv-occ-tag.is-child  { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
.inv-occ-tag.is-infant { background: #fdf2f8; color: #be185d; border-color: #fbcfe8; }

.inv-row-label {
    border-right: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
    padding: 6px 8px;
    font-size: 10px;
    font-weight: 600;
    color: #64748b;
    background: rgba(241, 245, 249, 0.3);
    display: flex;
    align-items: center;
}

.inv-row-cell {
    border-left: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
    /* Center vertically too: row height is driven by the taller rate-name cell. */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6px 0;
    font-size: 11px;
    position: relative;
}

.inv-row-cell.is-weekend { background: #fff7ed; }

.inv-cell-corner {
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-top: 8px solid #ef4444;
    border-left: 8px solid transparent;
}


/* ─── Allocation pill colours ──────────────────────────────────── */
.inv-alloc-pill {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding: 4px 0;
    font-size: 11px;
    font-weight: 600;
}

.inv-alloc-pill.is-unchanged { background: #fff; color: #1e293b; border: 1px solid #e2e8f0; }
.inv-alloc-pill.is-changed   { background: #fb923c; color: #fff; }
.inv-alloc-pill.is-nodata    { background: #0f172a; color: #fff; }
.inv-alloc-pill.is-inactive  { background: #cbd5e1; color: #475569; }


/* ─── Rate cells (prices + extras) ─────────────────────────────── */
.inv-rate-cell-inner {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}

.inv-rate-price { font-size: 13px; }

.inv-rate-extras {
    font-size: 9px;
    color: #94a3b8;
    margin-top: 2px;
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.inv-extra-adult  { color: #2563eb; display: inline-flex; align-items: center; gap: 2px; }
.inv-extra-child  { color: #7c3aed; display: inline-flex; align-items: center; gap: 2px; }
.inv-extra-infant { color: #db2777; display: inline-flex; align-items: center; gap: 2px; }

.inv-rate-edit-btn {
    width: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 4px;
    border-radius: 4px;
}

.inv-rate-edit-btn:hover { background: #eff6ff; }

.inv-rate-edit-pencil {
    color: #94a3b8;
    opacity: 0;
    transition: opacity 0.15s;
}

.inv-rate-edit-btn:hover .inv-rate-edit-pencil { opacity: 1; }

.inv-log-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #94a3b8;
}

.inv-log-btn:hover { color: #0f172a; }


/* ─── Floating save bar ────────────────────────────────────────── */
.inv-floating-save {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 12px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
    z-index: 30;
}

/* padding-right matches the toolbar's 8px inner padding so the bottom toggle shares the
   top button's right axis. */
.inv-page-footer {
    display: flex;
    justify-content: flex-end;
    padding: 8px 8px 0 0;
    margin-bottom: 24px;
}

/* Reserve space for the fixed save bar, which only appears while the editor is on. */
.inv-page-footer.has-floating-bar {
    margin-bottom: 72px;
}


/* ─── Buttons (modal-shared) ───────────────────────────────────── */
.inv-btn-primary, .inv-btn-secondary, .inv-btn-success, .inv-btn-bulk {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s;
}

.inv-btn-primary  { background: #3b82f6; color: #fff; }
.inv-btn-primary:hover { background: #2563eb; }

.inv-btn-primary.is-orange { background: #F69126; color: #fff; }
.inv-btn-primary.is-orange:hover { background: #e07e1a; }

.inv-btn-secondary {
    background: #fff;
    color: #334155;
    border-color: #e2e8f0;
}
.inv-btn-secondary:hover { background: #f8fafc; }

.inv-btn-success {
    background: linear-gradient(to right, #10b981, #059669);
    color: #fff;
}
.inv-btn-success:hover {
    background: linear-gradient(to right, #059669, #047857);
}


/* ─── Modal scaffolding ────────────────────────────────────────── */
.inv-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.inv-modal-overlay-blur {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}

.inv-modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.inv-modal-sm { max-width: 384px; }
.inv-modal-md { max-width: 448px; }
.inv-modal-lg { max-width: 768px; }
.inv-modal-xl { max-width: 896px; }

.inv-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-bottom: 1px solid #f1f5f9;
}

.inv-modal-header.is-dark {
    background: #434343;
    color: #fff;
}

.inv-modal-header h2 { font-size: 14px; font-weight: 500; margin: 0; }

.inv-modal-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}

.inv-modal-close:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }

.inv-bulk-header .inv-modal-close {
    color: #94a3b8;
    padding: 4px;
    border-radius: 8px;
}

.inv-bulk-header .inv-modal-close:hover {
    color: #334155;
    background: #f1f5f9;
}

.inv-modal-body {
    padding: 16px 24px;
    overflow-y: auto;
    flex: 1;
}

.inv-modal-body.is-muted { background: rgba(241, 245, 249, 0.3); }

.inv-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 24px;
    border-top: 1px solid #e2e8f0;
}

.inv-modal-label {
    font-size: 11px;
    color: #64748b;
    display: block;
    margin-bottom: 6px;
}

.inv-modal-input {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 13px;
}

/* Custom numeric stepper (replaces the native number spinner to guarantee one-click = one step). */
.inv-stepper {
    display: flex;
    align-items: stretch;
}

.inv-stepper-input {
    flex: 1;
    min-width: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    text-align: center;
}

.inv-stepper-btn {
    flex-shrink: 0;
    width: 40px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #334155;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}

.inv-stepper-btn:first-child { border-radius: 4px 0 0 4px; }
.inv-stepper-btn:last-child  { border-radius: 0 4px 4px 0; }
.inv-stepper-btn:hover:not(:disabled) { background: #eef2f7; }
.inv-stepper-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.inv-modal-error {
    margin-top: 8px;
    font-size: 12px;
    color: #b91c1c;
}


/* ─── Bulk update modal ────────────────────────────────────────── */
.inv-bulk-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(to right, #f8fafc, #fff);
}

.inv-bulk-header-left { display: flex; align-items: center; gap: 12px; }

.inv-bulk-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.inv-bulk-icon.is-emerald {
    background: linear-gradient(135deg, #10b981, #059669);
}

.inv-bulk-title { font-size: 15px; font-weight: 600; color: #1e293b; margin: 0; }
.inv-bulk-subtitle { font-size: 11px; color: #64748b; margin: 2px 0 0; }

.inv-bulk-body {
    padding: 24px 28px;
    background: rgba(248, 250, 252, 0.3);
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.inv-bulk-section {
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.inv-bulk-section-title {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 12px;
}

.inv-bulk-field-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.inv-bulk-field-trigger {
    font-weight: 500;
}

.inv-bulk-field-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: #dbeafe;
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.inv-bulk-field-option {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
}

.inv-bulk-field-option:hover { background: #f8fafc; }
.inv-bulk-field-option.is-active { background: rgba(239, 246, 255, 0.6); }

.inv-bulk-field-option-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.inv-bulk-field-option-text {
    flex: 1;
    display: block;
    min-width: 0;
}

.inv-bulk-field-option-name { font-weight: 500; color: #1e293b; }
.inv-bulk-field-option-desc { font-size: 11px; color: #64748b; }

.inv-bulk-field-option-check {
    flex-shrink: 0;
    color: #2563eb;
    display: inline-flex;
    align-items: center;
}

.inv-bulk-field-to { font-size: 13px; color: #64748b; }

.inv-bulk-value-input {
    flex: 1;
    min-width: 200px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
}

.inv-bulk-value-input:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(191, 219, 254, 0.5);
}

.inv-bulk-date-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.inv-bulk-date-row label {
    font-size: 11px;
    color: #475569;
    display: block;
    margin-bottom: 4px;
}

.inv-bulk-date-row input {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    width: 144px;
}

/* Date ranges stack vertically; each range is a self-contained card with its own dates and
   day-of-week selector. */
.inv-bulk-date-ranges {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.inv-bulk-range-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.inv-bulk-range-remove {
    align-self: flex-end;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
    color: #ef4444;
    cursor: pointer;
}

.inv-bulk-range-remove:hover { background: #fef2f2; border-color: #fecaca; }

/* Inline validation message under the date rows (e.g. overlapping ranges). */
.inv-bulk-range-error {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 8px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #b91c1c;
    font-size: 12px;
}

.inv-bulk-dows { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.inv-bulk-dow {
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 500;
    background: #fff;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.inv-bulk-dow:hover { border-color: #cbd5e1; }

.inv-bulk-dow.is-active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.inv-bulk-link {
    color: #2563eb;
    font-size: 11px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

.inv-bulk-link:hover { color: #1d4ed8; }

.inv-bulk-add-range { margin-top: 12px; }

.inv-bulk-divider { color: #cbd5e1; }

.inv-bulk-rooms-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.inv-bulk-rooms-actions { display: flex; align-items: center; gap: 8px; font-size: 11px; }

.inv-bulk-rooms-list {
    display: block;
    max-height: 288px !important;
    overflow-y: scroll;
    padding-right: 4px;
}

.inv-bulk-rooms-list > .inv-bulk-room + .inv-bulk-room {
    margin-top: 8px;
}

.inv-bulk-room {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: all 0.15s;
}

.inv-bulk-room.is-checked {
    border-color: #93c5fd;
    background: rgba(239, 246, 255, 0.3);
}

.inv-bulk-room-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    cursor: pointer;
}

.inv-bulk-room-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
}

.inv-bulk-rates-list {
    border-top: 1px solid #f1f5f9;
    padding: 8px 16px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    background: #fff;
    /* Cap height and scroll within so a room with many rates doesn't compress or push other
       rooms. align-content:start keeps rows at their natural height instead of stretching. */
    max-height: 152px;
    overflow-y: auto;
    align-content: start;
}

@media (min-width: 640px) {
    .inv-bulk-rates-list { grid-template-columns: 1fr 1fr; }
}

.inv-bulk-rate {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    font-size: 12px;
    color: #334155;
}

.inv-bulk-rate input[type="checkbox"] {
    flex-shrink: 0;
    cursor: pointer;
}

.inv-bulk-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 16px 28px;
    border-top: 1px solid #f1f5f9;
    background: #fff;
}

.inv-bulk-footer-actions { display: flex; gap: 8px; }


/* ─── Bulk-update boolean toggle (Stop Sell / CTA / CTD) ───────── */
.inv-bulk-bool-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.inv-bulk-bool-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.inv-bulk-bool-btn:hover { border-color: #cbd5e1; }

.inv-bulk-bool-true.is-active {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}

.inv-bulk-bool-false.is-active {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}


/* ─── Allocation edit button (single edit opens modal) ─────────── */
.inv-alloc-edit-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: #fff;
    color: #1e293b;
    transition: filter 0.15s;
}

.inv-alloc-edit-btn:hover { filter: brightness(0.97); }
.inv-alloc-edit-btn:hover .inv-rate-edit-pencil { opacity: 1; }

.inv-alloc-edit-btn.is-unchanged { background: #fff; color: #1e293b; border-color: #e2e8f0; }
.inv-alloc-edit-btn.is-changed   { background: #fb923c; color: #fff; border-color: #fb923c; }
.inv-alloc-edit-btn.is-nodata    { background: #0f172a; color: #fff; border-color: #0f172a; }
.inv-alloc-edit-btn.is-inactive  { background: #cbd5e1; color: #475569; border-color: #cbd5e1; }


/* ─── Room Rate Config modal extras ─────────────────────────────── */
.inv-rrc-body { padding: 24px 28px; }

.inv-rrc-card {
    border: 1px solid #f1f5f9;
    background: rgba(248, 250, 252, 0.4);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.inv-rrc-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.inv-rrc-field {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: flex-start;
}

@media (min-width: 640px) {
    .inv-rrc-field {
        grid-template-columns: 160px 1fr;
        gap: 16px;
    }
}

.inv-rrc-field > label {
    font-size: 13px;
    color: #334155;
    font-weight: 500;
    padding-top: 8px;
}

.inv-rrc-static { font-size: 13px; font-weight: 500; color: #1e293b; }

.inv-rrc-info-banner {
    border: 1px solid #a7f3d0;
    background: rgba(209, 250, 229, 0.6);
    color: #047857;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    max-width: 28rem;
}

.inv-rrc-currency-input {
    position: relative;
    max-width: 20rem;
}

.inv-rrc-currency {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 13px;
}

.inv-rrc-currency-input .inv-modern-input { padding-left: 28px; }

.inv-modern-input {
    width: 100%;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: #1e293b;
    transition: all 0.15s;
}

.inv-modern-input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}


/* ─── Radio card group ──────────────────────────────────────────── */
.inv-radio-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

@media (min-width: 640px) {
    .inv-radio-cards { grid-template-columns: 1fr 1fr; }
}

.inv-radio-card {
    text-align: left;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    cursor: pointer;
    display: flex;
    gap: 10px;
    transition: all 0.15s;
    font-family: inherit;
}

.inv-radio-card:hover { border-color: #cbd5e1; }

.inv-radio-card.is-active {
    border-color: #10b981;
    background: rgba(209, 250, 229, 0.5);
    box-shadow: 0 0 0 2px rgba(167, 243, 208, 0.5);
}

.inv-radio-card-dot {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.inv-radio-card-dot.is-active { border-color: #10b981; }

.inv-radio-card-dot-inner {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
}

.inv-radio-card-text { display: flex; flex-direction: column; }
.inv-radio-card-label { font-size: 13px; font-weight: 500; color: #1e293b; }
.inv-radio-card-desc { font-size: 11px; color: #64748b; margin-top: 2px; }


/* ─── Adjustment row ────────────────────────────────────────────── */
.inv-adjrow {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.inv-adjrow-toggle {
    display: inline-flex;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 8px;
    padding: 2px;
}

.inv-adjrow-btn {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 500;
    background: transparent;
    color: #475569;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-transform: capitalize;
}

.inv-adjrow-btn:hover:not(.is-increase):not(.is-decrease) { background: #f8fafc; }
.inv-adjrow-btn.is-increase { background: #10b981; color: #fff; }
.inv-adjrow-btn.is-decrease { background: #f43f5e; color: #fff; }

.inv-adjrow-input {
    position: relative;
    flex: 1;
    min-width: 140px;
}

.inv-adjrow-input input {
    width: 100%;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 32px 8px 12px;
    font-size: 13px;
}

.inv-adjrow-suffix {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 13px;
}


/* ─── Audit modal ───────────────────────────────────────────────── */
.inv-audit-header { align-items: flex-start; }
.inv-audit-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; margin: 0; }
.inv-audit-subtitle { font-size: 11px; color: rgba(255, 255, 255, 0.7); margin: 4px 0 0; }

.inv-audit-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: rgba(241, 245, 249, 0.3);
}

.inv-audit-filter-buttons { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

.inv-audit-filter {
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    cursor: pointer;
}

.inv-audit-filter:hover { background: #f1f5f9; }

.inv-audit-filter.is-active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.inv-audit-search {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.inv-audit-search input {
    padding: 4px 8px 4px 28px;
    font-size: 11px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    width: 192px;
}

.inv-audit-search-icon {
    position: absolute;
    left: calc(100% - 192px + 8px);
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    display: inline-flex;
}

.inv-audit-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.inv-audit-empty {
    font-size: 13px;
    color: #64748b;
    text-align: center;
    padding: 48px 0;
}

.inv-audit-group { margin-bottom: 16px; }

.inv-audit-day {
    position: sticky;
    top: 0;
    background: #fff;
    padding: 4px 0;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.inv-audit-timeline {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-left: 2px solid #e2e8f0;
    padding-left: 16px;
    margin-left: 4px;
}

.inv-audit-card {
    position: relative;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px;
    transition: box-shadow 0.15s;
}

.inv-audit-card:hover { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); }

.inv-audit-dot {
    position: absolute;
    left: -22px;
    top: 16px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #3b82f6;
    border: 2px solid #fff;
}

.inv-audit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.inv-audit-change { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.inv-audit-field {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid;
}

.inv-audit-field.is-emerald { background: #d1fae5; color: #047857; border-color: #a7f3d0; }
.inv-audit-field.is-orange  { background: #ffedd5; color: #c2410c; border-color: #fed7aa; }
.inv-audit-field.is-red     { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.inv-audit-field.is-blue    { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.inv-audit-field.is-purple  { background: #e9d5ff; color: #6b21a8; border-color: #e9d5ff; }

.inv-audit-values { font-size: 13px; }
.inv-audit-old { text-decoration: line-through; color: #94a3b8; }
.inv-audit-arrow { margin: 0 6px; color: #94a3b8; }
.inv-audit-new { font-weight: 600; }

.inv-audit-meta {
    font-size: 11px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.inv-audit-user { font-weight: 500; color: #0f172a; }

.inv-audit-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-top: 1px solid #e2e8f0;
    background: rgba(241, 245, 249, 0.3);
}

/* Inventory grid loader */
.inv-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 64px 0;
    color: #64748b;
    font-size: 14px;
}

.inv-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px 0;
    color: #64748b;
    font-size: 14px;
}

.inv-btn-success:disabled,
.inv-btn-secondary:disabled,
.inv-btn-save:disabled,
.inv-btn-bulk:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
