/* TransferTicketEntity: restrained Material-style UI for GLPI's ticket tab. */
.tt-transfer-card {
    --tt-primary: #1f4e79;
    --tt-primary-hover: #173d60;
    --tt-text: #1f2937;
    --tt-muted: #64748b;
    --tt-border: #d7dee8;
    box-sizing: border-box;
    width: min(100%, 820px);
    margin: 1.25rem auto;
    padding: clamp(1rem, 3vw, 1.75rem);
    color: var(--tt-text);
    background: #fff;
    border: 1px solid #e1e7ef;
    border-radius: 16px;
    box-shadow: 0 3px 12px rgba(25, 42, 62, 0.08);
    font-family: inherit;
}

.tt-transfer-card *,
.tt-modal * {
    box-sizing: border-box;
}

.tt-transfer-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid #e7ebf0;
}

.tt-transfer-header h2,
.tt-modal-header h2 {
    margin: 0;
    color: #173d60;
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    font-weight: 650;
    line-height: 1.3;
}

.tt-transfer-header p:not(.tt-transfer-eyebrow) {
    margin: 0.3rem 0 0;
    color: var(--tt-muted);
    line-height: 1.5;
}

.tt-transfer-icon,
.tt-modal-icon {
    display: inline-grid;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    place-items: center;
    color: var(--tt-primary);
    background: #eaf1f8;
    border-radius: 12px;
    font-size: 1.35rem;
}

.tt-transfer-icon-warning {
    color: #8a5b00;
    background: #fff4d6;
}

.tt-transfer-eyebrow {
    margin: 0 0 0.2rem;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tt-transfer-source {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.35rem 1rem;
    margin: 1rem 0 1.2rem;
    padding: 0.75rem 0.9rem;
    color: #334155;
    background: #f6f8fb;
    border: 1px solid #e4e9f0;
    border-radius: 10px;
    font-size: 0.9rem;
}

.tt-transfer-source strong {
    color: #173d60;
}

.tt-transfer-source-entity {
    color: var(--tt-muted);
    overflow-wrap: anywhere;
}

.tt-transfer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.tt-field {
    min-width: 0;
}

.tt-field label {
    display: block;
    margin: 0 0 0.45rem;
    color: #344256;
    font-size: 0.9rem;
    font-weight: 600;
}

.tt-field select,
.tt-field textarea {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 0.65rem 0.75rem;
    color: #1f2937;
    background-color: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    font: inherit;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.tt-field textarea {
    min-height: 118px;
    resize: vertical;
    line-height: 1.5;
}

.tt-field select:focus,
.tt-field textarea:focus {
    outline: none;
    border-color: #3975ad;
    box-shadow: 0 0 0 3px rgba(57, 117, 173, 0.16);
}

.tt-field select:disabled {
    color: #64748b;
    background: #f4f6f8;
    cursor: not-allowed;
}

.tt-field small {
    display: block;
    margin-top: 0.4rem;
    color: #6b7788;
    font-size: 0.78rem;
    line-height: 1.45;
}

.tt_group_choice[hidden] {
    display: none !important;
}

.tt-transfer-note,
.tt-modal-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-top: 1.1rem;
    padding: 0.8rem 0.9rem;
    color: #42536a;
    background: #f4f7fa;
    border: 1px solid #e1e8ef;
    border-radius: 9px;
    font-size: 0.84rem;
    line-height: 1.5;
}

.tt-transfer-note > i,
.tt-modal-warning > i {
    flex: 0 0 auto;
    margin-top: 0.1rem;
    color: var(--tt-primary);
    font-size: 1.05rem;
}

.tt-transfer-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.15rem;
}

