/* ============================================
   LOBBYNITE - Tickets User (Frontend)
   Design system completo per pagine ticket lato utente
   Prefisso classi: tk- (ticket)
   ============================================ */

/* ============================================
   1. VARIABILI & TOKENS
   Questi token locali (--tk-*) sono alias semantici dei
   token canonici definiti in :root in main.css.
   Vengono mantenuti per:
   - leggibilità del codice (un prefisso --tk- racconta
     dove viene usato),
   - refactor graduale: un domani si potranno cancellare
     e rinominare i consumatori a --color-* in un colpo solo.
   ============================================ */
:root {
    --tk-color-primary:        var(--color-primary);
    --tk-color-primary-light:  var(--color-primary-light);
    --tk-color-accent:         #9d4edd;
    --tk-color-accent-dark:    #7b2cbf;
    --tk-color-success:        var(--color-success);
    --tk-color-warning:        var(--color-warning);
    --tk-color-warning-amber:  var(--color-warning);
    --tk-color-danger:         var(--color-danger);
    --tk-color-info:           var(--color-info);
    --tk-color-neutral:        #6c6c8a;
    --tk-color-text:           var(--text-primary);
    --tk-color-text-muted:     rgba(255, 255, 255, 0.65);
    --tk-color-text-soft:      rgba(255, 255, 255, 0.5);
    --tk-radius-sm: 6px;
    --tk-radius-md: 10px;
    --tk-radius-lg: 14px;
    --tk-radius-xl: 18px;
    --tk-radius-pill: 999px;
    --tk-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --tk-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --tk-shadow-glow: 0 0 20px rgba(0, 212, 255, 0.25);
    --tk-border:        1px solid var(--border-soft);
    --tk-border-strong: 1px solid var(--border-strong);
}

/* ============================================
   2. PAGE WRAPPER & LAYOUT
   ============================================ */
.tk-page {
    padding: var(--spacing-2xl) 0;
    max-width: 1200px;
    margin: 0 auto;
}

.tk-grid {
    display: grid;
    gap: var(--spacing-lg);
}

.tk-grid-2 {
    grid-template-columns: 1fr 1fr;
}

.tk-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 992px) {
    .tk-grid-2,
    .tk-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   3. HERO
   ============================================ */
.tk-hero {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    padding: var(--spacing-2xl) var(--spacing-lg);
    background: var(--bg-card-gradient);
    border: var(--tk-border);
    border-radius: var(--tk-radius-lg);
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

.tk-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(123, 44, 191, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 50%, rgba(0, 212, 255, 0.1) 0%, transparent 60%);
    z-index: 0;
}

.tk-hero-body {
    position: relative;
    z-index: 1;
}

.tk-hero-icon {
    display: inline-block;
    font-size: 2.4rem;
    margin-right: var(--spacing-sm);
    vertical-align: middle;
}

.tk-hero h1 {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
    background: linear-gradient(135deg, #fff 0%, var(--tk-color-primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.tk-hero p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.6;
}

@media (max-width: 480px) {
    .tk-hero h1 { font-size: 1.3rem; }
    .tk-hero p { font-size: 0.95rem; }
}

/* ============================================
   4. HEADER STRIP (titolo pagina + CTA)
   ============================================ */
.tk-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg) var(--spacing-xl);
    background: var(--bg-card-gradient);
    border: var(--tk-border);
    border-radius: var(--tk-radius-lg);
}

.tk-page-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-primary);
}

.tk-page-header p {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.tk-page-header-cta {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.tk-page-header-main {
    flex: 1;
    min-width: 0;
}

.tk-page-header-main h1 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.3;
}

.tk-page-header-main p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 4px 0 0;
}

/* ============================================
   5. CARD BASE
   ============================================ */
.tk-card {
    background: var(--bg-card-gradient);
    border: var(--tk-border);
    border-radius: var(--tk-radius-lg);
    padding: var(--spacing-xl);
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.2s;
}

.tk-card:hover {
    border-color: rgba(123, 44, 191, 0.25);
    box-shadow: var(--tk-shadow-md);
    transform: translateY(-1px);
}

.tk-card-primary {
    position: relative;
    background: linear-gradient(145deg, #14101e 0%, #12121a 100%);
    padding: var(--spacing-xl) var(--spacing-2xl) var(--spacing-2xl);
    overflow: hidden;
}

.tk-card-primary::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #9d4edd, #7b2cbf, #5a189a);
    border-radius: var(--tk-radius-lg) var(--tk-radius-lg) 0 0;
}

.tk-card-title {
    color: var(--text-primary);
    margin: 0 0 var(--spacing-sm);
    font-size: 1.15rem;
    font-weight: 700;
}

.tk-card-text {
    color: var(--text-secondary);
    margin: 0 0 var(--spacing-md);
    font-size: 0.9rem;
    line-height: 1.55;
}

.tk-card-icon {
    font-size: 2.2rem;
    margin-bottom: var(--spacing-md);
    line-height: 1;
    display: block;
}

/* ============================================
   6. BADGES (stato & priorita')
   ============================================ */
.tk-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--tk-radius-pill);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    line-height: 1;
    white-space: nowrap;
    vertical-align: middle;
}

.tk-badge-status-open        { background: rgba(0, 212, 255, 0.15); color: var(--tk-color-primary); }
.tk-badge-status-in_progress { background: rgba(243, 156, 18, 0.15); color: var(--tk-color-warning); }
.tk-badge-status-waiting_user{ background: rgba(108, 108, 138, 0.25); color: rgba(255, 255, 255, 0.75); }
.tk-badge-status-resolved    { background: rgba(0, 255, 136, 0.15); color: var(--tk-color-success); }
.tk-badge-status-closed      { background: rgba(80, 80, 100, 0.3); color: rgba(255, 255, 255, 0.55); }
.tk-badge-status-spam        { background: rgba(255, 71, 87, 0.15); color: var(--tk-color-danger); }

.tk-badge-priority-low       { background: rgba(108, 108, 138, 0.2); color: rgba(255, 255, 255, 0.7); }
.tk-badge-priority-normal    { background: rgba(0, 212, 255, 0.15); color: var(--tk-color-primary); }
.tk-badge-priority-high      { background: rgba(255, 183, 0, 0.15); color: var(--tk-color-warning-amber); }
.tk-badge-priority-urgent    { background: rgba(255, 71, 87, 0.2); color: var(--tk-color-danger); }

