/* Destek talepleri: requester list, new ticket, ticket conversation, IT list, bell panel.
   Colours come only from dex-theme.css variables. */

.dx-status--warn { background: color-mix(in srgb, var(--dx-warning) 16%, var(--dx-surface)); color: color-mix(in srgb, var(--dx-warning) 82%, var(--dx-text)); }

/* Priority: a coloured bar on cards and a small pill elsewhere. */
.dx-prio { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: var(--dx-text-xs); font-weight: 650; background: var(--dx-surface-2); color: var(--dx-muted); }
.dx-prio.is-normal { background: color-mix(in srgb, var(--dx-info) 12%, var(--dx-surface)); color: var(--dx-info); }
.dx-prio.is-high { background: color-mix(in srgb, var(--dx-warning) 16%, var(--dx-surface)); color: color-mix(in srgb, var(--dx-warning) 82%, var(--dx-text)); }
.dx-prio.is-urgent { background: color-mix(in srgb, var(--dx-danger) 14%, var(--dx-surface)); color: var(--dx-danger); }
.dx-ticketcard__prio { flex: none; align-self: stretch; width: 4px; border-radius: 4px; background: var(--dx-line); }
.dx-ticketcard__prio.is-normal { background: var(--dx-info); }
.dx-ticketcard__prio.is-high { background: var(--dx-warning); }
.dx-ticketcard__prio.is-urgent { background: var(--dx-danger); }

/* SLA text: green on track, amber in the last quarter, red when late. */
.dx-due { font-size: var(--dx-text-sm); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dx-due.is-ok { color: var(--dx-success); }
.dx-due.is-soon { color: color-mix(in srgb, var(--dx-warning) 82%, var(--dx-text)); }
.dx-due.is-late { color: var(--dx-danger); }
.dx-due.is-done { color: var(--dx-muted); font-weight: 500; }

/* Requester list: cards rather than a grid. */
.dx-ticketcards { display: grid; gap: 8px; margin: 0; padding: 12px; list-style: none; }
.dx-ticketcard {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px 12px 12px;
    border: 1px solid var(--dx-panel-line);
    border-radius: 14px;
    background: var(--dx-surface);
    color: inherit;
    text-decoration: none;
    transition: border-color .15s var(--dx-ease), box-shadow .15s var(--dx-ease);
}
.dx-ticketcard:hover { border-color: var(--dx-accent-line, var(--dx-accent)); box-shadow: var(--dx-shadow-sm); }
.dx-ticketcard.needs-you { border-color: color-mix(in srgb, var(--dx-success) 45%, var(--dx-line)); background: color-mix(in srgb, var(--dx-success) 5%, var(--dx-surface)); }
.dx-ticketcard__main { display: flex; flex: 1; flex-direction: column; gap: 3px; min-width: 0; }
.dx-ticketcard__main strong { font-size: var(--dx-text-md); font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-ticketcard__top { color: var(--dx-muted); font-size: var(--dx-text-xs); }
.dx-ticketcard__top b { color: var(--dx-accent-text); font-weight: 650; }
.dx-ticketcard__main small { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; color: var(--dx-muted); font-size: var(--dx-text-xs); }
.dx-ticketcard__ask { display: inline-flex; align-items: center; gap: 4px; color: var(--dx-success); font-weight: 650; }
.dx-ticketcard__ask .dx-ico, .dx-ticketcard__msgs .dx-ico { width: 13px; height: 13px; }
.dx-ticketcard__msgs { display: inline-flex; align-items: center; gap: 3px; margin-left: 4px; }

/* New ticket: the story on the left, priority, device and what happens next on the right. */
.dx-newticket { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; align-content: start; }
.dx-newticket__main,
.dx-newticket__box {
    border: 1px solid var(--dx-panel-line);
    border-radius: 16px;
    background: var(--dx-panel-bg, var(--dx-surface));
    box-shadow: var(--dx-panel-shadow, none);
}
.dx-newticket__main { display: grid; gap: 18px; align-content: start; padding: 20px 22px 22px; }
.dx-newticket__head { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--dx-line); }
.dx-newticket__head > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.dx-newticket__head strong { font-size: var(--dx-text-md); font-weight: 700; }
.dx-newticket__head small { color: var(--dx-muted); font-size: var(--dx-text-sm); }
.dx-newticket__icon { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 12px; background: var(--dx-accent-gradient, var(--dx-accent)); color: var(--dx-on-accent); box-shadow: 0 10px 22px -12px var(--dx-accent); }
.dx-newticket__icon .dx-ico { width: 22px; height: 22px; }
.dx-newticket__subject { height: 42px !important; font-size: var(--dx-text-md); }
.dx-newticket__desc { min-height: 150px; }

.dx-cattiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.dx-cattile {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 46px;
    padding: 8px 10px;
    border: 1px solid var(--dx-line);
    border-radius: 12px;
    background: var(--dx-surface);
    color: var(--dx-text);
    font: 600 var(--dx-text-sm) var(--dx-font);
    text-align: left;
    cursor: pointer;
    transition: border-color .15s var(--dx-ease), background .15s var(--dx-ease);
}
.dx-cattile:hover { border-color: var(--dx-accent-line, var(--dx-accent)); }
.dx-cattile__icon { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--dx-surface-2); color: var(--dx-muted); }
.dx-cattile__icon .dx-ico { width: 15px; height: 15px; }
.dx-cattile.is-on { border-color: var(--dx-accent); background: var(--dx-accent-soft); color: var(--dx-accent-text); box-shadow: inset 0 0 0 1px var(--dx-accent); }
.dx-cattile.is-on .dx-cattile__icon { background: var(--dx-accent); color: var(--dx-on-accent); }
.dx-cattiles.is-invalid .dx-cattile { border-color: color-mix(in srgb, var(--dx-danger) 55%, var(--dx-line)); }

