/* The tickets page (/tickets): the admin panel's frame and look (admin-base.css, theme.css, admin.css), plus these. */
body.tickets nav .tkhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 6px 6px; }
body.tickets nav .tkhead b { font-family: var(--head); font-size: 15px; }
body.tickets nav .tkhead button { height: 32px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; border-radius: 9px; background: var(--grad); color: #fff; font-weight: 600; font-size: 12.5px; }
body.tickets nav .tkhead button svg { width: 14px; height: 14px; }
body.tickets nav #tkNav button { display: flex; width: 100%; justify-content: space-between; }
body.tickets nav .tkcount { font-weight: 500; font-size: 11.5px; min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--s3); color: var(--soft); text-align: center; }
body.tickets nav .tkcount.late { background: var(--danger-soft); color: var(--danger); }
body.tickets nav .tkgrp > summary { cursor: pointer; list-style: none; }
body.tickets nav .tkgrp > summary::-webkit-details-marker { display: none; }
body.tickets nav .tkgrp > summary::after { content: " ▸"; } body.tickets nav .tkgrp[open] > summary::after { content: " ▾"; }

/* the list */
body.tickets #tkChips { flex-shrink: 0; }
body.tickets .tkcell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
body.tickets .tkcell b { font-weight: 500; max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
body.tickets .tkcell small { color: var(--muted); font-size: 12px; }
body.tickets .pill.tk-new { background: var(--brand-soft); color: var(--brand); }
body.tickets .pill.tk-open { background: var(--ok-soft); color: var(--ok); }
body.tickets .pill.tk-waiting_customer, body.tickets .pill.tk-waiting_team { background: var(--warn-soft); color: var(--warn); }
body.tickets .pill.tk-cancelled { background: var(--danger-soft); color: var(--danger); }
.tkprio.p-high, .tkprio.p-urgent { color: var(--danger); font-weight: 600; } .tkprio.p-low { color: var(--muted); }
.tkdue.late { color: var(--danger); font-weight: 600; } .tkdue.soon { color: var(--warn); font-weight: 600; } .tkdue.met { color: var(--ok); } .tkdue.paused { color: var(--muted); font-style: italic; }

/* one ticket */
body.tickets .tkgrid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
body.tickets .tkmain, body.tickets .tkside { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
body.tickets .tksummary { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
body.tickets #tkChatLinks { display: flex; gap: 8px; flex-wrap: wrap; }
body.tickets #tkChatLinks button { display: inline-flex; align-items: center; gap: 6px; }
body.tickets .tkdl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13.5px; }
body.tickets .tkdl dt { color: var(--muted); } body.tickets .tkdl dd { margin: 0; overflow-wrap: anywhere; }
body.tickets .tktl { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
body.tickets .tktl .m.note { align-self: stretch; max-width: none; white-space: pre-wrap; }
body.tickets .tkev { color: var(--muted); font-size: 12.5px; } body.tickets .tkev b { color: var(--soft); font-weight: 500; } body.tickets .tkev time { opacity: 0.75; }
body.tickets .tknote { position: relative; display: flex; flex-direction: column; gap: 8px; }
body.tickets .tkmention { position: absolute; bottom: calc(100% - 4px); left: 0; z-index: 20; display: flex; flex-direction: column; min-width: 220px; padding: 4px; background: var(--s2); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow-lg); }
body.tickets main .tkmention button { justify-content: flex-start; height: 32px; background: none; border: 0; }
body.tickets .tkchips { display: flex; flex-wrap: wrap; gap: 6px; }
body.tickets .tkother { display: flex; flex-direction: column; padding: 8px 0; border-top: 1px solid var(--line); text-decoration: none; }
body.tickets .tkother b { font-weight: 500; } body.tickets .tkother small { color: var(--muted); font-size: 12px; }
body.tickets .tkdup { padding: 10px 12px; border-left: 3px solid var(--warn); background: var(--warn-soft); border-radius: 8px; }
body.tickets #tkChatDrawer .msgs { padding: 0; background: none; }
body.tickets .tknewcard { max-width: 860px; display: flex; flex-direction: column; gap: 10px; }

/* fields of a ticket type (ticket-form.js) */
body.tickets .tfgrid { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
body.tickets .tf { display: flex; flex-direction: column; gap: 5px; margin: 0; font-weight: 500; font-size: 13px; }
body.tickets .tf > span { color: var(--soft); }
body.tickets .tf input, body.tickets .tf select, body.tickets .tf textarea { width: 100%; }
body.tickets .tf.bad input, body.tickets .tf.bad select, body.tickets .tf.bad textarea { border-color: var(--danger); }
body.tickets .req { color: var(--danger); font-weight: 600; }
body.tickets .tkerr { color: var(--danger); margin: 0; min-height: 0; } body.tickets .tkerr:empty { display: none; }

/* change password */
body.tickets .tkmodal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(0, 0, 0, 0.5); }
body.tickets .tkmodal > .card { width: 360px; max-width: calc(100vw - 32px); display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 1100px) { body.tickets .tkgrid { grid-template-columns: 1fr; } }