/* ── Legacy ts-badge alias (usato da my-tickets.php + ticket-view.php) ── */
.ts-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-full, 9999px);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.ts-badge-default   { background: rgba(255, 255, 255, 0.04); color: var(--text-muted, #6c7585); }
.ts-badge-info      { background: rgba(0, 212, 255, 0.12); color: #5aceff; }
.ts-badge-warning   { background: rgba(255, 193, 7, 0.12); color: #ffc107; }
.ts-badge-success   { background: rgba(40, 167, 69, 0.12); color: #4ade80; }
.ts-badge-danger    { background: rgba(220, 53, 69, 0.12); color: #f87171; }
.ts-badge-secondary { background: rgba(108, 117, 125, 0.12); color: #9ca3af; }

/* ── Allegati: tk-attach-* (usati da support-ticket-form, contact, ticket-view) ── */
.tk-attach-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.tk-attach-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.tk-attach-label {
    margin-left: 8px;
    font-size: 0.85rem;
    color: var(--text-muted, #6c7585);
}
.tk-attach-help {
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--text-muted, #6c7585);
}
.tk-attach-label-error { color: var(--tk-color-danger, #ef4444) !important; }

/* ============================================
   7. PAGE LAYOUT (my-tickets, ticket-view)
   ============================================ */

/* ── Hero ── */
.tk-hero {
    margin-bottom: var(--spacing-xl);
}
.tk-hero-body {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}
.tk-hero-info {
    flex: 1;
}
.tk-hero-icon {
    margin-right: var(--spacing-xs);
}
.tk-hero-info h1 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
    font-weight: 700;
}
.tk-hero-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ── Filters ── */
.tk-filters {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}
.tk-filter {
    padding: 8px 18px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: border-color 0.25s, color 0.25s, background 0.25s;
}
.tk-filter:hover {
    border-color: rgba(0, 212, 255, 0.3);
    color: var(--color-primary);
    background: rgba(0, 212, 255, 0.04);
}
.tk-filter-active {
    background: linear-gradient(135deg, rgba(157, 78, 221, 0.2), rgba(90, 24, 154, 0.25));
    border-color: rgba(157, 78, 221, 0.3);
    color: #d4a0ff;
}

/* ── Ticket List ── */
.tk-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}
.tk-card {
    display: block;
    background: var(--bg-card-gradient);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-decoration: none;
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.2s;
}
.tk-card:hover {
    border-color: rgba(123, 44, 191, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}
.tk-card-top {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}
.tk-card-id {
    font-family: monospace;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
}
.tk-card-subject {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
    font-size: 1.05rem;
}
.tk-card-meta {
    display: flex;
    gap: var(--spacing-md);
    font-size: 0.82rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

/* ── Empty State ── */
.tk-empty {
    text-align: center;
    padding: var(--spacing-3xl) var(--spacing-lg);
    background: var(--bg-card-gradient);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
}
.tk-empty-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-lg);
    line-height: 1;
}
.tk-empty h3 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    font-size: 1.3rem;
}
.tk-empty p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    font-size: 0.92rem;
}

/* ── Pagination ── */
.tk-pagination {
    display: flex;
    gap: var(--spacing-xs);
    justify-content: center;
    margin-top: var(--spacing-xl);
}
.tk-page-btn {
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    min-width: 40px;
    text-align: center;
    transition: border-color 0.25s, color 0.25s, background 0.25s;
}
.tk-page-btn:hover {
    border-color: rgba(0, 212, 255, 0.3);
    color: var(--color-primary);
    background: rgba(0, 212, 255, 0.04);
}
.tk-page-btn-active {
    background: linear-gradient(135deg, rgba(157, 78, 221, 0.2), rgba(90, 24, 154, 0.25));
    border-color: rgba(157, 78, 221, 0.3);
    color: #d4a0ff;
}

/* ============================================
   8. TICKET VIEW DETAIL (tv-*)
   ============================================ */
.tv-page {
    padding: var(--spacing-2xl) 0;
    max-width: 1100px;
    margin: 0 auto;
}

/* ── Header ── */
.tv-header {
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-lg) var(--spacing-2xl);
}
.tv-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}
.tv-back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    transition: border-color 0.25s, color 0.25s;
}
.tv-back-link:hover {
    border-color: rgba(0, 212, 255, 0.3);
    color: var(--color-primary);
}
.tv-status-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}
.tv-public-id {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.tv-header-info h1 {
    font-size: 1.3rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
    font-weight: 700;
}
.tv-meta {
    display: flex;
    gap: var(--spacing-md);
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}
.tv-actions {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── Timeline / Events ── */
.tv-timeline { margin-bottom: var(--spacing-lg); }
.tv-event {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) 0;
    margin-left: 24px;
}
.tv-event-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
}
.tv-event-content {
    display: flex;
    gap: var(--spacing-md);
    font-size: 0.85rem;
    color: var(--text-muted);
}
.tv-event-action { font-style: italic; }

/* ── Message ── */
.tv-msg {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    background: var(--bg-card-gradient);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    transition: border-color 0.3s;
}
.tv-msg:hover { border-color: rgba(255, 255, 255, 0.12); }
.tv-msg-admin {
    border-color: rgba(123, 44, 191, 0.2);
    background: linear-gradient(135deg, rgba(123, 44, 191, 0.06), rgba(90, 24, 154, 0.03));
}
.tv-msg-admin:hover { border-color: rgba(123, 44, 191, 0.3); }
.tv-msg-internal {
    border-color: rgba(255, 193, 7, 0.2);
    background: rgba(255, 193, 7, 0.04);
    border-style: dashed;
}
.tv-msg-avatar { flex-shrink: 0; }
.tv-msg-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.tv-msg-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #9d4edd, #7b2cbf);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(123, 44, 191, 0.3);
}
.tv-msg-body { flex: 1; min-width: 0; }
.tv-msg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xs);
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}
.tv-msg-author {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}
.tv-msg-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.tv-msg-text {
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 0.95rem;
    white-space: pre-wrap;
    word-break: break-word;
}
.tv-msg-attachments {
    margin-top: var(--spacing-md);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.tv-msg-attachment {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    transition: border-color 0.2s;
}
.tv-msg-attachment:hover { border-color: rgba(0, 212, 255, 0.3); }
.tv-msg-attachment-img {
    max-width: 150px;
    max-height: 100px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

/* ── Reply / Closed ── */
.tv-reply,
.tv-closed {
    background: var(--bg-card-gradient);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
}
.tv-closed {
    text-align: center;
    padding: var(--spacing-2xl) var(--spacing-lg);
}
.tv-closed p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    font-size: 1rem;
    line-height: 1.6;
}
.tv-reply h3 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    font-size: 1.1rem;
    font-weight: 700;
}
.tv-reply-form .form-textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 3px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    padding: 15px 18px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border-color 0.25s;
}
.tv-reply-form .form-textarea:focus {
    outline: none;
    border-color: rgba(157, 78, 221, 0.3);
    border-left-color: #9d4edd;
}
.tv-attachments { margin-bottom: var(--spacing-md); }
.tv-attach-info {
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.tv-check-group { margin-bottom: var(--spacing-md); }
.tv-check-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-secondary);
    cursor: pointer;
}
.tv-closed-note {
    margin-top: var(--spacing-sm);
    font-size: 0.88rem;
    color: var(--text-muted);
}