.dx-newticket__files { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; border: 1px dashed var(--dx-panel-line); border-radius: 14px; background: color-mix(in srgb, var(--dx-accent) 3%, var(--dx-surface)); }
.dx-newticket__files-icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--dx-accent-soft); color: var(--dx-accent-text); }
.dx-newticket__files-icon .dx-ico { width: 18px; height: 18px; }
.dx-newticket__files-text { display: flex; flex: 1; flex-direction: column; min-width: 180px; }
.dx-newticket__files-text strong { font-size: var(--dx-text-sm); }
.dx-newticket__files-text small { color: var(--dx-muted); font-size: var(--dx-text-xs); }
.dx-newticket__files .dx-ticketfiles { flex-basis: 100%; }
.dx-newticket__files .dx-ticketfiles:not(:has(.dx-ticketfiles__chip)) { flex-basis: auto; }

.dx-newticket__side { display: grid; gap: 12px; }
.dx-newticket__box { display: grid; gap: 10px; padding: 16px; }
.dx-newticket__box h2 { display: flex; align-items: baseline; justify-content: space-between; margin: 0; font-size: var(--dx-text-sm); font-weight: 700; }
.dx-newticket__box h2 small { color: var(--dx-muted); font-size: var(--dx-text-xs); font-weight: 500; }
.dx-newticket__note { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--dx-muted); font-size: var(--dx-text-xs); }
.dx-newticket__note .dx-ico { width: 13px; height: 13px; }

