/* ======================================================================
   LexperDesk — style strony: zgloszenie szczegoly.
   ====================================================================== */

.ld-link {
    color: var(--ld-primary-ink);
    font-weight: 600;
    font-size: 12px;
    text-decoration: none;
}

.ld-link:hover { text-decoration: underline;
}

/* ---------- ticket detail ---------- */
.ld-td-idrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}

.ld-td-idline {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ld-td-key {
    font-size: 16px;
    font-weight: 700;
    color: var(--ld-primary-ink);
    font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
}

.ld-td-actions {
    display: flex;
    gap: 10px;
    flex: 0 0 auto;
}

.ld-td-btn {
    height: 42px;
    padding: 0 18px;
    border-radius: 10px;
    border: 1px solid var(--ld-border);
    background: var(--ld-surface);
    color: var(--ld-text-body);
    font-weight: 600;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
}

.ld-td-btn:hover {
    border-color: var(--ld-text-muted);
}

.ld-td-btn--dark {
    background: var(--ld-c-ink-900);
    border-color: var(--ld-c-ink-900);
    color: var(--ld-c-white);
}

.ld-td-title {
    margin: 4px 0 8px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -.4px;
    color: var(--ld-text-strong);
}

.ld-td-meta {
    margin: 0 0 18px;
    font-size: 14px;
    color: var(--ld-text-muted);
}

/* two-column layout + cards */
.ld-td-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 20px;
    align-items: start;
}

/* details tab */
.ld-td-desc {
    font-size: 14px;
    line-height: 1.7;
    color: var(--ld-text-body);
}

.ld-td-file {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 12px 14px;
    background: var(--ld-c-slate-bg);
    border-radius: 10px;
    cursor: pointer;
}

.ld-td-file__icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--ld-c-blueblk);
    color: var(--ld-primary-ink);
    font-size: 10px;
    font-weight: 700;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.ld-td-file__name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ld-text-strong);
}

.ld-td-file__size {
    margin-top: 2px;
    font-size: 12px;
    color: var(--ld-text-muted);
}

.ld-td-info__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
}

.ld-td-info__row--sep {
    border-top: 1px solid var(--ld-border);
    margin-top: 8px;
    padding-top: 16px;
}

.ld-td-info__block {
    padding: 9px 0;
}

.ld-td-info__k {
    font-size: 13px;
    color: var(--ld-text-muted);
}

.ld-td-info__v {
    font-size: 13px;
    font-weight: 600;
    color: var(--ld-text-strong);
    text-align: right;
}

.ld-td-assignee {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ld-td-sla {
    font-size: 13px;
    font-weight: 600;
    color: var(--ld-text-muted);
}

.ld-td-sla.is-ok {
    color: var(--ld-ok);
}

.ld-td-parts {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

/* conversation tab */
.ld-conv {
    display: flex;
    flex-direction: column;
}

.ld-msg {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
    max-width: 88%;
}

.ld-msg--me {
    align-self: flex-start;
    align-items: flex-start;
}

.ld-msg--agent {
    align-self: flex-end;
    align-items: flex-end;
}

.ld-msg__head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ld-msg--agent .ld-msg__head {
    flex-direction: row-reverse;
}

.ld-msg__name {
    font-size: 13px;
    font-weight: 700;
    color: var(--ld-text-strong);
}

.ld-msg__role {
    font-size: 12px;
    color: var(--ld-text-muted);
}

.ld-msg__bubble {
    padding: 13px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--ld-text-body);
}

.ld-msg--me .ld-msg__bubble {
    background: var(--ld-c-slate-bg);
}

.ld-msg--agent .ld-msg__bubble {
    background: var(--ld-c-blue-bg);
}

.ld-conv-event {
    align-self: center;
    margin: 6px 0 18px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--ld-c-slate-bg);
    color: var(--ld-text-muted);
    font-size: 12px;
}

.ld-conv-input {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--ld-border);
}