.tk-badge-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--tk-color-danger);
    color: #fff;
    border-radius: 50%;
    min-width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0 4px;
    line-height: 1;
}

/* ============================================
   7. FORM
   ============================================ */
.tk-form {
    max-width: 100%;
    margin: 0 auto;
}

.tk-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
}

.tk-form .form-group {
    margin-bottom: var(--spacing-md);
}

.tk-form .form-input,
.tk-form .form-select,
.tk-form .form-textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--tk-radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    padding: 15px 18px;
    transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
    font-family: inherit;
}

.tk-form .form-textarea {
    min-height: 180px;
    resize: vertical;
}

.tk-form .form-input:focus,
.tk-form .form-select:focus,
.tk-form .form-textarea:focus {
    background: rgba(0, 0, 0, 0.55);
    border-color: rgba(255, 255, 255, 0.12);
    border-left-color: var(--tk-color-accent);
    box-shadow: 0 0 0 1px rgba(157, 78, 221, 0.2);
    outline: none;
}

.tk-form .form-input::placeholder,
.tk-form .form-textarea::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.tk-form .form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236c6c8a' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    padding-right: 44px;
}

.tk-form .form-select option {
    background: #0a0a0f;
    color: var(--text-primary);
}

.tk-form-actions {
    margin-top: var(--spacing-xl);
}

.tk-form-actions .btn-submit {
    width: 100%;
    padding: 16px 32px;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: var(--tk-radius-sm);
    background: linear-gradient(135deg, #9d4edd, #7b2cbf);
    border: none;
    color: #fff;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: opacity 0.25s, transform 0.2s;
    font-family: inherit;
}

.tk-form-actions .btn-submit:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.tk-form-actions .btn-submit:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .tk-form .form-row { grid-template-columns: 1fr; }
}

/* ============================================
   8. ATTACHMENTS (form + display)
   ============================================ */
.tk-attachments {
    margin-top: var(--spacing-lg);
}

.tk-attachments-label {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 10px 16px;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: var(--tk-radius-md);
    color: var(--tk-color-primary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.tk-attachments-label:hover {
    background: rgba(0, 212, 255, 0.18);
}

.tk-attachments-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.tk-attachments-help {
    display: block;
    margin-top: var(--spacing-sm);
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

.tk-attachments-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.tk-attachments-count {
    display: inline-block;
    margin-top: var(--spacing-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Attachment display: immagini */
.tk-attachment {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(255, 255, 255, 0.04);
    border: var(--tk-border);
    border-radius: var(--tk-radius-md);
    transition: border-color 0.2s, background 0.2s;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}

.tk-attachment:hover {
    border-color: rgba(0, 212, 255, 0.3);
    background: rgba(0, 212, 255, 0.04);
}

.tk-attachment-thumb {
    width: 64px;
    height: 64px;
    border-radius: var(--tk-radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.4);
    transition: transform 0.2s;
}

.tk-attachment:hover .tk-attachment-thumb {
    transform: scale(1.03);
}

.tk-attachment-info {
    flex: 1;
    min-width: 0;
}

.tk-attachment-name {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tk-attachment-meta {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 2px;
}

.tk-attachment-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--tk-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 212, 255, 0.1);
    color: var(--tk-color-primary);
    font-size: 1.4rem;
    flex-shrink: 0;
}

.tk-attachment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--spacing-sm);
}

.tk-attachment-tile {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--tk-radius-md);
    overflow: hidden;
    border: var(--tk-border);
    background: rgba(0, 0, 0, 0.4);
    display: block;
    transition: transform 0.2s, border-color 0.2s;
}

.tk-attachment-tile:hover {
    transform: scale(1.02);
    border-color: rgba(0, 212, 255, 0.4);
}

.tk-attachment-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ============================================
   9. TIMELINE / MESSAGGI
   ============================================ */
.tk-timeline {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    margin: var(--spacing-xl) 0;
}

.tk-message {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.03);
    border: var(--tk-border);
    border-radius: var(--tk-radius-lg);
}

.tk-message-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #9d4edd, #7b2cbf);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    overflow: hidden;
    flex-shrink: 0;
}

.tk-message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tk-message-body {
    min-width: 0;
}

.tk-message-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.tk-message-author {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.95rem;
}

.tk-message-date {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.tk-message-content {
    color: var(--text-primary);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.95rem;
}

.tk-message-content p { margin: 0 0 var(--spacing-sm); }
.tk-message-content p:last-child { margin-bottom: 0; }

.tk-message-attachments {
    margin-top: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* Varianti per tipo di autore */
.tk-message-user {
    background: rgba(0, 212, 255, 0.04);
    border-left: 3px solid var(--tk-color-primary);
}

.tk-message-user .tk-message-avatar {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
}

.tk-message-admin {
    background: rgba(157, 78, 221, 0.06);
    border-left: 3px solid var(--tk-color-accent);
}

.tk-message-admin .tk-message-avatar {
    background: linear-gradient(135deg, #9d4edd, #7b2cbf);
}

.tk-message-internal {
    background: rgba(255, 183, 0, 0.06);
    border-left: 3px solid var(--tk-color-warning-amber);
}

.tk-message-internal .tk-message-avatar {
    background: linear-gradient(135deg, #ffb700, #f39c12);
}

.tk-message-internal-tag {
    display: inline-block;
    margin-left: var(--spacing-sm);
    padding: 2px 8px;
    background: rgba(255, 183, 0, 0.2);
    color: var(--tk-color-warning-amber);
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: var(--tk-radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

@media (max-width: 480px) {
    .tk-message {
        grid-template-columns: 36px 1fr;
        padding: var(--spacing-sm);
    }
    .tk-message-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
}

/* ============================================
   10. REPLY BOX
   ============================================ */
.tk-reply-box {
    background: var(--bg-card-gradient);
    border: var(--tk-border);
    border-radius: var(--tk-radius-lg);
    padding: var(--spacing-xl);
    margin-top: var(--spacing-xl);
}

.tk-reply-box-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--spacing-md);
}

.tk-reply-box-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.tk-reply-box-actions .tk-attachments {
    margin: 0;
}

/* ============================================
   11. TICKET DETAIL HEADER
   ============================================ */
.tk-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    padding: var(--spacing-xl);
    background: var(--bg-card-gradient);
    border: var(--tk-border);
    border-radius: var(--tk-radius-lg);
    margin-bottom: var(--spacing-xl);
}

.tk-detail-header-main {
    min-width: 0;
    flex: 1;
}

.tk-detail-id {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: 'Consolas', 'Monaco', monospace;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.tk-detail-subject {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 var(--spacing-sm);
    line-height: 1.3;
}

.tk-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    align-items: center;
}

.tk-detail-meta-item {
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tk-detail-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

/* ============================================
   12. INFO GRID (categoria, priorita', ecc.)
   ============================================ */
.tk-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: rgba(255, 255, 255, 0.02);
    border: var(--tk-border);
    border-radius: var(--tk-radius-md);
    margin-bottom: var(--spacing-xl);
}

.tk-info-item {
    min-width: 0;
}

.tk-info-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    font-weight: 600;
}

.tk-info-value {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    word-break: break-word;
}

/* ============================================
   13. LIST (my-tickets)
   ============================================ */
.tk-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.tk-list-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: var(--bg-card-gradient);
    border: var(--tk-border);
    border-radius: var(--tk-radius-lg);
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    align-items: center;
}

.tk-list-item:hover {
    border-color: rgba(0, 212, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: var(--tk-shadow-md);
    color: inherit;
}

.tk-list-item-main {
    min-width: 0;
}

.tk-list-item-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-bottom: 6px;
}

.tk-list-item-id {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: 'Consolas', 'Monaco', monospace;
}

.tk-list-item-subject {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tk-list-item-excerpt {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tk-list-item-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.tk-list-item-date {
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .tk-list-item {
        grid-template-columns: 1fr;
    }
    .tk-list-item-meta {
        flex-direction: row;
        align-items: center;
    }
}

/* Empty state */
.tk-empty {
    text-align: center;
    padding: var(--spacing-2xl) var(--spacing-lg);
    background: var(--bg-card-gradient);
    border: var(--tk-border);
    border-radius: var(--tk-radius-lg);
}

.tk-empty-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.tk-empty-title {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 var(--spacing-sm);
}

.tk-empty-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0 0 var(--spacing-lg);
}

/* ============================================
   14. FILTERS BAR
   ============================================ */
.tk-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-card-gradient);
    border: var(--tk-border);
    border-radius: var(--tk-radius-lg);
    margin-bottom: var(--spacing-lg);
}