.dx-priolist { display: grid; gap: 6px; }
.dx-prio-option {
    --prio: var(--dx-muted);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border: 1px solid var(--dx-line);
    border-radius: 12px;
    background: var(--dx-surface);
    color: var(--dx-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.dx-prio-option.is-normal { --prio: var(--dx-info); }
.dx-prio-option.is-high { --prio: var(--dx-warning); }
.dx-prio-option.is-urgent { --prio: var(--dx-danger); }
.dx-prio-option__dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--prio); box-shadow: 0 0 0 3px color-mix(in srgb, var(--prio) 20%, transparent); }
.dx-prio-option__text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.dx-prio-option__text strong { font-size: var(--dx-text-sm); }
.dx-prio-option__text small { color: var(--dx-muted); font-size: var(--dx-text-xs); }
.dx-prio-option__sla { flex: none; padding: 2px 8px; border-radius: 999px; background: var(--dx-surface-2); color: var(--dx-muted); font-size: var(--dx-text-xs); font-weight: 650; font-variant-numeric: tabular-nums; }
.dx-prio-option:hover { border-color: color-mix(in srgb, var(--prio) 55%, var(--dx-line)); }
.dx-prio-option.is-on { border-color: var(--prio); background: color-mix(in srgb, var(--prio) 9%, var(--dx-surface)); box-shadow: inset 0 0 0 1px var(--prio); }
.dx-prio-option.is-on .dx-prio-option__sla { background: var(--prio); color: #fff; }

.dx-myassets { display: grid; gap: 6px; }
.dx-myasset { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--dx-line); border-radius: 12px; background: var(--dx-surface); color: var(--dx-text); font: inherit; text-align: left; cursor: pointer; }
.dx-myasset .dx-person__text { flex: 1; }
.dx-myasset > .dx-ico { width: 16px; height: 16px; color: var(--dx-accent-text); }
.dx-myasset.is-on { border-color: var(--dx-accent); background: var(--dx-accent-soft); box-shadow: inset 0 0 0 1px var(--dx-accent); }

.dx-newticket__steps ol { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.dx-newticket__steps li { display: flex; gap: 10px; }
.dx-newticket__steps li > span { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--dx-accent-soft); color: var(--dx-accent-text); font-size: var(--dx-text-xs); font-weight: 750; }
.dx-newticket__steps p { display: flex; flex-direction: column; margin: 0; }
.dx-newticket__steps strong { font-size: var(--dx-text-sm); }
.dx-newticket__steps small { color: var(--dx-muted); font-size: var(--dx-text-xs); }

@container records (max-width: 900px) {
    .dx-newticket { grid-template-columns: minmax(0, 1fr); }
}

/* File picker and chips. */
.dx-ticketfiles { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dx-ticketfiles__pick { position: relative; overflow: hidden; cursor: pointer; }
.dx-ticketfiles__pick input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dx-ticketfiles__pick.is-disabled { opacity: .55; pointer-events: none; }
.dx-ticketfiles__chip { display: inline-flex; align-items: center; gap: 6px; max-width: 240px; height: 30px; padding: 0 4px 0 10px; border: 1px solid var(--dx-line); border-radius: 999px; background: var(--dx-surface-2); font-size: var(--dx-text-xs); }
.dx-ticketfiles__chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.dx-ticketfiles__chip small { color: var(--dx-muted); }
.dx-ticketfiles__chip .dx-ico { flex: none; width: 14px; height: 14px; }
.dx-ticketfiles__chip button { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--dx-muted); cursor: pointer; }
.dx-ticketfiles__chip button:hover { background: var(--dx-line); color: var(--dx-text); }

