/* ============================================================================
   Tenants workspace (Relocation Assistant → Tenants chip → tenant detail tab).

   The rel-* rules below are copied verbatim from the <style> block in
   RelocationAssistant.razor so ManageTenantForm and DynamicSurveyChip render the same
   outside the assistant. That file is NOT modified -- it keeps its own inline copy.

   Auto-extracted from the rel-* tokens those components (and their children) reference.
   ============================================================================ */

.rel-modal-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .55);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1050;
        padding: 20px;
        animation: rel-modal-fade .15s ease-out;
}

.rel-modal-wide {
        width: min(96vw, 1080px) !important;
}

.rel-modal {
        width: min(94vw, 720px);
        max-height: 92vh;
        display: flex;
        position: relative;
        flex-direction: column;
        background: var(--bs-body-bg);
        color: var(--bs-body-color);
        border: 1px solid var(--bs-border-color);
        border-radius: 16px;
        box-shadow: 0 20px 60px rgba(0,0,0,.25), 0 4px 12px rgba(0,0,0,.1);
        overflow: hidden;
        animation: rel-modal-pop .18s ease-out;
}

.rel-modal-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        padding: 18px 20px 14px;
        border-bottom: 1px solid var(--bs-border-color);
}

.rel-modal-header-left {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        min-width: 0;
}

.rel-modal-icon {
        flex: 0 0 auto;
        width: 38px;
        height: 38px;
        border-radius: 10px;
        background: rgba(var(--bs-primary-rgb), .12);
        color: var(--bs-primary);
        display: inline-flex;
        align-items: center;
        justify-content: center;
}

.rel-modal-title {
        margin: 0;
        font-size: 17px;
        font-weight: 700;
        color: var(--bs-body-color);
        line-height: 1.2;
}

.rel-modal-subtitle {
        margin-top: 3px;
        font-size: 12.5px;
        color: var(--bs-secondary-color, var(--bs-secondary));
}

.rel-modal-close {
        appearance: none;
        background: transparent;
        border: 0;
        width: 32px;
        height: 32px;
        border-radius: 8px;
        color: var(--bs-secondary-color, var(--bs-secondary));
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: background-color .15s ease, color .15s ease;
}

.rel-modal-close:hover:not(:disabled) {
        background: rgba(var(--bs-secondary-bg-rgb, 233, 236, 239), .8);
        color: var(--bs-body-color);
}

.rel-modal-close:disabled { opacity: .5; cursor: not-allowed;
}

.rel-modal-body {
        padding: 18px 20px;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        gap: 16px;
        flex: 1 1 auto;
        min-height: 0;
}

.rel-modal-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px;
}

.rel-modal-field {
        display: flex;
        flex-direction: column;
        gap: 6px;
        min-width: 0;
}

.rel-modal-label {
        font-size: 12px;
        font-weight: 600;
        letter-spacing: .2px;
        color: var(--bs-body-color);
        text-transform: uppercase;
}

.rel-modal-select-wrap { position: relative;
}

.rel-modal-select {
        width: 100%;
        appearance: none;
        -webkit-appearance: none;
        padding: 10px 36px 10px 12px;
        border-radius: 10px;
        border: 1px solid var(--bs-border-color);
        background: var(--bs-body-bg);
        color: var(--bs-body-color);
        font-size: 13.5px;
        line-height: 1.3;
        cursor: pointer;
        accent-color: var(--bs-primary);
        transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.rel-modal-select option {
        background: var(--bs-body-bg);
        color: var(--bs-body-color);
}

.rel-modal-select option:checked {
        background: rgba(var(--bs-primary-rgb), .15);
        color: var(--bs-primary);
}

.rel-modal-select:hover:not(:disabled) {
        border-color: var(--bs-primary);
}

.rel-modal-select:focus {
        outline: none;
        border-color: var(--bs-primary);
        box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), .18);
}

.rel-modal-select:disabled {
        background: rgba(var(--bs-secondary-bg-rgb, 233, 236, 239), .4);
        cursor: not-allowed;
        opacity: .8;
}

.rel-modal-select-chevron {
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        pointer-events: none;
        color: var(--bs-secondary-color, var(--bs-secondary));
}

.rel-modal-units-state {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 24px;
        font-size: 13px;
        color: var(--bs-secondary-color, var(--bs-secondary));
        border: 1px dashed var(--bs-border-color);
        border-radius: 12px;
}

.rel-modal-units-empty {
        font-style: italic;
}