.tk-filters-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: var(--spacing-sm);
}

.tk-filters .form-input,
.tk-filters .form-select {
    padding: 8px 14px;
    font-size: 0.9rem;
    width: auto;
    min-width: 160px;
}

/* ============================================
   15. PAGINATION
   ============================================ */
.tk-pagination {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-xl);
    flex-wrap: wrap;
}

.tk-pagination a,
.tk-pagination span {
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: var(--tk-border);
    border-radius: var(--tk-radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.tk-pagination a:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.3);
    color: var(--tk-color-primary);
}

.tk-pagination .current,
.tk-pagination span.current {
    background: linear-gradient(135deg, #9d4edd, #7b2cbf);
    border-color: transparent;
    color: #fff;
}

.tk-pagination .disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================
   16. ALERTS
   ============================================ */
.tk-alert {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--tk-radius-md);
    margin-bottom: var(--spacing-lg);
    border-left: 4px solid;
    font-size: 0.9rem;
    line-height: 1.5;
}

.tk-alert-success { background: rgba(0, 255, 136, 0.1); border-left-color: var(--tk-color-success); color: rgba(255, 255, 255, 0.95); }
.tk-alert-info    { background: rgba(0, 212, 255, 0.1); border-left-color: var(--tk-color-primary); color: rgba(255, 255, 255, 0.95); }
.tk-alert-warning { background: rgba(255, 183, 0, 0.1); border-left-color: var(--tk-color-warning-amber); color: rgba(255, 255, 255, 0.95); }
.tk-alert-danger  { background: rgba(255, 71, 87, 0.1); border-left-color: var(--tk-color-danger); color: rgba(255, 255, 255, 0.95); }

.tk-alert-spaced { margin-top: 40px; }

/* Intro shown when the support form is opened for a site suggestion. */
.tk-suggestion-banner {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin: calc(var(--spacing-lg) * -0.25) 0 var(--spacing-lg);
    padding: 13px 18px;
    background:
        linear-gradient(90deg, rgba(157, 78, 221, 0.16), rgba(0, 212, 255, 0.08)),
        rgba(18, 18, 28, 0.82);
    border: 1px solid rgba(157, 78, 221, 0.38);
    border-left: 3px solid var(--tk-color-accent);
    border-radius: var(--tk-radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.45;
}

.tk-page a:focus-visible,
.tk-page button:focus-visible,
.tk-page input:focus-visible,
.tk-page select:focus-visible,
.tk-page textarea:focus-visible {
    outline: 3px solid var(--tk-color-primary);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.tk-suggestion-banner-icon {
    display: grid;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 9px;
    background: rgba(255, 210, 74, 0.14);
    font-size: 1.15rem;
}

.tk-suggestion-banner-text {
    min-width: 0;
}

@media (max-width: 480px) {
    .tk-suggestion-banner {
        align-items: flex-start;
        padding: 12px 14px;
        font-size: 0.86rem;
    }
}

/* ============================================
   17. RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .tk-page { padding: var(--spacing-lg) 0; }
    .tk-hero { padding: var(--spacing-lg) var(--spacing-md); }
    .tk-hero h1 { font-size: 1.55rem; }
    .tk-page-header { padding: var(--spacing-md); }
    .tk-page-header h1 { font-size: 1.3rem; }
    .tk-detail-header { padding: var(--spacing-md); }
    .tk-detail-subject { font-size: 1.2rem; }
    .tk-reply-box { padding: var(--spacing-md); }
}

@media (max-width: 480px) {
    .tk-hero h1 { font-size: 1.3rem; }
    .tk-hero p { font-size: 0.95rem; }
    .tk-card { padding: var(--spacing-md); }
    .tk-info-grid { padding: var(--spacing-md); }
}

/* ============================================
   18. FORM CARD (used by support-ticket-form partial)
   Sostituisce il vecchio wrapper "support-block support-block-primary"
   per il form di apertura ticket.
   ============================================ */
.tk-form-card {
    background: var(--bg-card-gradient);
    border: var(--tk-border);
    border-radius: var(--tk-radius-lg);
    padding: var(--spacing-2xl);
    margin-bottom: var(--spacing-xl);
    position: relative;
    overflow: hidden;
}

.tk-form-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #9d4edd, #7b2cbf, #5a189a);
}

.tk-form-card h3 {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 var(--spacing-sm);
}

.tk-form-card > p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    line-height: 1.6;
}

.tk-form-card-icon {
    font-size: 2.2rem;
    margin-bottom: var(--spacing-md);
    line-height: 1;
    display: block;
}

/* ============================================
   19. INFO CARD (used by support.php "why use tickets" e partials)
   Sostituisce il vecchio wrapper "support-block" generico.
   ============================================ */