/* Ticket: conversation on the left, facts on the right. */
.dx-ticket__body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; min-height: 0; }
.dx-ticket__main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border: 1px solid var(--dx-panel-line);
    border-radius: 16px;
    background: var(--dx-panel-bg, var(--dx-surface));
    overflow: hidden;
}
.dx-ticket__side {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    overflow: auto;
    padding: 16px;
    border: 1px solid var(--dx-panel-line);
    border-radius: 16px;
    background: var(--dx-panel-bg, var(--dx-surface));
}
.dx-ticket__badges { display: flex; flex-wrap: wrap; gap: 6px; }
.dx-ticket__side .dx-facts { margin: 0; }
.dx-ticket__assign .dx-input { height: 36px; }
.dx-ticket__resolution { padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--dx-success) 8%, var(--dx-surface)); }
.dx-ticket__resolution span { color: var(--dx-success); font-size: var(--dx-text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.dx-ticket__resolution p { margin: 4px 0 0; font-size: var(--dx-text-sm); white-space: pre-wrap; }

.dx-sla { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--dx-surface-2); }
.dx-sla .dx-ico { flex: none; width: 20px; height: 20px; }
.dx-sla span { display: flex; flex-direction: column; }
.dx-sla small { color: var(--dx-muted); font-size: var(--dx-text-xs); }
.dx-sla.is-ok { color: var(--dx-success); background: color-mix(in srgb, var(--dx-success) 9%, var(--dx-surface)); }
.dx-sla.is-soon { color: color-mix(in srgb, var(--dx-warning) 82%, var(--dx-text)); background: color-mix(in srgb, var(--dx-warning) 11%, var(--dx-surface)); }
.dx-sla.is-late { color: var(--dx-danger); background: color-mix(in srgb, var(--dx-danger) 9%, var(--dx-surface)); }

.dx-ticket__ask { display: flex; gap: 12px; margin: 14px 16px 0; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--dx-success) 40%, var(--dx-line)); border-radius: 14px; background: color-mix(in srgb, var(--dx-success) 7%, var(--dx-surface)); }
.dx-ticket__ask-icon { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 10px; background: var(--dx-success); color: #fff; }
.dx-ticket__ask-icon .dx-ico { width: 17px; height: 17px; }
.dx-ticket__ask > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.dx-ticket__ask small { color: var(--dx-muted); font-size: var(--dx-text-sm); }
.dx-ticket__ask small:first-of-type { color: var(--dx-text); white-space: pre-wrap; }

/* Thread: own messages on the right in the accent tint, the other side on the left. */
.dx-thread { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 16px; overflow: auto; list-style: none; scrollbar-width: thin; }
.dx-thread__msg { display: flex; align-items: flex-end; gap: 8px; max-width: 82%; }
.dx-thread__msg.is-mine { flex-direction: row-reverse; align-self: flex-end; }
.dx-thread__bubble { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 10px 13px; border: 1px solid var(--dx-line); border-radius: 14px 14px 14px 4px; background: var(--dx-surface); }
.dx-thread__msg.is-mine .dx-thread__bubble { border-color: color-mix(in srgb, var(--dx-accent) 30%, var(--dx-line)); border-radius: 14px 14px 4px; background: var(--dx-accent-soft); }
.dx-thread__bubble.is-first { border-style: dashed; }
.dx-thread__bubble p { margin: 0; font-size: var(--dx-text-sm); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.dx-thread__meta { color: var(--dx-muted); font-size: var(--dx-text-xs); }
.dx-thread__meta b { color: var(--dx-text); font-weight: 650; }
.dx-thread__event { align-self: center; max-width: 90%; text-align: center; }
.dx-thread__event span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--dx-surface-2); color: var(--dx-muted); font-size: var(--dx-text-xs); }
.dx-thread__event .dx-ico { flex: none; width: 13px; height: 13px; }
.dx-thread__files { display: flex; flex-wrap: wrap; gap: 6px; }
.dx-thread__thumb { display: block; width: 120px; height: 84px; overflow: hidden; border: 1px solid var(--dx-line); border-radius: 10px; background: var(--dx-surface-2); }
.dx-thread__thumb img { width: 100%; height: 100%; object-fit: cover; }
.dx-thread__file { display: inline-flex; align-items: center; gap: 6px; max-width: 240px; padding: 6px 10px; border: 1px solid var(--dx-line); border-radius: 10px; background: var(--dx-surface); color: inherit; font-size: var(--dx-text-xs); text-decoration: none; }
.dx-thread__file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.dx-thread__file small { color: var(--dx-muted); }
.dx-thread__file .dx-ico { flex: none; width: 15px; height: 15px; color: var(--dx-accent-text); }

.dx-composer { display: grid; gap: 8px; padding: 12px 16px 14px; border-top: 1px solid var(--dx-line); background: var(--dx-surface); }
.dx-composer__text { height: auto !important; min-height: 58px; padding: 9px 12px; resize: vertical; line-height: 1.5; }
.dx-composer__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dx-composer--closed { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--dx-muted); font-size: var(--dx-text-sm); }
.dx-composer--closed .dx-ico { width: 16px; height: 16px; }