.tt-btn {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.65rem 1.05rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.tt-btn:focus-visible,
.tt-modal-close:focus-visible {
    outline: 3px solid rgba(57, 117, 173, 0.32);
    outline-offset: 2px;
}

.tt-btn-primary {
    color: #fff !important;
    background: var(--tt-primary, #1f4e79);
    border-color: var(--tt-primary, #1f4e79);
}

.tt-btn-primary:hover:not(:disabled) {
    background: #173d60;
    border-color: #173d60;
}

.tt-btn-primary:disabled {
    color: #64748b !important;
    background: #e8edf2;
    border-color: #d8e0e8;
    cursor: not-allowed;
}

.tt-btn-secondary {
    color: #334155 !important;
    background: #fff;
    border-color: #cbd5e1;
}

.tt-btn-secondary:hover {
    background: #f6f8fa;
    border-color: #aab7c7;
}

.tt-transfer-empty {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
}

.tt-transfer-empty h3 {
    margin: 0 0 0.3rem;
    color: #173d60;
    font-size: 1.05rem;
}

.tt-transfer-empty p {
    margin: 0;
    color: var(--tt-muted, #64748b);
    line-height: 1.5;
}

.tt-transfer-nojs {
    width: min(100%, 820px);
    margin: 1rem auto;
    padding: 0.75rem 1rem;
    color: #784d00;
    background: #fff8e6;
    border: 1px solid #f1d58e;
    border-radius: 9px;
}

.tt-transfer-nojs p {
    margin: 0;
}

.tt-transfer-ready .tt-transfer-nojs {
    display: none;
}

/* Native dialog provides focus handling; the backdrop dims and blurs GLPI. */
.tt-modal {
    width: min(560px, calc(100vw - 28px));
    max-width: 560px;
    max-height: min(92dvh, 820px);
    margin: auto;
    padding: 0;
    overflow: visible;
    color: #1f2937;
    background: transparent;
    border: 0;
    border-radius: 16px;
}

.tt-modal::backdrop {
    background: rgba(15, 23, 42, 0.48);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.tt-modal-card {
    display: flex;
    max-height: min(92dvh, 820px);
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 16px;
    box-shadow: 0 20px 56px rgba(15, 23, 42, 0.28);
    animation: tt-modal-in 150ms ease-out;
}

.tt-modal-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1.1rem 1.2rem;
    border-bottom: 1px solid #e7ebf0;
}

.tt-modal-header .tt-modal-icon {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
    font-size: 1.15rem;
}

.tt-modal-close {
    display: inline-grid;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    place-items: center;
    margin-left: auto;
    color: #64748b;
    background: transparent;
    border: 0;
    border-radius: 8px;
    font-size: 1.5rem;
    cursor: pointer;
}

.tt-modal-close:hover {
    color: #1f2937;
    background: #f1f4f7;
}

.tt-modal-content {
    padding: 1.1rem 1.2rem;
    overflow-y: auto;
}

.tt-destination-summary {
    display: grid;
    gap: 0.25rem;
    margin-bottom: 0.9rem;
    padding: 0.8rem 0.9rem;
    background: #f5f8fb;
    border: 1px solid #dce5ee;
    border-left: 3px solid #1f4e79;
    border-radius: 8px;
}

.tt-summary-label {
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tt-destination-summary strong {
    color: #24364b;
    font-size: 0.92rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.tt-modal-copy {
    margin: 0 0 1rem;
    color: #64748b;
    font-size: 0.86rem;
    line-height: 1.5;
}

.tt-justification textarea {
    min-height: 132px;
}

.tt-modal-warning {
    margin-top: 0.85rem;
    background: #fbfcfd;
}

.tt-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    padding: 0.95rem 1.2rem 1.1rem;
    border-top: 1px solid #e7ebf0;
}

@keyframes tt-modal-in {
    from { opacity: 0; transform: translateY(8px) scale(0.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 640px) {
    .tt-transfer-card {
        margin: 0.75rem 0;
        padding: 1rem;
        border-radius: 12px;
    }

    .tt-transfer-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .tt-transfer-source {
        flex-direction: column;
    }

    .tt-modal {
        width: calc(100vw - 20px);
        max-height: 94dvh;
    }

    .tt-modal-card {
        max-height: 94dvh;
        border-radius: 13px;
    }

    .tt-modal-header,
    .tt-modal-content {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .tt-modal-footer {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .tt-modal-footer .tt-btn {
        flex: 1 1 0;
        padding-right: 0.65rem;
        padding-left: 0.65rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tt-modal-card { animation: none; }
    .tt-btn,
    .tt-field select,
    .tt-field textarea { transition: none; }
}

/* Existing TransferTicketEntity profile tab styles. */
.tt_profile_border-top {
    background: var(--tblr-border-color-light);
}

.tt_profile_border-top h4 {
    color: #626976;
    font-size: 0.875rem;
    line-height: 1.4285714286;
}

.tt_profile_tab_bg_2 {
    width: 40%;
}