.tk-info-card {
    background: var(--bg-card-gradient);
    border: var(--tk-border);
    border-radius: var(--tk-radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
}

.tk-info-card h3,
.tk-info-card h4 {
    color: var(--text-primary);
    font-weight: 700;
    margin: 0 0 var(--spacing-md);
}

.tk-info-card h3 { font-size: 1.2rem; }
.tk-info-card h4 { font-size: 1.05rem; }

.tk-info-card p {
    color: var(--text-secondary);
    margin: 0 0 var(--spacing-md);
    line-height: 1.6;
}

.tk-info-card-icon {
    font-size: 2.2rem;
    margin-bottom: var(--spacing-md);
    line-height: 1;
    display: block;
}

.tk-info-card ul,
.tk-info-card .tk-list-plain {
    list-style: none;
    margin: var(--spacing-md) 0 0;
    padding: 0;
    color: var(--text-secondary);
    line-height: 1.8;
}

.tk-info-card ul li {
    padding: var(--spacing-xs) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.tk-info-card ul li:last-child {
    border-bottom: none;
}

.tk-info-card ul a {
    color: var(--tk-color-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    transition: color 0.2s;
}

.tk-info-card ul a:hover {
    color: var(--tk-color-primary-light);
}

.tk-info-card ul a::before {
    content: '\f105';
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free';
    font-weight: 900;
    opacity: 0.5;
    transition: transform 0.2s, opacity 0.2s;
}

.tk-info-card ul a:hover::before {
    opacity: 1;
    transform: translateX(3px);
}

.tk-info-card-badge {
    margin: var(--spacing-sm) 0;
}

/* ============================================
   20. CONTACT METHODS (support.php collapsible)
   Sostituisce "support-contact-collapse / toggle / content / card"
   ============================================ */
.tk-contact-collapse {
    background: var(--bg-card-gradient);
    border: var(--tk-border);
    border-radius: var(--tk-radius-lg);
    margin-bottom: var(--spacing-lg);
    overflow: hidden;
}

.tk-contact-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg) var(--spacing-xl);
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.tk-contact-toggle:hover {
    background: rgba(255, 255, 255, 0.03);
}

.tk-contact-toggle i {
    transition: transform 0.3s;
    color: var(--tk-color-primary);
}

.tk-contact-toggle-icon-open {
    transform: rotate(180deg);
}

.tk-contact-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 var(--spacing-xl);
}

.tk-contact-content.open {
    max-height: 600px;
    padding: 0 var(--spacing-xl) var(--spacing-xl);
}

.tk-contact-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.03);
    border: var(--tk-border);
    border-radius: var(--tk-radius-md);
}

.tk-contact-icon {
    font-size: 1.6rem;
    width: 48px;
    height: 48px;
    border-radius: var(--tk-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 212, 255, 0.12);
    flex-shrink: 0;
}

.tk-contact-card h4 {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 4px;
}

.tk-contact-card a {
    color: var(--tk-color-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.tk-contact-card a:hover {
    text-decoration: underline;
}

/* ============================================
   21. INFO STRIP (support.php footer strip)
   Sostituisce "support-info-strip / item"
   ============================================ */
.tk-info-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: rgba(0, 0, 0, 0.2);
    border: var(--tk-border);
    border-radius: var(--tk-radius-lg);
    margin-top: var(--spacing-xl);
}

.tk-info-strip-item {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}

.tk-info-strip-item strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    font-weight: 700;
}

/* ============================================
   22. SIDEBAR (support.php sidebar partial)
   Sostituisce "support-sidebar"
   ============================================ */
.tk-sidebar {
    display: grid;
    gap: var(--spacing-lg);
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* ============================================
   22b. LAYOUT: form (main) + sidebar (right column)
   Usato in pages/support.php per affiancare
   il form ticket alle card "I miei ticket" / FAQ.
   Su mobile collassa a colonna singola.
   ============================================ */
.tk-layout {
    display: grid;
    gap: var(--spacing-lg);
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    margin-bottom: var(--spacing-xl);
}

@media (min-width: 992px) {
    .tk-layout {
        grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    }
    .tk-layout > .tk-form-card {
        margin-bottom: 0;
    }
}

.tk-layout .tk-sidebar {
    align-self: stretch;
}

/* ============================================
   22c. SUPPORT PAGE POLISH
   Regole scoperte solo dalla pagina support.php.
   ============================================ */
.tk-support-page {
    padding: clamp(32px, 5vw, 64px) 0 72px;
}

.tk-support-page > .tk-hero {
    margin-bottom: clamp(24px, 3vw, 40px);
    padding: clamp(28px, 4vw, 48px) clamp(24px, 5vw, 64px);
    text-align: left;
    background:
        radial-gradient(circle at 12% 0%, rgba(157, 78, 221, 0.2), transparent 42%),
        radial-gradient(circle at 100% 100%, rgba(0, 212, 255, 0.12), transparent 46%),
        linear-gradient(135deg, rgba(24, 17, 38, 0.98), rgba(13, 24, 35, 0.96));
    border-color: rgba(157, 78, 221, 0.24);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
}

.tk-support-page > .tk-hero > .tk-hero-body {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
    align-items: center;
    gap: clamp(24px, 5vw, 72px);
}

.tk-support-page > .tk-hero h1 {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0;
    font-size: clamp(1.75rem, 2.6vw, 2.5rem);
    line-height: 1.1;
}

.tk-support-page > .tk-hero-icon {
    display: grid;
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    margin: 0;
    place-items: center;
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 16px;
    background: rgba(0, 212, 255, 0.1);
    font-size: 1.8rem;
}

.tk-support-page > .tk-hero p {
    max-width: none;
    margin: 0;
    text-align: right;
    line-height: 1.65;
}

.tk-support-page > .tk-layout {
    gap: clamp(18px, 2.5vw, 28px);
}

.tk-support-page > .tk-layout > .tk-form-card.tk-page {
    width: auto;
    max-width: none;
    margin: 0;
    padding: clamp(24px, 3.5vw, 40px);
    background:
        linear-gradient(145deg, rgba(24, 21, 33, 0.98), rgba(16, 17, 25, 0.98));
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.16);
}

.tk-support-page .tk-form-card-icon,
.tk-support-page .tk-info-card-icon {
    display: grid;
    width: 46px;
    height: 46px;
    margin-bottom: 18px;
    place-items: center;
    border: 1px solid rgba(0, 212, 255, 0.16);
    border-radius: 14px;
    background: rgba(0, 212, 255, 0.09);
    font-size: 1.45rem;
}

.tk-support-page .tk-form-card h3 {
    margin-bottom: 8px;
    font-size: 1.45rem;
    letter-spacing: -0.2px;
}

.tk-support-page .tk-form-card > p {
    margin-bottom: 28px;
}

.tk-support-page .tk-form .form-group {
    margin-bottom: 22px;
}

.tk-support-page .tk-form label {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 0.86rem;
    font-weight: 700;
}

.tk-support-page .tk-form .form-input,
.tk-support-page .tk-form .form-select,
.tk-support-page .tk-form .form-textarea {
    box-sizing: border-box;
    min-height: 48px;
    padding: 12px 15px;
    border-color: rgba(255, 255, 255, 0.1);
    border-left-width: 2px;
    background: rgba(5, 7, 12, 0.52);
}