.ld-conv-input__add {
    width: 40px;
    height: 44px;
    flex: 0 0 auto;
    border: 1px solid var(--ld-border);
    border-radius: 10px;
    background: var(--ld-c-slate-bg);
    color: var(--ld-text-muted);
    font-size: 18px;
    cursor: pointer;
}

.ld-conv-input__field {
    flex: 1;
    min-width: 0;
    height: 44px;
    border: 1px solid var(--ld-border);
    border-radius: 10px;
    padding: 0 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--ld-text-strong);
    outline: none;
}

.ld-conv-input__field:focus {
    border-color: var(--ld-primary);
}

.ld-conv-input__send {
    height: 44px;
    padding: 0 22px;
    flex: 0 0 auto;
    border: none;
    border-radius: 10px;
    background: var(--ld-primary);
    color: var(--ld-on-primary);
    font-weight: 600;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
}

/* suggested articles */
.ld-sug-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ld-sug-bar {
    width: 4px;
    height: 16px;
    border-radius: 2px;
    background: var(--ld-ok);
}

.ld-sug-intro {
    margin: 0 0 16px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--ld-text-muted);
}

.ld-sug-intro strong {
    color: var(--ld-text-body);
    font-weight: 700;
}

.ld-sug {
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid var(--ld-border);
    border-radius: 12px;
    cursor: pointer;
}

.ld-sug:hover {
    border-color: var(--ld-primary-soft);
}

.ld-sug__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.ld-sug-badge {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 5px;
}

.ld-sug-badge--amber { background: var(--ld-c-amber-bg); color: var(--ld-c-amber-600);
}

.ld-sug-badge--red { background: var(--ld-c-red-bg); color: var(--ld-prio-p1-fg);
}

.ld-sug-badge--lilac { background: var(--ld-c-lilac); color: var(--ld-c-violet-600);
}

.ld-sug__match {
    font-size: 12px;
    font-weight: 600;
    color: var(--ld-ok);
}

.ld-sug__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--ld-text-strong);
    line-height: 1.4;
}

.ld-sug-add {
    width: 100%;
    padding: 12px;
    border: 1.5px dashed var(--ld-border);
    border-radius: 12px;
    background: none;
    color: var(--ld-primary-ink);
    font-weight: 600;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
}

.ld-sug-note {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--ld-c-blue-bg);
    font-size: 13px;
    line-height: 1.5;
    color: var(--ld-text-body);
}

/* history tab */
.ld-hist {
    padding-left: 6px;
}

.ld-hist__entry {
    position: relative;
    padding: 0 0 22px 26px;
    border-left: 2px solid var(--ld-border);
}

.ld-hist__entry:last-child {
    border-left-color: transparent;
    padding-bottom: 0;
}

.ld-hist__dot {
    position: absolute;
    left: -7px;
    top: 1px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--ld-surface);
}

.ld-hist__dot--red { background: var(--ld-danger);
}

.ld-hist__dot--gray { background: var(--ld-c-slate-400);
}

.ld-hist__dot--amber { background: var(--ld-warn);
}

.ld-hist__dot--blue { background: var(--ld-status-progress-fg);
}

.ld-hist__dot--purple { background: var(--ld-c-violet-500);
}

.ld-hist__dot--green { background: var(--ld-ok);
}

.ld-hist__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--ld-text-strong);
}

.ld-hist__badges {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.ld-hist__arrow {
    color: var(--ld-text-muted);
}

.ld-hist__meta {
    margin-top: 4px;
    font-size: 12px;
    color: var(--ld-text-muted);
}

/* ---------- ticket detail: role switch + action buttons ---------- */
.ld-td-roleswitch {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    margin-right: 6px;
    background: var(--ld-c-slate-bg);
    border-radius: 9px;
}

.ld-td-roleswitch button {
    border: none;
    background: transparent;
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    color: var(--ld-text-muted);
    cursor: pointer;
}

.ld-td-roleswitch button.is-active {
    background: var(--ld-surface);
    color: var(--ld-text-strong);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}

.ld-td-btn--primary {
    background: var(--ld-primary);
    border-color: var(--ld-primary);
    color: var(--ld-on-primary);
}

.ld-td-btn--primary:hover {
    border-color: var(--ld-primary);
}

.ld-td-btn--ok {
    background: var(--ld-ok);
    border-color: var(--ld-ok);
    color: var(--ld-c-white);
}

.ld-td-btn--ok:hover {
    border-color: var(--ld-ok);
}

.ld-td-btn--danger {
    color: var(--ld-danger);
    border-color: var(--ld-c-red-200);
}

.ld-td-btn--danger:hover {
    border-color: var(--ld-danger);
}

/* ---------- conversation: action tag ---------- */
.ld-msg-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--ld-c-amber-bg);
    color: var(--ld-c-amber-600);
}

