/* css/ticket-swipe.css — mobile swipe-to-reveal actions on ticket cards.
   The .tsw-row wrapper and .tsw-actions panels are created transiently by
   js/ticket-swipe.js only while a card is being swiped/held open, then removed.
   Everything here is therefore inert until a swipe happens. */

.tsw-row {
    position: relative;
    overflow: hidden;
}

.tsw-card {
    position: relative;
    z-index: 1;
    touch-action: pan-y;        /* native vertical scroll; we handle the horizontal */
    will-change: transform;
    /* Zero the card's own margin while wrapped (the wrapper carries it instead) so the
       wrapper is exactly the card's height — otherwise the action panels are taller
       than the card and peek out below it as a colored strip. !important beats the
       card's own margin rule. */
    margin: 0 !important;
    /* The card keeps its own background so it cleanly covers the panels behind it. */
}

.tsw-actions {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 0;
    display: flex;
    align-items: stretch;
}

.tsw-left {
    left: 0;
}

.tsw-right {
    right: 0;
}

.tsw-action {
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 4px;
    border: 0;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.tsw-action:active {
    filter: brightness(0.9);
}

.tsw-ic {
    display: inline-flex;
}

.tsw-ic svg {
    width: 20px;
    height: 20px;
    display: block;
}

.tsw-lbl {
    line-height: 1;
}

/* Action colours — green Done, then the cool/attention palette for the rest. */
.tsw-done   { background: #16a34a; }
.tsw-assign { background: #4f46e5; }
.tsw-urgent { background: #ea580c; }
.tsw-deploy { background: #0891b2; }
.tsw-delete { background: #dc2626; }

/* Let the browser own vertical scrolling while we own horizontal swipes on
   COLLAPSED cards (the only ones that swipe). This keeps touchmove cancelable for
   horizontal gestures — so preventDefault works without the "cancelable=false"
   intervention — and leaves expanded cards' inner scrollers untouched. */
@media (max-width: 767px) {
    body.dashboard-v2-enabled .dashboard-v2-ticket-card:has(.ticket-body.hidden) {
        touch-action: pan-y;
    }
}