.tk-support-page .tk-form input:not([type="checkbox"]):not([type="file"]) {
    width: 100%;
    box-sizing: border-box;
    min-height: 48px;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--tk-radius-sm);
    background: rgba(5, 7, 12, 0.52);
    color: var(--text-primary);
    font: inherit;
    transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

.tk-support-page .tk-form input:not([type="checkbox"]):not([type="file"]):focus {
    background: rgba(0, 0, 0, 0.55);
    border-color: rgba(255, 255, 255, 0.12);
    border-left-color: var(--tk-color-accent);
    box-shadow: 0 0 0 1px rgba(157, 78, 221, 0.2);
    outline: none;
}

.tk-support-page .tk-form .form-textarea {
    min-height: 168px;
}

.tk-support-page .tk-help {
    margin: 7px 0 0;
    color: var(--text-secondary);
    font-size: 0.76rem;
    line-height: 1.5;
}

.tk-support-page .tk-help strong {
    color: rgba(255, 210, 74, 0.9);
}

.tk-support-page .tk-ctx-fieldset {
    margin: 2px 0 0;
    padding: 16px;
    border: 1px solid rgba(157, 78, 221, 0.25);
    border-radius: var(--tk-radius-md);
    background: rgba(157, 78, 221, 0.06);
}

.tk-support-page .tk-ctx-fieldset legend {
    padding: 0 8px;
    color: var(--text-primary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.tk-support-page .tk-attachments {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
    padding: 14px 16px;
    border: 1px dashed rgba(0, 212, 255, 0.24);
    border-radius: var(--tk-radius-md);
    background: rgba(0, 212, 255, 0.035);
}

.tk-support-page .tk-attachments .tk-help {
    flex-basis: 100%;
    margin-top: 0;
}

.tk-support-page .tk-attach-label {
    margin-left: 0;
}

.tk-support-page .tk-form > #submitTicketBtn {
    margin-top: 12px;
    min-height: 52px;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(0, 212, 255, 0.12);
}

.tk-support-page > .tk-layout > .tk-sidebar {
    align-self: start;
    gap: 18px;
}

.tk-support-page .tk-layout .tk-info-card {
    margin: 0;
    padding: 24px;
    background: linear-gradient(145deg, rgba(25, 24, 35, 0.98), rgba(17, 18, 27, 0.98));
    border-color: rgba(255, 255, 255, 0.1);
}

.tk-support-page .tk-layout .tk-info-card-icon {
    margin-bottom: 16px;
}

.tk-support-page > .tk-info-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 16px;
    align-items: start;
    padding: 26px 32px;
    background:
        linear-gradient(135deg, rgba(157, 78, 221, 0.1), transparent 54%),
        var(--bg-card-gradient);
}

.tk-support-page > .tk-info-card .tk-info-card-icon {
    grid-row: span 2;
}

.tk-support-page > .tk-info-card h3 {
    align-self: center;
    margin: 0 0 4px;
}

.tk-support-page > .tk-info-card p {
    grid-column: 2;
    margin-bottom: 12px;
}

.tk-support-page > .tk-info-card ul {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 28px;
    margin-top: 12px;
}

.tk-support-page .tk-contact-collapse {
    background: linear-gradient(145deg, rgba(25, 24, 35, 0.98), rgba(17, 18, 27, 0.98));
    border-color: rgba(255, 255, 255, 0.1);
}

.tk-support-page .tk-contact-toggle {
    min-height: 64px;
}

.tk-support-page .tk-contact-content:not([hidden]) {
    max-height: 600px;
    padding: 0 var(--spacing-xl) var(--spacing-xl);
}

.tk-support-page .tk-before-open {
    display: grid;
    grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1.2fr) auto;
    align-items: center;
    gap: 22px;
    margin: 0 0 var(--spacing-lg);
    padding: 22px 28px;
    border: 1px solid rgba(0, 212, 255, 0.16);
    border-left: 3px solid var(--tk-color-primary);
    border-radius: var(--tk-radius-lg);
    background: linear-gradient(110deg, rgba(0, 212, 255, 0.07), rgba(157, 78, 221, 0.06));
}

.tk-support-page .tk-before-open h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.05rem;
}

.tk-support-page .tk-before-open p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.55;
}

.tk-support-page .tk-before-open ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tk-support-page .tk-before-open a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: var(--tk-radius-pill);
    color: var(--tk-color-primary);
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}

.tk-support-page .tk-before-open a:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.45);
}

.tk-support-page > .tk-info-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    background: rgba(0, 0, 0, 0.26);
}