/* IT list. */
.dx-tickets td:first-child { min-width: 240px; }
.dx-tickets tr.is-late td:first-child { box-shadow: inset 3px 0 0 var(--dx-danger); }
.dx-chip-toggle { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--dx-line); border-radius: 999px; background: var(--dx-surface); color: var(--dx-text); font: 600 var(--dx-text-sm) var(--dx-font); cursor: pointer; }
.dx-chip-toggle .dx-ico { width: 15px; height: 15px; }
.dx-chip-toggle span { padding: 0 6px; border-radius: 999px; background: var(--dx-surface-2); font-size: var(--dx-text-xs); }
.dx-chip-toggle.is-on { border-color: var(--dx-danger); background: color-mix(in srgb, var(--dx-danger) 10%, var(--dx-surface)); color: var(--dx-danger); }

/* Dashboard: active tickets widget. */
.dx-ticketmini { margin: 0; padding: 4px 0; list-style: none; }
.dx-ticketmini a { display: flex; align-items: center; gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--dx-line); color: inherit; text-decoration: none; }
.dx-ticketmini li:last-child a { border-bottom: 0; }
.dx-ticketmini a:hover { background: var(--dx-surface-2); }
.dx-ticketmini .dx-person__text { flex: 1; }
.dx-ticketmini .dx-person__text strong, .dx-ticketmini .dx-person__text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Bell: unread badge and notification list. */
.dx-bell { position: relative; }
.dx-bell__badge { position: absolute; top: -5px; right: -5px; display: grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; border: 2px solid var(--dx-surface); border-radius: 999px; background: var(--dx-danger); color: #fff; font: 700 10px/1 var(--dx-font); }
.dx-notifications { width: 360px; max-width: calc(100vw - 24px); }
.dx-notifications__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-right: 6px; }
.dx-notifications__head .dx-link { border: 0; background: none; color: var(--dx-accent-text); font: 600 var(--dx-text-xs) var(--dx-font); cursor: pointer; }
.dx-notifications__list { display: grid; gap: 2px; max-height: min(420px, 70vh); margin: 0; padding: 0; overflow: auto; list-style: none; }
.dx-notification { display: flex; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.dx-notification:hover { background: var(--dx-surface-2); }
.dx-notification__icon { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--dx-surface-2); color: var(--dx-muted); }
.dx-notification__icon .dx-ico { width: 16px; height: 16px; }
.dx-notification.is-unread .dx-notification__icon { background: var(--dx-accent-soft); color: var(--dx-accent-text); }
.dx-notification__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: var(--dx-text-sm); }
.dx-notification__text strong { font-weight: 600; }
.dx-notification.is-unread .dx-notification__text strong { font-weight: 750; }
.dx-notification__text span { color: var(--dx-muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dx-notification__text small { color: var(--dx-muted); font-size: var(--dx-text-xs); }

@container records (max-width: 980px) {
    .dx-ticket__body { grid-template-columns: minmax(0, 1fr); overflow: auto; }
    .dx-ticket__side { overflow: visible; }
    .dx-ticket__main { min-height: 520px; }
}

@container records (max-width: 640px) {
    .dx-newticket__main { padding: 16px; }
    .dx-newticket__steps { display: none; }
    .dx-thread__msg { max-width: 100%; }
    .dx-ticketcard { align-items: flex-start; }
    .dx-ticketcard__main strong { white-space: normal; }
    .dx-tickets td[data-label="Açan"],
    .dx-tickets td[data-label="Açılış"],
    .dx-tickets td[data-label="İlgilenen"] { display: none; }
    .dx-tickets td[data-label="Öncelik"],
    .dx-tickets td[data-label="Hedef"],
    .dx-tickets td[data-label="Durum"] { display: inline-flex; margin: 8px 10px 0 0; vertical-align: middle; }
}