.rel-modal-spinner {
        width: 16px;
        height: 16px;
        border-radius: 50%;
        border: 2px solid rgba(var(--bs-primary-rgb), .25);
        border-top-color: var(--bs-primary);
        animation: rel-modal-spin .7s linear infinite;
}

.rel-modal-spinner-sm {
        width: 12px;
        height: 12px;
        border-width: 2px;
        border-color: rgba(255,255,255,.4);
        border-top-color: var(--bs-body-bg, #fff);
}

.rel-modal-alert {
        padding: 11px 13px;
        border-radius: 10px;
        font-size: 13px;
        line-height: 1.45;
        display: flex;
        align-items: flex-start;
        gap: 8px;
}

.rel-modal-alert-error {
        background: rgba(var(--bs-danger-rgb, 220, 53, 69), .1);
        color: var(--bs-danger, #842029);
        border: 1px solid rgba(var(--bs-danger-rgb, 220, 53, 69), .25);
}

.rel-modal-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 14px 20px;
        border-top: 1px solid var(--bs-border-color);
        background: rgba(var(--bs-secondary-bg-rgb, 233, 236, 239), .35);
}

.rel-modal-footer-hint {
        font-size: 12.5px;
        color: var(--bs-secondary-color, var(--bs-secondary));
}

.rel-modal-footer-actions {
        display: inline-flex;
        gap: 8px;
}

.rel-modal-btn {
        appearance: none;
        border: 1px solid transparent;
        padding: 9px 16px;
        border-radius: 10px;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        transition: background-color .15s ease, border-color .15s ease, color .15s ease, filter .15s ease;
}

.rel-modal-btn:disabled {
        opacity: .55;
        cursor: not-allowed;
}

.rel-modal-btn-ghost {
        background: transparent;
        border-color: var(--bs-border-color);
        color: var(--bs-body-color);
}

.rel-modal-btn-ghost:hover:not(:disabled) {
        background: rgba(var(--bs-secondary-bg-rgb, 233, 236, 239), .7);
}

.rel-modal-btn-primary {
        background: var(--bs-primary);
        border-color: var(--bs-primary);
        color: #fff;
}

.rel-modal-btn-primary:hover:not(:disabled) {
        filter: brightness(.93);
}

.rel-delete-confirm-overlay {
        position: absolute;
        inset: 0;
        z-index: 200;
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(3px);
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: inherit;
}

.rel-delete-confirm-box {
        max-width: 400px;
        width: 90%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        padding: 28px 24px;
        background: var(--bs-body-bg);
        border: 1px solid rgba(var(--bs-danger-rgb, 220,38,38), .3);
        border-radius: 14px;
        box-shadow: 0 8px 32px rgba(0,0,0,.14);
        text-align: center;
}

.rel-delete-confirm-icon {
        width: 52px;
        height: 52px;
        border-radius: 50%;
        background: rgba(var(--bs-danger-rgb, 220,38,38), .1);
        color: var(--bs-danger, #dc2626);
        display: flex;
        align-items: center;
        justify-content: center;
}

.rel-delete-confirm-title {
        font-size: 16px;
        font-weight: 700;
        color: var(--bs-body-color);
}

.rel-delete-confirm-msg {
        font-size: 13px;
        color: var(--bs-secondary-color);
        line-height: 1.5;
}

.rel-delete-confirm-warning {
        font-size: 12px;
        color: var(--bs-body-color);
        background: var(--app-warning-soft, #fffbeb);
        border: 1px solid var(--app-warning-border, #fcd34d);
        border-radius: 8px;
        padding: 10px 14px;
        line-height: 1.5;
        text-align: left;
}

.rel-delete-confirm-actions {
        display: flex;
        gap: 10px;
        justify-content: center;
        margin-top: 4px;
}

@media (max-width: 640px) {
    .rel-modal { border-radius: 14px;
    }
    .rel-modal-grid { grid-template-columns: 1fr;
    }
    .rel-modal-footer { flex-direction: column; align-items: stretch;
    }
    .rel-modal-footer-actions { justify-content: flex-end;
    }
}

.rel-modal-section-title {
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .5px;
        text-transform: uppercase;
        color: var(--bs-secondary-color, var(--bs-secondary));
        margin: 2px 0 -4px;
        padding-bottom: 6px;
        border-bottom: 1px solid var(--bs-border-color);
}

.rel-modal-required {
        color: var(--bs-danger, #dc3545);
        margin-left: 2px;
}

.rel-modal-optional {
        font-weight: 400;
        color: var(--bs-secondary-color, var(--bs-secondary));
        text-transform: none;
        letter-spacing: 0;
        margin-left: 4px;
}

.rel-modal-input {
        width: 100%;
        padding: 10px 12px;
        border-radius: 10px;
        border: 1px solid var(--bs-border-color);
        background: var(--bs-body-bg);
        color: var(--bs-body-color);
        font-size: 13.5px;
        line-height: 1.3;
        transition: border-color .15s ease, box-shadow .15s ease;
}

.rel-modal-input:hover:not(:disabled) {
        border-color: var(--bs-primary);
}

.rel-modal-input:focus {
        outline: none;
        border-color: var(--bs-primary);
        box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), .18);
}

.rel-modal-input:disabled {
        background: rgba(var(--bs-secondary-bg-rgb, 233, 236, 239), .4);
        cursor: not-allowed;
        opacity: .8;
}

@media (max-width: 560px) {
    .rel-modal-backdrop { padding: 0; align-items: stretch;
    }
    .rel-modal {
                width: 100%;
                height: 100dvh;
                max-height: 100dvh;
                border-radius: 0;
                border-width: 0;
    }
}

.rel-modal-checkbox {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 13px;
        color: var(--bs-body-color);
        cursor: pointer;
        padding-top: 6px;
}

.rel-modal-checkbox input[type="checkbox"] {
        width: 16px;
        height: 16px;
        cursor: pointer;
}

.rcd-value > .rel-modal-input,
    .rcd-value > .rel-modal-select { width: 100%;
}

.rel-survey-breadcrumb {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 2px;
        font-size: 12.5px;
        color: var(--bs-secondary-color);
}

.rel-survey-breadcrumb-link {
        background: none;
        border: 0;
        padding: 0;
        color: var(--bs-primary);
        font-weight: 600;
        cursor: pointer;
}

.rel-survey-breadcrumb-link:hover:not(:disabled) { text-decoration: underline;
}

.rel-survey-breadcrumb-link:disabled { opacity: 0.5; cursor: not-allowed;
}

.rel-survey-breadcrumb-sep { color: var(--bs-secondary-color);
}

.rel-survey-breadcrumb-current {
        font-weight: 600;
        color: var(--bs-body-color);
}

.rel-survey-list-controls {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 10px;
}

@media (min-width: 760px) {
    .rel-survey-list-controls { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
    }
}

.rel-survey-list-control { display: flex; flex-direction: column; gap: 4px;
}

.rel-survey-list-control-download { justify-content: flex-end;
}

.rel-survey-action-btn {
        padding: 4px 10px;
        font-size: 12px;
        min-height: 26px;
        line-height: 1;
}

.rel-survey-table-wrap {
        border: 1px solid var(--bs-border-color);
        border-radius: 10px;
        overflow: hidden;
        background: var(--bs-body-bg);
        /* overflow:hidden zeroes this item's automatic flex min-height, so in the
           .rel-modal-body column it was the only sibling allowed to shrink below its
           content — it silently clipped rows with no scrollbar while everything above
           it (dev picker, manager summary) kept full size. flex-shrink:0 stops that;
           .rel-modal-body's own overflow-y:auto then scrolls the real overflow. */
        flex-shrink: 0;
}

.rel-survey-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 13px;
}

.rel-survey-table thead th {
        text-align: left;
        padding: 10px 12px;
        background: rgba(var(--bs-primary-rgb), 0.05);
        font-weight: 700;
        font-size: 11px;
        color: var(--bs-secondary-color);
        text-transform: uppercase;
        letter-spacing: 0.04em;
        border-bottom: 1px solid var(--bs-border-color);
        white-space: nowrap;
}

.rel-survey-table tbody td {
        padding: 10px 12px;
        border-bottom: 1px solid var(--bs-border-color);
        vertical-align: middle;
}

.rel-survey-table tbody tr:last-child td { border-bottom: 0;
}

.rel-survey-row { cursor: pointer; transition: background-color 0.12s ease;
}

.rel-survey-row:hover { background: rgba(var(--bs-primary-rgb), 0.04);
}

.rel-survey-table-truncate {
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
}

.rel-survey-table-action-col { text-align: right;
}

.rel-survey-pager {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding-top: 12px;
        flex-wrap: wrap;
}

.rel-survey-pager-info {
        font-size: 12.5px;
        color: var(--bs-secondary-color);
}

.rel-survey-pager-controls { display: flex; gap: 4px;
}

.rel-survey-pager-btn {
        min-width: 32px;
        height: 30px;
        padding: 0 8px;
        border-radius: 6px;
        border: 1px solid var(--bs-border-color);
        background: var(--bs-body-bg);
        font-size: 12.5px;
        color: var(--bs-body-color);
        cursor: pointer;
        transition: all 0.12s ease;
}

.rel-survey-pager-btn:hover:not(:disabled) {
        background: rgba(var(--bs-primary-rgb), 0.08);
        border-color: var(--bs-primary);
}

.rel-survey-pager-btn:disabled { opacity: 0.5; cursor: not-allowed;
}

.rel-modal-backdrop-stacked {
        z-index: 1080 !important;
}

.rel-modal-btn-sm {
        padding: 4px 8px;
        font-size: 12px;
        line-height: 1;
}

.rel-survey-picker { padding: 8px 0 16px 0;
}

.rel-survey-picker-cards {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        margin-top: 8px;
}

@media (max-width: 800px) {
    .rel-survey-picker-cards { grid-template-columns: 1fr;
    }
}

.rel-survey-picker-card {
        text-align: left;
        background: var(--bs-body-bg, #fff);
        border: 1px solid var(--bs-border-color, #e5e7eb);
        border-radius: 8px;
        padding: 16px;
        cursor: pointer;
        transition: border-color 0.15s, box-shadow 0.15s, transform 0.05s;
}

.rel-survey-picker-card:hover {
        border-color: var(--bs-primary);
        box-shadow: 0 2px 8px rgba(var(--bs-primary-rgb), 0.12);
}

.rel-survey-picker-card:active { transform: translateY(1px);
}

.rel-survey-picker-card h4 { margin: 0; font-size: 14px; color: var(--bs-body-color, #111827);
}

.rel-survey-picker-card p { margin: 8px 0 0 0; font-size: 13px; color: var(--bs-secondary-color, #4b5563); line-height: 1.5;
}

.rel-survey-picker-card-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
}

.rel-modal-body .rel-modal-section-title {
        margin: 18px -20px 14px -20px;
        padding: 12px 20px 11px 20px;
        background: linear-gradient(180deg, var(--bs-tertiary-bg, #f8fafc) 0%, var(--bs-tertiary-bg, #f1f5f9) 100%);
        border-top: 1px solid var(--bs-border-color, #e2e8f0);
        border-bottom: 1px solid var(--bs-border-color, #e2e8f0);
        font-size: 13px;
        font-weight: 600;
        color: var(--bs-body-color, #0f172a);
        letter-spacing: 0.01em;
}

.rel-modal-body .rel-modal-section-title:first-of-type {
        margin-top: 4px;
}

.rel-modal-input {
        border: 1px solid var(--bs-border-color, #d1d5db);
        border-radius: 6px;
        padding: 8px 12px;
        font-size: 14px;
        background: var(--bs-body-bg, #fff);
        transition: border-color 0.15s, box-shadow 0.15s;
}

.rel-modal-input:focus {
        outline: none;
        border-color: var(--bs-primary);
        box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.18);
}

.rel-survey-picker { padding: 4px 0 16px 0;
}

.rel-survey-picker-cards {
        margin-top: 12px;
}

.rel-survey-picker-card {
        background: var(--bs-body-bg, #fff);
        border: 1px solid var(--bs-border-color, #e2e8f0);
        border-radius: 10px;
        padding: 18px;
        text-align: left;
        cursor: pointer;
        transition: border-color 0.15s, box-shadow 0.15s, transform 0.06s;
}

.rel-survey-picker-card:hover {
        border-color: var(--bs-primary);
        box-shadow: 0 6px 18px rgba(var(--bs-primary-rgb), 0.18);
}

.rel-survey-picker-card h4 {
        margin: 0;
        font-size: 14px;
        font-weight: 600;
        color: var(--bs-body-color, #0f172a);
        flex: 1;
}

.rel-survey-picker-card p {
        margin: 10px 0 0 0;
        font-size: 12.5px;
        line-height: 1.55;
        color: var(--bs-secondary-color, #475569);
}

@keyframes rel-modal-fade {
        from { opacity: 0; }
        to   { opacity: 1; }
}

@keyframes rel-modal-pop {
        from { opacity: 0; transform: translateY(8px) scale(.98); }
        to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes rel-modal-spin {
        to { transform: rotate(360deg); }
}