/* ---------- ticket: attachments gallery (obrazy inline) ---------- */
.ld-td-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.ld-td-shot {
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--ld-border);
    border-radius: 10px;
    background: var(--ld-surface);
}

.ld-td-shot img {
    display: block;
    width: 100%;
    height: auto;
}

.ld-td-shot figcaption {
    padding: 8px 10px;
    border-top: 1px solid var(--ld-border);
    font-size: 12px;
    color: var(--ld-text-muted);
}

/* upload na szczegółach (reuse .ld-upload z formularza artykułu) */
.ld-td-cols .ld-upload {
    margin-top: 16px;
}

/* ---------- ticket: internal notes ---------- */
.ld-msg--internal .ld-msg__bubble {
    border-left: 3px solid var(--ld-warn);
    background: var(--ld-c-amber-bg);
}

.ld-msg-tag--internal {
    background: var(--ld-c-amber-bg);
    color: var(--ld-c-amber-600);
}

.ld-conv-note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 4px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--ld-c-amber-600);
    cursor: pointer;
}

.ld-conv-note input {
    width: 16px;
    height: 16px;
    accent-color: var(--ld-c-amber-600);
}

.ld-conv-input.is-internal .ld-conv-input__field {
    background: var(--ld-c-amber-bg);
}

/* ---------- ticket: linked tickets ---------- */
.ld-link-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 0;
    border-top: 1px solid var(--ld-border);
    cursor: pointer;
}

.ld-link-item:hover .ld-link-item__key {
    color: var(--ld-primary-ink);
}

.ld-link-item__rel {
    flex: 0 0 auto;
    padding: 3px 7px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.ld-link-item__rel--duplicate { background: var(--ld-c-amber-bg); color: var(--ld-c-amber-600);
}

.ld-link-item__rel--related { background: var(--ld-c-blue-bg); color: var(--ld-primary);
}

.ld-link-item__rel--analysis { background: var(--ld-c-green-bg); color: var(--ld-c-green-600);
}

.ld-link-item__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.ld-link-item__key {
    font-size: 12px;
    font-weight: 700;
    color: var(--ld-text-strong);
}

.ld-link-item__title {
    overflow: hidden;
    font-size: 12px;
    color: var(--ld-text-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- CSAT ---------- */
.ld-csat__stars {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
}

.ld-csat__star {
    padding: 0;
    border: none;
    background: none;
    font-size: 28px;
    line-height: 1;
    color: var(--ld-c-slate-400);
    cursor: pointer;
}

.ld-csat__star.is-on {
    color: var(--ld-warn);
}

.ld-csat__foot {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.ld-csat__thanks {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--ld-c-green-600);
}

.ld-td-desc--empty { color: var(--ld-text-muted); font-style: italic;
}

/* ---------- responsywnosc ---------- */
/* Elementy siatki maja domyslnie min-width:auto, wiec nie schodza ponizej swojej
   szerokosci minimalnej — dluga wartosc (np. telefon zglaszajacego) rozpychala
   strone poza ekran telefonu zamiast sie zawinac. */
.ld-td-cols > * {
    min-width: 0;
}

@media (max-width: 900px) {
    /* Panel „Szczegoly" schodzi pod tresc zamiast sciskac ja do nieczytelnej kolumny. */
    .ld-td-cols {
        grid-template-columns: 1fr;
    }

    .ld-td-info__row,
    .ld-td-desc {
        overflow-wrap: anywhere;
    }
}