@media (max-width: 991px) {
    .tk-support-page > .tk-hero > .tk-hero-body {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .tk-support-page > .tk-hero p {
        text-align: left;
        padding-left: 68px;
    }

    .tk-support-page .tk-before-open {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .tk-support-page .tk-before-open ul {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .tk-support-page {
        padding-top: 24px;
        padding-bottom: 40px;
    }

    .tk-support-page > .tk-hero {
        padding: 24px 20px;
    }

    .tk-support-page > .tk-hero h1 {
        align-items: flex-start;
        font-size: 1.65rem;
    }

    .tk-support-page > .tk-hero-icon {
        flex-basis: 44px;
        width: 44px;
        height: 44px;
        font-size: 1.45rem;
    }

    .tk-support-page > .tk-hero p {
        padding-left: 0;
        font-size: 0.92rem;
    }

    .tk-support-page > .tk-info-card {
        display: block;
        padding: 24px;
    }

    .tk-support-page > .tk-info-card .tk-info-card-icon {
        float: none;
    }

    .tk-support-page > .tk-info-card p,
    .tk-support-page > .tk-info-card ul {
        grid-column: auto;
    }

    .tk-support-page > .tk-info-card ul,
    .tk-support-page > .tk-info-strip {
        grid-template-columns: 1fr;
    }

    .tk-support-page .tk-form .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .tk-support-page .tk-contact-content:not([hidden]) {
        padding-right: 16px;
        padding-left: 16px;
    }
}

/* ============================================
   23. TV-HEADER FULL CARD
   Il vecchio wrapper "support-block support-block-primary"
   forniva background + border. Senza di esso, .tv-header
   appariva senza contenitore. Aggiungiamo le regole mancanti
   direttamente qui.
   ============================================ */
.tv-header {
    background: var(--bg-card-gradient);
    border: var(--tk-border);
    border-radius: var(--tk-radius-lg);
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-lg) var(--spacing-2xl);
    position: relative;
    overflow: hidden;
}

.tv-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #9d4edd, #7b2cbf, #5a189a);
}

@media (max-width: 480px) {
    .tv-header { padding: var(--spacing-md); }
}

/* ============================================
   24. TV-ATTACH ALIASES
   Le classi tv-attach-* non hanno regole proprie: sono
   alias semantici delle tk-attach-*. Vengono mantenute per
   non rompere la lettura del codice, ma puntano tutte
   alle regole tk-attach-*.
   ============================================ */
.tv-attach-btn { cursor: pointer; }
.tv-attach-info { color: var(--text-muted); }

/* ============================================
   25. ACCESSIBILITÀ E TOOL LISTA
   ============================================ */
.tk-my-tickets-page {
    padding-top: clamp(28px, 4vw, 52px);
    padding-bottom: clamp(48px, 6vw, 80px);
}

.tk-my-tickets-page .tk-page-header {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: clamp(16px, 2.5vw, 30px);
    align-items: center;
    margin-bottom: 20px;
    padding: clamp(22px, 3vw, 34px);
    overflow: hidden;
    background:
        radial-gradient(circle at 82% 5%, rgba(157, 78, 221, 0.22), transparent 27%),
        radial-gradient(circle at 45% 120%, rgba(0, 212, 255, 0.10), transparent 44%),
        linear-gradient(135deg, rgba(22, 20, 32, 0.98), rgba(13, 17, 27, 0.98));
    border-color: rgba(157, 78, 221, 0.22);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
}

.tk-my-tickets-page .tk-page-header::after {
    content: '';
    position: absolute;
    right: -40px;
    bottom: -75px;
    width: 230px;
    height: 230px;
    border: 1px solid rgba(0, 212, 255, 0.10);
    border-radius: 50%;
    box-shadow: 0 0 0 26px rgba(0, 212, 255, 0.025), 0 0 0 53px rgba(0, 212, 255, 0.018);
    pointer-events: none;
}

.tk-my-tickets-page .tk-back-link,
.tk-my-tickets-page .tk-page-header-main,
.tk-my-tickets-page .tk-page-header-cta {
    position: relative;
    z-index: 1;
}

.tk-my-tickets-page .tk-back-link {
    align-self: start;
    min-height: auto;
    padding-top: 5px;
    color: #87e8ff;
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
}

.tk-my-tickets-page .tk-back-link:hover { color: #d5f8ff; }

.tk-my-tickets-page .tk-page-header-main h1 {
    display: flex;
    align-items: center;
    gap: 13px;
    font-size: clamp(1.55rem, 2.5vw, 2.15rem);
    letter-spacing: -0.6px;
}

.tk-my-tickets-page .tk-hero-icon {
    display: grid;
    width: 48px;
    height: 48px;
    margin: 0;
    place-items: center;
    border: 1px solid rgba(0, 212, 255, 0.20);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(0, 212, 255, 0.16), rgba(157, 78, 221, 0.15));
    font-size: 1.55rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.tk-my-tickets-page .tk-page-header-main p {
    margin: 8px 0 0 61px;
    color: #aeb2c9;
    font-size: 0.9rem;
}

.tk-my-tickets-page .tk-page-header-cta .btn {
    min-height: 46px;
    padding: 0 18px;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(0, 212, 255, 0.16);
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.tk-ticket-tools {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(170px, auto) minmax(155px, auto) auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
    padding: 10px;
    background: rgba(18, 19, 29, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.tk-tool-search-wrap,
.tk-tool-select-wrap {
    position: relative;
}

.tk-tool-search-wrap > i,
.tk-tool-select-wrap > i {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 14px;
    color: #7f89aa;
    font-size: 0.82rem;
    pointer-events: none;
    transform: translateY(-50%);
}

.tk-ticket-search,
.tk-ticket-sort,
.tk-ticket-order {
    min-height: 44px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 10px;
    background: rgba(4, 7, 13, 0.58);
    color: var(--text-primary);
    font: inherit;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.tk-ticket-search { padding-left: 40px; }
.tk-ticket-sort,
.tk-ticket-order { padding-left: 37px; }

.tk-ticket-search:focus,
.tk-ticket-sort:focus,
.tk-ticket-order:focus {
    border-color: rgba(0, 212, 255, 0.58);
    background: rgba(4, 7, 13, 0.82);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.10);
    outline: none;
}

.tk-ticket-search-submit {
    min-height: 44px;
    padding: 0 17px;
    border-radius: 10px;
    white-space: nowrap;
}

.tk-my-tickets-page .tk-filters {
    gap: 8px;
    margin-bottom: 20px;
    padding: 9px;
    background: rgba(18, 19, 29, 0.76);
    border-color: rgba(255, 255, 255, 0.075);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.10);
}

.tk-my-tickets-page .tk-filter {
    gap: 5px;
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
    color: #aeb2c9;
    font-size: 0.83rem;
    font-weight: 700;
    text-decoration: none;
}

.tk-my-tickets-page .tk-filter:hover {
    border-color: rgba(0, 212, 255, 0.22);
    background: rgba(0, 212, 255, 0.07);
    color: #d8f9ff;
}

.tk-my-tickets-page .tk-filter-active {
    border-color: rgba(157, 78, 221, 0.30);
    background: linear-gradient(135deg, rgba(157, 78, 221, 0.25), rgba(111, 50, 194, 0.16));
    color: #f0ddff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.tk-my-tickets-page .tk-filter-count {
    background: rgba(255, 255, 255, 0.10);
    color: inherit;
}

.tk-my-tickets-page .tk-card {
    position: relative;
    overflow: hidden;
    padding: 20px 22px;
    border-color: rgba(255, 255, 255, 0.09);
    border-radius: 16px;
    background: linear-gradient(115deg, rgba(24, 23, 35, 0.98), rgba(16, 17, 27, 0.98));
}

.tk-my-tickets-page .tk-card::before {
    content: '';
    position: absolute;
    top: 18px;
    bottom: 18px;
    left: 0;
    width: 3px;
    border-radius: 0 5px 5px 0;
    background: linear-gradient(180deg, #00d4ff, #8b5cf6);
    opacity: 0.72;
}

.tk-my-tickets-page .tk-card:hover {
    border-color: rgba(0, 212, 255, 0.24);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 212, 255, 0.04);
    transform: translateY(-3px);
}

.tk-my-tickets-page .tk-card-top { margin-bottom: 11px; }

.tk-my-tickets-page .tk-card-id {
    margin-right: 3px;
    color: #9ba6c8;
    font-size: 0.78rem;
    letter-spacing: 0.15px;
}

.tk-my-tickets-page .ts-badge {
    padding: 5px 9px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 0.72rem;
    font-weight: 700;
}

.tk-my-tickets-page .tk-card-subject {
    margin-bottom: 14px;
    color: #f7f8ff;
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: -0.1px;
}

.tk-my-tickets-page .tk-card-meta {
    gap: 8px 18px;
    color: #aab1ca;
    font-size: 0.8rem;
}

.tk-my-tickets-page .tk-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tk-my-tickets-page .tk-card-meta i {
    width: 13px;
    color: #6fdced;
    font-size: 0.76rem;
    text-align: center;
}

.tk-my-tickets-page .tk-needs-reply {
    margin-top: 13px;
    border-color: rgba(255, 193, 7, 0.28);
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.16), rgba(255, 145, 0, 0.10));
    color: #ffe08b;
}

.tk-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.55rem;
    min-height: 1.55rem;
    padding: 0 0.4rem;
    margin-left: 0.25rem;
    border-radius: var(--radius-full, 999px);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.tk-needs-reply {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: var(--spacing-sm);
    padding: 0.35rem 0.65rem;
    border: 1px solid rgba(255, 193, 7, 0.35);
    border-radius: var(--radius-full, 999px);
    background: rgba(255, 193, 7, 0.1);
    color: #ffd166;
    font-size: 0.8rem;
    font-weight: 700;
}

.tk-card-meta,
.tk-card-id,
.tk-list-item-date {
    color: #a5a5c2;
}

.tk-filter,
.tk-card,
.tk-page-btn,
.tk-back-link,
.tv-back-link,
.tv-actions .btn,
.tv-msg-attachment,
.tk-attach-btn,
.tv-reply-form button {
    min-height: 44px;
}

.tk-filter,
.tk-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tk-card:focus-visible,
.tk-filter:focus-visible,
.tk-page-btn:focus-visible,
.tk-back-link:focus-visible,
.tv-back-link:focus-visible,
.tv-actions .btn:focus-visible,
.tv-msg-attachment:focus-visible,
.tk-attach-btn:focus-within,
.tv-reply-form button:focus-visible,
.tv-reply-form textarea:focus-visible,
.tv-reply-form input:focus-visible,
.tv-reply-form select:focus-visible {
    outline: 3px solid #7dd3fc;
    outline-offset: 3px;
}

.tv-reply-form label[for="ticket-reply-message"] {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--text-primary);
    font-weight: 600;
}

@media (max-width: 640px) {
    .tk-ticket-tools {
        grid-template-columns: minmax(0, 1fr) auto;
    }
    .tk-tool-search-wrap {
        grid-column: 1 / -1;
    }
    .tk-tool-select-wrap,
    .tk-ticket-search-submit {
        min-width: 0;
    }
    .tk-ticket-search-submit {
        grid-column: 1 / -1;
    }
    .tk-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding: var(--spacing-sm);
        scrollbar-width: thin;
    }
    .tk-filter {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .tk-my-tickets-page .tk-page-header {
        grid-template-columns: 1fr auto;
        gap: 12px;
    }

    .tk-my-tickets-page .tk-back-link { grid-column: 1 / -1; }
    .tk-my-tickets-page .tk-page-header-main p { margin-left: 0; }
}

@media (max-width: 480px) {
    .tk-page-header {
        gap: var(--spacing-sm);
        margin-bottom: var(--spacing-md);
        padding: var(--spacing-md);
    }
    .tk-page-header-cta,
    .tk-page-header-cta .btn {
        width: 100%;
    }
    .tk-page-header-cta .btn {
        justify-content: center;
    }
    .tk-ticket-tools {
        gap: 0.5rem;
    }

    .tk-my-tickets-page .tk-page-header {
        grid-template-columns: 1fr;
        padding: 21px;
    }

    .tk-my-tickets-page .tk-page-header-cta,
    .tk-my-tickets-page .tk-page-header-cta .btn {
        width: 100%;
    }

    .tk-my-tickets-page .tk-page-header-cta .btn { justify-content: center; }
    .tk-my-tickets-page .tk-card { padding: 18px; }
    .tk-my-tickets-page .tk-card-meta { gap: 8px 12px; }
}

/* Guest ticket confirmation and copyable access link. */
.tv-created-notice {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    margin: 24px 0;
    padding: clamp(20px, 3vw, 30px);
    border: 1px solid rgba(83, 215, 174, 0.44);
    border-radius: 18px;
    background: linear-gradient(130deg, rgba(23, 69, 65, 0.95), rgba(20, 28, 48, 0.98) 58%);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.2);
    color: #f5fbfa;
}
.tv-created-icon {
    display: grid;
    flex: 0 0 42px;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #70e2ba;
    color: #12332c;
}
.tv-created-content { flex: 1; min-width: 0; }
.tv-created-content h2 { margin: 2px 0 8px; color: #fff; font-size: clamp(1.25rem, 2vw, 1.55rem); }
.tv-created-reference { margin: 0; color: #c7e4dd; font-size: 0.94rem; }
.tv-created-reference strong { margin-left: 5px; color: #fff; letter-spacing: 0.02em; }
.tv-created-link-panel {
    margin-top: 20px;
    padding: 19px;
    border: 1px solid rgba(190, 232, 218, 0.18);
    border-radius: 12px;
    background: rgba(6, 16, 29, 0.34);
}
.tv-created-link-panel label { display: block; margin-bottom: 5px; color: #fff; font-weight: 700; }
.tv-created-link-panel > p { margin: 0 0 13px; color: #d4e4e5; line-height: 1.5; font-size: 0.9rem; }
.tv-created-link-row { display: flex; gap: 10px; align-items: stretch; }
.tv-created-link-row input {
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0 12px;
    border: 1px solid rgba(181, 220, 218, 0.42);
    border-radius: 8px;
    background: #101b2b;
    color: #e4f5f0;
    font: 0.88rem/1.3 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.tv-created-link-row input:focus { outline: 2px solid #84edd0; outline-offset: 2px; }
.tv-created-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: 8px;
    background: #84edd0;
    color: #0c3029;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
    white-space: nowrap;
}
.tv-created-copy:hover { background: #aff7df; }
.tv-created-copy:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.tv-created-link-panel .tv-created-copy-feedback { margin: 10px 0 0; color: #aef4d6; font-size: 0.88rem; }
.tv-created-copy-feedback:empty { display: none; }

.tv-image-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    margin: 0;
    width: max-content;
    max-width: min(96vw, 1200px);
    max-height: 94vh;
    padding: 48px 12px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    background: #101827;
    color: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}
.tv-image-dialog::backdrop { background: rgba(0, 0, 0, 0.84); }
.tv-image-dialog img {
    display: block;
    max-width: calc(96vw - 24px);
    max-height: calc(94vh - 62px);
    object-fit: contain;
}
.tv-image-dialog-close {
    position: absolute;
    top: 7px;
    right: 8px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
}
.tv-image-dialog-close:hover, .tv-image-dialog-close:focus-visible { background: rgba(255, 255, 255, 0.22); }

@media (max-width: 600px) {
    .tv-created-notice { gap: 12px; margin: 16px 0; }
    .tv-created-icon { flex-basis: 34px; width: 34px; height: 34px; }
    .tv-created-link-panel { padding: 14px; }
    .tv-created-link-row { flex-direction: column; }
    .tv-created-copy { width: 100%; }
}
