/* ═══════════════════════════════════════════════════════════
   support.css — Enterprise Support Center v3
   Linear / Zendesk / Freshdesk inspired.
   Full-width table, no horizontal scroll, compact filter bar,
   Source column removed, balanced column weights.
   ═══════════════════════════════════════════════════════════ */

/* ──────────────────────────────
   PAGE ENTER ANIMATION
────────────────────────────── */
.support-page-root {
    animation: supportFadeIn 0.22s ease-out both;
}
@keyframes supportFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ──────────────────────────────
   PAGE HEADER
────────────────────────────── */
.support-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-5);
    gap: var(--space-4);
    flex-wrap: wrap;
}
.support-page-header-left { flex: 1; min-width: 0; }

.support-page-title-wrap {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}
.support-page-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--color-primary), #818cf8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99,102,241,0.28);
}
.support-page-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 1px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.support-page-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}
.support-page-header-actions {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* ──────────────────────────────
   KPI CARDS — 5-col compact strip
────────────────────────────── */
.support-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}
@media (max-width: 1280px) { .support-kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .support-kpi-grid { grid-template-columns: repeat(2, 1fr); } }

.support-kpi-card {
    position: relative;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: var(--space-4) var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.support-kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.kpi-open     { border-top: 3px solid #3b82f6; }
.kpi-pending  { border-top: 3px solid #f59e0b; }
.kpi-resolved { border-top: 3px solid #10b981; }
.kpi-critical { border-top: 3px solid #ef4444; }
.kpi-time     { border-top: 3px solid #8b5cf6; }

.kpi-card-icon {
    width: 34px; height: 34px;
    border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.kpi-open     .kpi-card-icon { background: rgba(59,130,246,0.1);  color: #3b82f6; }
.kpi-pending  .kpi-card-icon { background: rgba(245,158,11,0.1);  color: #f59e0b; }
.kpi-resolved .kpi-card-icon { background: rgba(16,185,129,0.1);  color: #10b981; }
.kpi-critical .kpi-card-icon { background: rgba(239,68,68,0.1);   color: #ef4444; }
.kpi-time     .kpi-card-icon { background: rgba(139,92,246,0.1);  color: #8b5cf6; }

.kpi-card-body { flex: 1; min-width: 0; }
.kpi-card-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-tertiary);
    margin-bottom: 3px;
    white-space: nowrap;
}
.kpi-card-value {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.03em;
}

/* ──────────────────────────────
   BODY WRAP
────────────────────────────── */
.support-body-wrap {
    display: flex;
    gap: var(--space-4);
    align-items: flex-start;
    position: relative;
}
.support-queue-section { flex: 1; min-width: 0; }

/* ──────────────────────────────
   PANEL CARD
────────────────────────────── */
.support-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* ══════════════════════════════════════════════════════
   ENTERPRISE FILTER BAR — single compact line
   ═══════════════════════════════════════════════════ */
.support-filter-bar {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    flex-wrap: wrap;
    min-height: 52px;
}

/* Compact inline search inside filter bar */
.support-inline-search {
    position: relative;
    flex-shrink: 0;
}
.support-inline-search-icon {
    position: absolute;
    left: 9px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}
.support-inline-search-input {
    width: 200px;
    height: 32px;
    padding: 0 10px 0 30px;
    font-size: 12.5px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-sunken);
    color: var(--text-primary);
    transition: border-color 0.15s ease, width 0.2s ease;
    outline: none;
}
.support-inline-search-input:focus {
    border-color: var(--color-primary);
    width: 240px;
    background: var(--bg-surface);
}
.support-inline-search-input::placeholder { color: var(--text-tertiary); }

/* Divider between search and filter dropdowns */
.support-filter-divider {
    width: 1px;
    height: 20px;
    background: var(--border-subtle);
    flex-shrink: 0;
}

/* Compact filter dropdowns */
.support-filter-select {
    height: 32px;
    padding: 0 22px 0 9px;
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-sunken);
    color: var(--text-secondary);
    cursor: pointer;
    transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
    outline: none;
    min-width: 0;
    white-space: nowrap;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 7px center;
}
.support-filter-select:hover {
    border-color: var(--color-primary);
    color: var(--text-primary);
}
.support-filter-select:focus { border-color: var(--color-primary); }
.support-filter-select.filter-active {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background-color: color-mix(in srgb, var(--bg-sunken), var(--color-primary) 6%);
    font-weight: 600;
}

/* Page size select — narrower */
.support-pagesize-select {
    height: 32px;
    padding: 0 22px 0 9px;
    font-size: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-sunken);
    color: var(--text-secondary);
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 7px center;
    min-width: 80px;
}

/* Push right: Reset + Activity toggle */
.support-filter-spacer { flex: 1; }

.support-filter-reset-btn {
    height: 32px;
    padding: 0 10px;
    font-size: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.12s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}
.support-filter-reset-btn:hover {
    border-color: var(--color-danger);
    color: var(--color-danger);
    background: rgba(239,68,68,0.05);
}

/* Activity toggle */
#support-activity-toggle-btn {
    height: 32px;
    padding: 0 10px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
#support-activity-toggle-btn .toggle-indicator {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 4px rgba(16,185,129,0.6);
    animation: livePulse 2s infinite;
    flex-shrink: 0;
}
@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(0.8); }
}

/* ══════════════════════════════════════════════════════
   TABLE — 10-column optimized, no Source column
   ═══════════════════════════════════════════════════ */
.support-table-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--border-subtle) transparent;
}
.support-table-wrapper::-webkit-scrollbar { height: 4px; }
.support-table-wrapper::-webkit-scrollbar-track { background: transparent; }
.support-table-wrapper::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 2px; }

.support-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}

/* ── 10 Column widths — balanced for 1232px usable ──
   ID(48) + Customer(180) + Subject(flex) + Priority(90) + Status(98) +
   Dept(110) + Assigned(145) + Created(120) + Updated(90) + Actions(90) = ~971 + subject flex
   Subject takes remaining space (~260px at 1232px)
*/
.support-col-id        { width: 48px; }
.support-col-customer  { width: 180px; }
.support-col-subject   { width: auto; min-width: 180px; }  /* flexible */
.support-col-priority  { width: 90px; }
.support-col-status    { width: 98px; }
.support-col-dept      { width: 110px; }
.support-col-assignee  { width: 145px; }
.support-col-created   { width: 120px; }
.support-col-updated   { width: 90px; }
.support-col-actions   { width: 90px; }

/* Sticky thead */
.support-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}
.support-table thead th {
    background: var(--bg-sunken);
    padding: 8px 10px;
    text-align: left;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: none;
}

/* tbody rows */
.support-table tbody tr {
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.1s ease;
    cursor: pointer;
}
.support-table tbody tr:last-child { border-bottom: none; }
.support-table tbody tr:hover { background: var(--bg-sunken); }

.support-table tbody td {
    padding: 10px 10px;
    color: var(--text-primary);
    vertical-align: middle;
    overflow: hidden;
}

/* Critical row highlight */
.support-table tbody tr.ticket-row-critical td:first-child {
    border-left: 3px solid #ef4444;
    padding-left: 7px;
}

/* ── Cell classes ── */
.sc-ticket-id {
    font-weight: 700;
    font-size: 12px;
    color: var(--color-primary);
    font-variant-numeric: tabular-nums;
}

.sc-customer-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sc-customer-email {
    font-size: 11px;
    color: var(--text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 1px;
}

.sc-subject-text {
    font-weight: 500;
    font-size: 13px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.35;
}
.sc-subject-preview {
    font-size: 11px;
    color: var(--text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 1px;
}

.sc-dept-text {
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sc-date {
    font-size: 11.5px;
    color: var(--text-secondary);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.sc-age {
    font-size: 11.5px;
    color: var(--text-tertiary);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Inline assignee select */
.quick-assign-select {
    width: 100%;
    max-width: 138px;
    font-size: 11.5px;
    height: 26px;
    padding: 0 6px;
    border-radius: var(--radius-sm);
    background: var(--bg-sunken);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    cursor: pointer;
}

/* ── Sortable headers ── */
.sortable-header {
    cursor: pointer;
    position: relative;
    padding-right: 18px !important;
}
.sortable-header:hover {
    color: var(--color-primary) !important;
    background: color-mix(in srgb, var(--bg-sunken) 80%, var(--color-primary) 5%) !important;
}
.sortable-header::after {
    content: '↕';
    position: absolute;
    right: 5px; top: 50%;
    transform: translateY(-50%);
    font-size: 8px;
    opacity: 0.3;
}
.sortable-header.sort-asc::after  { content: '▲'; opacity: 1; color: var(--color-primary); }
.sortable-header.sort-desc::after { content: '▼'; opacity: 1; color: var(--color-primary); }

/* ── Row action buttons ── */
.row-actions {
    display: flex;
    gap: 3px;
    justify-content: flex-end;
    align-items: center;
}
.row-actions button {
    width: 26px; height: 26px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.12s ease;
    flex-shrink: 0;
}
/* Named action buttons */
.btn-view-ticket:hover { background: rgba(99,102,241,0.12) !important; color: var(--color-primary) !important; border-color: var(--color-primary) !important; }
.btn-resolve-ticket:hover:not(:disabled) { background: rgba(16,185,129,0.12) !important; color: #10b981 !important; border-color: #10b981 !important; }

/* ──────────────────────────────
   TABLE FOOTER — pagination
────────────────────────────── */
.support-table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px var(--space-4);
    border-top: 1px solid var(--border-subtle);
    gap: var(--space-4);
    flex-wrap: wrap;
    background: var(--bg-surface);
}
.support-pagination-info {
    font-size: 12px;
    color: var(--text-tertiary);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Override global .pagination inside support footer */
.support-table-footer .pagination {
    display: flex;
    align-items: center;
    gap: 2px;
}
.support-table-footer .page-btn {
    height: 28px;
    min-width: 28px;
    padding: 0 7px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    background: var(--bg-sunken);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.12s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}
.support-table-footer .page-btn:hover:not(:disabled) {
    background: var(--bg-surface);
    border-color: var(--color-primary);
    color: var(--color-primary);
}
.support-table-footer .page-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    font-weight: 700;
}
.support-table-footer .page-btn:disabled { opacity: 0.32; cursor: not-allowed; }

/* ──────────────────────────────
   LOADING / EMPTY STATES
────────────────────────────── */
.support-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-10) var(--space-6);
    color: var(--text-secondary);
    font-size: 13px;
}
.support-empty-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px var(--space-6);
    text-align: center;
}
.support-empty-icon  { font-size: 2.2rem; margin-bottom: var(--space-3); opacity: 0.4; }
.support-empty-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.support-empty-desc  { font-size: 13px; color: var(--text-secondary); max-width: 280px; line-height: 1.6; margin-bottom: var(--space-4); }

/* ──────────────────────────────
   ACTIVITY PANEL — collapsible
────────────────────────────── */
.support-activity-panel {
    width: 268px;
    flex-shrink: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    max-height: 600px;
    transition: width 0.22s ease, opacity 0.18s ease, transform 0.22s ease;
    overflow: hidden;
}
.support-activity-panel.panel-hidden {
    width: 0;
    opacity: 0;
    transform: translateX(10px);
    pointer-events: none;
    border: none;
    margin-left: calc(-1 * var(--space-4));
}
.support-activity-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}
.support-activity-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}
.activity-feed-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-3);
    overflow-y: auto;
    flex: 1;
}
.activity-feed-item {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    background: var(--bg-sunken);
    border: 1px solid var(--border-subtle);
    font-size: 11.5px;
    cursor: pointer;
    transition: border-color 0.12s ease;
}
.activity-feed-item:hover { border-color: var(--color-primary); }
.activity-feed-meta {
    font-size: 10px;
    color: var(--text-tertiary);
    margin-top: 3px;
}
.support-empty-feed {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-8) var(--space-4);
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: center;
}

/* ──────────────────────────────
   PREMIUM TICKET DETAIL MODAL (stm-*)
────────────────────────────── */
.stm-root {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.stm-root[hidden] { display: none !important; }

/* Header */
.stm-header {
    background: #fff;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.stm-header-grid {
    display: grid;
    grid-template-columns: 1fr minmax(280px, 340px) auto;
    gap: 20px;
    align-items: start;
}

.stm-header-col--left { min-width: 0; }
.stm-header-col--center { min-width: 0; }
.stm-header-col--right { display: flex; justify-content: flex-end; }

.stm-header-id-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.stm-ticket-id {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-primary);
    letter-spacing: 0.02em;
}

.stm-ticket-uuid {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-tertiary);
}

.stm-header-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-tertiary);
    opacity: 0.5;
    flex-shrink: 0;
}

.stm-subject {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.stm-header-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.stm-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.stm-badge.badge-success { background: rgba(16,185,129,0.1); color: #059669; border-color: rgba(16,185,129,0.2); }
.stm-badge.badge-warning { background: rgba(245,158,11,0.1); color: #d97706; border-color: rgba(245,158,11,0.2); }
.stm-badge.badge-danger  { background: rgba(239,68,68,0.1); color: #dc2626; border-color: rgba(239,68,68,0.2); }
.stm-badge.badge-info    { background: rgba(59,130,246,0.1); color: #2563eb; border-color: rgba(59,130,246,0.2); }
.stm-badge.badge-gray,
.stm-badge.badge-secondary,
.stm-badge--muted { background: var(--bg-sunken); color: var(--text-secondary); border-color: var(--border-subtle); }

.stm-header-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.stm-header-dates strong { color: var(--text-secondary); font-weight: 600; }

/* Profile card in header */
.stm-profile-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-sunken);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
}

.stm-profile-block {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.stm-profile-block--agent { flex: 0 0 auto; }

.stm-profile-divider {
    width: 1px;
    height: 36px;
    background: var(--border-subtle);
    flex-shrink: 0;
}

.stm-profile-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.stm-profile-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); }
.stm-profile-name { font-size: 13px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stm-profile-meta { font-size: 11px; color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stm-profile-company { font-size: 11px; color: var(--color-primary); font-weight: 500; }

.stm-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    flex-shrink: 0;
}

.stm-avatar--lg { width: 52px; height: 52px; font-size: 16px; }

/* Header actions */
.stm-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.stm-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
    white-space: nowrap;
    line-height: 1.2;
}

.stm-btn:active:not(:disabled) { transform: scale(0.97); }
.stm-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.stm-btn--primary { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.stm-btn--primary:hover:not(:disabled) { filter: brightness(1.05); box-shadow: 0 2px 8px rgba(59,130,246,0.3); }

.stm-btn--success { background: #10b981; color: #fff; border-color: #10b981; }
.stm-btn--success:hover:not(:disabled) { filter: brightness(1.05); box-shadow: 0 2px 8px rgba(16,185,129,0.3); }

.stm-btn--secondary { background: var(--bg-surface); color: var(--text-primary); border-color: var(--border-subtle); }
.stm-btn--secondary:hover:not(:disabled) { background: var(--bg-sunken); border-color: var(--border-default); }

.stm-btn--ghost { background: transparent; color: var(--text-secondary); border-color: var(--border-subtle); }
.stm-btn--ghost:hover:not(:disabled) { background: var(--bg-sunken); color: var(--text-primary); }

.stm-btn--icon {
    padding: 7px;
    background: var(--bg-surface);
    border-color: var(--border-subtle);
    color: var(--text-secondary);
}

.stm-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.stm-icon-btn:hover { background: var(--bg-sunken); color: var(--text-primary); }

.stm-link-btn {
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    transition: opacity 0.15s ease;
}

.stm-link-btn:hover { opacity: 0.8; text-decoration: underline; }

/* Dropdown */
.stm-dropdown { position: relative; }

.stm-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 180px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 50;
}

.stm-dropdown-menu.open { display: block; animation: stm-fade-in 0.15s ease-out; }

.stm-dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    background: none;
    font-size: 12.5px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.12s ease;
}

.stm-dropdown-item:hover { background: var(--bg-sunken); }
.stm-dropdown-item--danger { color: var(--color-danger); }
.stm-dropdown-divider { height: 1px; background: var(--border-subtle); margin: 4px 0; }

/* Summary bar */
.stm-summary-bar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-sunken);
    border-bottom: 1px solid var(--border-subtle);
    overflow-x: auto;
    scrollbar-width: none;
}

.stm-summary-bar::-webkit-scrollbar { display: none; }

.stm-summary-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    min-width: 120px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.stm-summary-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15,23,42,0.06);
    border-color: var(--border-default);
}

.stm-summary-icon {
    width: 32px; height: 32px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.stm-summary-icon--agent { background: rgba(99,102,241,0.1); color: #6366f1; }
.stm-summary-icon--dept { background: rgba(59,130,246,0.1); color: #3b82f6; }
.stm-summary-icon--priority { background: rgba(245,158,11,0.1); color: #f59e0b; }
.stm-summary-icon--status { background: rgba(16,185,129,0.1); color: #10b981; }
.stm-summary-icon--sla { background: rgba(139,92,246,0.1); color: #8b5cf6; }
.stm-summary-icon--response { background: rgba(14,165,233,0.1); color: #0ea5e9; }
.stm-summary-icon--resolution { background: rgba(34,197,94,0.1); color: #22c55e; }

.stm-summary-body { min-width: 0; }
.stm-summary-label { display: block; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); margin-bottom: 2px; }
.stm-summary-value { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Tabs */
.stm-tabs {
    position: relative;
    background: #fff;
    padding: 0 24px;
}

.stm-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 14px 16px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: color 0.15s ease;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.stm-tab:hover { color: var(--text-primary); }
.stm-tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }

.stm-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    background: var(--bg-sunken);
    color: var(--text-secondary);
}

.stm-tab.active .stm-tab-badge {
    background: color-mix(in srgb, var(--color-primary) 15%, transparent);
    color: var(--color-primary);
}

/* Main content area */
.support-ticket-modal-body .support-ticket-modal-main {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.support-ticket-modal-main .drawer-tab-content {
    display: none;
    flex-direction: column;
    gap: 16px;
    animation: stm-fade-in 0.2s ease-out;
}

.support-ticket-modal-main .drawer-tab-content.active { display: flex; }

/* Cards */
.stm-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(15,23,42,0.04);
}

.stm-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 12px;
}

.stm-card-title {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.stm-card-actions { display: flex; gap: 4px; }

/* Customer card */
.stm-customer-layout {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: start;
}

.stm-customer-details { min-width: 0; }
.stm-customer-name { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }

.stm-customer-row {
    display: flex;
    gap: 12px;
    font-size: 12.5px;
    padding: 3px 0;
    color: var(--text-secondary);
}

.stm-field-label {
    flex: 0 0 110px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
}

.stm-quick-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stm-quick-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--bg-sunken);
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
    white-space: nowrap;
}

.stm-quick-btn:hover { background: var(--bg-surface); border-color: var(--color-primary); color: var(--color-primary); }

/* Description */
.stm-description {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
}

.stm-description--collapsed {
    max-height: 120px;
    overflow: hidden;
    position: relative;
}

.stm-description--collapsed::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 40px;
    background: linear-gradient(transparent, var(--bg-elevated));
    pointer-events: none;
}

.stm-description--expanded { max-height: none; }
.stm-description--expanded::after { display: none; }

/* Tags */
.stm-tags-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.stm-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    border: 1px solid transparent;
}

.stm-tag--add {
    background: transparent;
    border: 1px dashed var(--border-default);
    color: var(--color-primary);
    cursor: pointer;
    transition: background 0.12s ease;
}

.stm-tag--add:hover { background: color-mix(in srgb, var(--color-primary) 6%, transparent); }

.tag-suggestion-chip {
    cursor: pointer;
    font-size: 11px;
    color: var(--color-primary);
    margin-right: 8px;
    transition: opacity 0.12s ease;
}

.tag-suggestion-chip:hover { opacity: 0.7; text-decoration: underline; }

.stm-tag-suggestions {
    width: 100%;
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-tertiary);
}

/* SLA card */
.stm-sla-status {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 10px;
    border-radius: 999px;
}

.stm-sla-status--healthy { background: rgba(16,185,129,0.1); color: #059669; }
.stm-sla-status--warning { background: rgba(245,158,11,0.1); color: #d97706; }
.stm-sla-status--breached { background: rgba(239,68,68,0.1); color: #dc2626; }

.stm-sla-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.stm-sla-metric-label { display: block; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-tertiary); }
.stm-sla-metric-value { display: block; font-size: 13px; font-weight: 600; color: var(--text-primary); margin-top: 2px; }

.stm-sla-bar {
    height: 6px;
    border-radius: 999px;
    background: var(--border-subtle);
    overflow: hidden;
}

.stm-sla-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: #10b981;
    transition: width 0.4s ease, background 0.3s ease;
    width: 0%;
}

.stm-sla-bar-fill.sla-warning { background: #f59e0b; }
.stm-sla-bar-fill.sla-breached { background: #ef4444; }

#overview-sla-container[hidden] { display: none !important; }

/* Timeline preview */
.stm-timeline-preview { display: flex; flex-direction: column; gap: 0; }

.stm-timeline-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.stm-timeline-item:last-child { border-bottom: none; }

.stm-timeline-icon {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-sunken);
    border: 1px solid var(--border-subtle);
    flex-shrink: 0;
    font-size: 12px;
}

.stm-timeline-body { flex: 1; min-width: 0; }
.stm-timeline-text { font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; }
.stm-timeline-meta { font-size: 11px; color: var(--text-tertiary); margin-top: 3px; display: flex; align-items: center; gap: 6px; }

.stm-empty-state {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
}

/* Chat */
.stm-chat-feed {
    flex: 1;
    min-height: 200px;
    max-height: min(50vh, 480px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px 4px 16px;
    margin-bottom: 8px;
}

.stm-compose {
    border-top: 1px solid var(--border-subtle);
    padding-top: 16px;
}

.stm-compose-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    padding: 3px;
    background: var(--bg-sunken);
    border-radius: 10px;
    width: fit-content;
}

.stm-compose-tab {
    padding: 6px 14px;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}

.stm-compose-tab.active {
    background: var(--bg-elevated);
    color: var(--color-primary);
    box-shadow: 0 1px 3px rgba(15,23,42,0.08);
}

.stm-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.5;
    resize: vertical;
    background: var(--bg-surface);
    color: var(--text-primary);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.stm-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 12%, transparent);
}

.stm-compose-editor { position: relative; }

.stm-compose-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.stm-compose-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.stm-load-older { text-align: center; margin-bottom: 8px; }

/* Notes search */
.stm-search-wrap { position: relative; margin-bottom: 12px; }

.stm-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}

.stm-search-input {
    width: 100%;
    height: 38px;
    padding: 0 12px 0 36px;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    font-size: 13px;
    background: var(--bg-surface);
    color: var(--text-primary);
    transition: border-color 0.15s ease;
}

.stm-search-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.stm-notes-list { margin-bottom: 16px; }

/* Attachments grid */
.stm-attachments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.stm-upload-zone { position: relative; }

.stm-upload-icon { color: var(--text-tertiary); opacity: 0.5; margin-bottom: 4px; }

.stm-upload-progress {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: var(--color-primary);
    border-radius: 0 0 16px 16px;
    width: 0%;
    transition: width 0.2s ease;
}

/* History filters */
.stm-history-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.stm-filter-chip {
    padding: 5px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    background: var(--bg-surface);
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.stm-filter-chip:hover { border-color: var(--border-default); color: var(--text-primary); }
.stm-filter-chip.active { background: color-mix(in srgb, var(--color-primary) 10%, transparent); border-color: var(--color-primary); color: var(--color-primary); }

.stm-history-group { margin-bottom: 20px; }

.stm-history-date {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-subtle);
}

.stm-history-item .timeline-dot { font-size: 11px; }

/* Properties panel */
.support-ticket-modal-properties {
    position: sticky;
    top: 0;
    align-self: flex-start;
    max-height: 100%;
    overflow-y: auto;
    padding: 16px 20px 20px;
}

.stm-properties-toggle {
    display: none;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    background: var(--bg-surface);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    margin-bottom: 12px;
}

.stm-prop-list { display: flex; flex-direction: column; gap: 2px; }

.stm-prop-row {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
    align-items: flex-start;
}

.stm-prop-row:last-child { border-bottom: none; }

.stm-prop-icon {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    background: var(--bg-surface);
    color: var(--text-tertiary);
    flex-shrink: 0;
    margin-top: 2px;
}

.stm-prop-field { flex: 1; min-width: 0; }

.stm-prop-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

.stm-prop-value {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
}

.stm-prop-value--truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.stm-prop-select,
.stm-prop-input {
    width: 100%;
    font-size: 12px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    margin-top: 2px;
    transition: border-color 0.15s ease, opacity 0.15s ease;
}

.stm-prop-select:focus,
.stm-prop-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.stm-prop-sla { margin-bottom: 16px; }

.stm-audit-title {
    margin: 16px 0 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
}

/* Footer */
.stm-footer { background: #fff; }

/* Skeleton */
.support-ticket-modal-skeleton {
    display: none;
    flex-direction: column;
    height: 100%;
    padding: 24px;
    gap: 16px;
}

.stm-skeleton-header { margin-bottom: 8px; }
.stm-skel-id { width: 80px; height: 12px; margin-bottom: 8px; }
.stm-skel-title { width: 60%; height: 24px; margin-bottom: 12px; }
.stm-skel-badges { display: flex; gap: 8px; }
.stm-skel-badge { width: 70px; height: 22px; border-radius: 999px; }
.stm-skeleton-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stm-skel-card { height: 56px; border-radius: 12px; }
.stm-skel-block { width: 100%; height: 120px; border-radius: 16px; margin-bottom: 12px; }
.stm-skel-block--tall { height: 200px; }

.support-ticket-modal-skeleton-body {
    flex: 1;
    display: flex;
    gap: 20px;
    min-height: 0;
}

.support-ticket-modal-skeleton-main { flex: 1.8; }
.support-ticket-modal-skeleton-side { flex: 1.2; }

@keyframes skeleton-shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: 200px 0; }
}

@keyframes stm-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.skeleton-line {
    background: linear-gradient(90deg, var(--bg-sunken) 25%, var(--border-subtle) 50%, var(--bg-sunken) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite linear;
    border-radius: 4px;
}

.form-select.is-saving,
.form-input.is-saving,
.stm-prop-select.is-saving {
    opacity: 0.65;
    pointer-events: none;
    background-image: linear-gradient(90deg, transparent, rgba(79,70,229,0.08), transparent);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.2s infinite linear;
}

.form-select.is-saved,
.stm-prop-select.is-saved {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16,185,129,0.15);
}

.support-ticket-modal-audit-summary {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-subtle);
}

.support-ticket-modal-audit-item {
    font-size: 11.5px;
    color: var(--text-secondary);
    padding: 6px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.support-ticket-modal-audit-item:last-child { border-bottom: none; }

/* Enhanced message bubbles */
.support-msg-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.support-msg-row.internal-note .support-msg-bubble {
    background: rgba(245,158,11,0.06);
    border-color: rgba(245,158,11,0.2);
}

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

.support-msg-row.agent-msg .support-msg-bubble {
    background: color-mix(in srgb, var(--color-primary) 8%, var(--bg-elevated));
    border-color: color-mix(in srgb, var(--color-primary) 20%, transparent);
    border-radius: 16px 16px 4px 16px;
}

.support-msg-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: white;
    background: linear-gradient(135deg, #10b981, #059669);
    flex-shrink: 0;
}

.support-msg-row.agent-msg .support-msg-avatar { background: linear-gradient(135deg, #3b82f6, #6366f1); }
.support-msg-row.internal-note .support-msg-avatar { background: linear-gradient(135deg, #f59e0b, #d97706); }

.support-msg-bubble {
    max-width: 75%;
    background: var(--bg-sunken);
    border: 1px solid var(--border-subtle);
    border-radius: 16px 16px 16px 4px;
    padding: 10px 14px;
    font-size: 13.5px;
    line-height: 1.55;
}

.support-msg-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 10.5px;
    color: var(--text-tertiary);
    margin-bottom: 6px;
}

.support-msg-author { font-weight: 600; color: var(--text-secondary); }

/* Note cards */
.note-container {
    background: var(--bg-sunken);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    transition: border-color 0.12s ease;
}

.note-container:hover { border-color: var(--border-default); }
.note-container.pinned { border-color: rgba(245,158,11,0.4); background: rgba(245,158,11,0.04); }

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 8px;
}

.note-header-left { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.note-author { font-size: 12px; font-weight: 700; color: var(--text-primary); }
.note-badge { font-size: 10px; font-weight: 600; color: #b45309; background: rgba(245,158,11,0.1); padding: 2px 6px; border-radius: 4px; }
.note-time { font-size: 10.5px; color: var(--text-tertiary); }
.note-actions { display: flex; gap: 2px; }
.note-action-btn { background: none; border: none; cursor: pointer; padding: 2px 4px; border-radius: 4px; font-size: 12px; opacity: 0.6; transition: opacity 0.12s ease; }
.note-action-btn:hover { opacity: 1; background: var(--bg-surface); }
.note-body { font-size: 13px; line-height: 1.55; color: var(--text-secondary); }

/* Attachment cards */
.stm-att-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: var(--bg-sunken);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
}

.stm-att-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15,23,42,0.06);
}

.stm-att-preview {
    height: 80px;
    border-radius: 8px;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    overflow: hidden;
}

.stm-att-preview img { width: 100%; height: 100%; object-fit: cover; }

.stm-att-name { font-size: 12px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stm-att-meta { font-size: 10.5px; color: var(--text-tertiary); }
.stm-att-actions { display: flex; gap: 6px; margin-top: 4px; }

/* Legacy compat + shared */
.support-section-label {
    font-weight: 700;
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-3);
}

.support-description-box {
    background: var(--bg-sunken);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    font-size: 13px;
    line-height: 1.65;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 60px;
}

.support-conversation-feed {
    flex: 1;
    min-height: 180px;
    max-height: 340px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: var(--space-4);
}

.support-empty-state-sm { padding: var(--space-6); text-align: center; color: var(--text-tertiary); font-size: 13px; }

.support-reply-compose { padding-top: var(--space-2); }
.support-reply-textarea { width: 100%; resize: vertical; margin-bottom: var(--space-3); font-size: 13px; min-height: 72px; }
.support-reply-actions { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }

.support-file-indicator {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--bg-sunken);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 4px 10px;
    font-size: 12px;
    margin-bottom: var(--space-2);
}

.support-file-clear { background: none; border: none; color: var(--color-danger); cursor: pointer; padding: 0 4px; font-size: 14px; font-weight: 700; }

.support-note-alert {
    display: flex; align-items: center; gap: var(--space-2);
    background: rgba(245,158,11,0.07);
    color: #b45309;
    border: 1px solid rgba(245,158,11,0.25);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-3);
    font-size: 12px;
    margin-bottom: var(--space-3);
}

.support-attachments-list { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-4); min-height: 40px; }

.support-upload-zone {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: var(--space-2); padding: var(--space-5);
    border: 2px dashed var(--border-subtle);
    border-radius: var(--radius-xl);
    text-align: center;
    transition: border-color 0.15s ease, background 0.15s ease;
    cursor: pointer;
}

.support-upload-zone:hover,
.support-upload-zone.stm-drag-over {
    border-color: var(--color-primary);
    background: color-mix(in srgb, var(--bg-sunken), var(--color-primary) 3%);
}

.support-upload-label { font-size: 13px; color: var(--text-secondary); }
.support-upload-hint { font-size: 11px; color: var(--text-tertiary); }

.sub-timeline { position: relative; }
.timeline-item { position: relative; padding-left: var(--space-8); margin-bottom: var(--space-4); }
.timeline-item::before { content: ''; position: absolute; left: 11px; top: 24px; bottom: -16px; width: 2px; background: var(--border-subtle); }
.timeline-item:last-child::before { display: none; }

.sla-container { background: var(--bg-sunken); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-5); }
.sla-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sla-label { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); }
.sla-time-text { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.sla-progress-bg { height: 5px; border-radius: 3px; background: var(--border-subtle); overflow: hidden; }
.sla-progress-fill { height: 100%; border-radius: 3px; background: #10b981; transition: width 0.4s ease; }
.sla-progress-fill.sla-warning { background: #f59e0b; }
.sla-progress-fill.sla-breached { background: #ef4444; }

.badge-source-app   { background: rgba(59,130,246,0.1); color: #3b82f6; border: 1px solid rgba(59,130,246,0.2); }
.badge-source-email { background: rgba(16,185,129,0.1); color: #10b981; border: 1px solid rgba(16,185,129,0.2); }
.badge-source-admin { background: rgba(139,92,246,0.1); color: #8b5cf6; border: 1px solid rgba(139,92,246,0.2); }

.chat-inline-code {
    background: rgba(0,0,0,0.06);
    padding: 1px 4px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 12px;
}

.chat-code-block {
    background: rgba(0,0,0,0.06);
    padding: 8px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    font-size: 12px;
    margin: 6px 0;
}

/* Responsive modal */
@media (max-width: 1200px) {
    .stm-header-grid { grid-template-columns: 1fr; }
    .stm-header-col--right { justify-content: flex-start; }
    .stm-summary-bar { grid-template-columns: repeat(4, 1fr); }
    .stm-customer-layout { grid-template-columns: auto 1fr; }
    .stm-quick-actions { flex-direction: row; flex-wrap: wrap; grid-column: 1 / -1; }
}

@media (max-width: 1024px) {
    .stm-summary-bar { grid-template-columns: repeat(3, 1fr); }
    .stm-properties-toggle { display: flex; }
    .stm-properties-inner.collapsed { display: none; }
    .support-ticket-modal-properties { position: relative; max-height: none; }
}

@media (max-width: 768px) {
    .stm-summary-bar { grid-template-columns: repeat(2, 1fr); padding: 10px 16px; }
    .stm-header { padding: 16px; }
    .support-ticket-modal-body .support-ticket-modal-main { padding: 16px; }
    .stm-sla-metrics { grid-template-columns: 1fr; }
    .stm-customer-layout { grid-template-columns: 1fr; }
    .stm-quick-actions { flex-direction: column; }
}

.support-conversation-feed::-webkit-scrollbar,
.stm-chat-feed::-webkit-scrollbar,
.support-ticket-modal-main::-webkit-scrollbar,
.enterprise-modal-properties::-webkit-scrollbar { width: 4px; }

.support-conversation-feed::-webkit-scrollbar-thumb,
.stm-chat-feed::-webkit-scrollbar-thumb,
.support-ticket-modal-main::-webkit-scrollbar-thumb,
.enterprise-modal-properties::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 3px; }

/* ──────────────────────────────
   RESPONSIVE
────────────────────────────── */
@media (max-width: 1200px) {
    .support-col-customer { width: 160px; }
    .support-col-dept     { width: 95px; }
    .support-col-assignee { width: 130px; }
    .support-col-created  { width: 105px; }
}

@media (max-width: 1024px) {
    .support-activity-panel {
        position: fixed;
        right: 0; top: 0; bottom: 0;
        width: 290px;
        z-index: 500;
        border-radius: 0;
        max-height: 100vh;
        box-shadow: var(--shadow-xl);
    }
    .support-activity-panel.panel-hidden {
        transform: translateX(100%);
        width: 290px;
        opacity: 0;
    }
    .support-kpi-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .support-page-header { flex-direction: column; align-items: flex-start; }
    .support-filter-bar { gap: var(--space-2); }
    .support-inline-search-input { width: 150px; }
    .support-inline-search-input:focus { width: 180px; }
    .support-kpi-grid { grid-template-columns: repeat(2, 1fr); }

    /* Mobile card layout */
    .support-table { min-width: unset; table-layout: auto; }
    .support-table thead { display: none; }
    .support-table tbody tr {
        display: block;
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-lg);
        margin: 0 var(--space-3) var(--space-3);
        padding: var(--space-3);
        background: var(--bg-surface);
    }
    .support-table tbody td {
        display: flex;
        align-items: baseline;
        gap: var(--space-2);
        padding: 3px 0;
        overflow: visible;
    }
    .support-table tbody td::before {
        content: attr(data-label);
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--text-tertiary);
        min-width: 72px;
        flex-shrink: 0;
    }
    .support-table-wrapper { overflow-x: unset; }
}

/* Tab content transitions */
.drawer-tab-content {
    opacity: 0;
    transition: opacity 0.15s ease-in-out;
}

.drawer-tab-content.active {
    opacity: 1;
}

/* Responsive — ticket modal */
@media (max-width: 768px) {
    .support-ticket-modal-actions .header-action-buttons {
        width: 100%;
    }

    .support-header-profile-bar {
        grid-template-columns: 1fr !important;
    }
}

/* Split Overview Grid */
.support-overview-grid {
    display: flex;
    gap: var(--space-5);
    align-items: flex-start;
}

.support-overview-main {
    flex: 1.8;
    min-width: 0;
}

.support-overview-sidebar {
    flex: 1.2;
    background: var(--bg-sunken);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    height: fit-content;
}

.support-overview-sidebar .sub-details-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-bottom: 0;
}

.support-overview-sidebar .sub-details-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: none;
    padding: 0;
}

.support-overview-sidebar .sub-details-row .label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    min-width: unset;
}

.support-overview-sidebar .sub-details-row .val {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Customer Card */
.customer-meta-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-3);
}

.customer-meta-row {
    display: flex;
    gap: var(--space-3);
    align-items: center;
}

.customer-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    font-weight: 700;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.customer-meta-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-meta-email {
    font-size: 11px;
    color: var(--text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 1px;
}

/* Empty State Cards */
.support-empty-state-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-8) var(--space-4);
    gap: var(--space-3);
}

.support-empty-state-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-sunken);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    margin-bottom: var(--space-1);
    border: 1px solid var(--border-subtle);
}

.support-empty-state-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.support-empty-state-desc {
    font-size: 12px;
    color: var(--text-secondary);
    max-width: 320px;
    margin: 0;
    line-height: 1.5;
}

/* Ensure conversation and notes tabs lay out as flex containers when active */
#support-tab-conversation.active,
#support-tab-notes.active {
    display: flex !important;
    flex-direction: column;
    height: 100%;
}

/* Internal Private Notes Styling */
.note-container {
    background: rgba(245, 158, 11, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--space-3) var(--space-4);
    font-size: 13px;
    margin-bottom: var(--space-3);
    position: relative;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.note-container:hover {
    border-color: rgba(245, 158, 11, 0.35);
    box-shadow: var(--shadow-sm);
}
.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
}
.note-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.note-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}
.note-padlock {
    font-size: 11px;
    color: #b45309;
}
.note-author {
    font-weight: 700;
    color: #b45309;
}
.note-badge {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
    letter-spacing: 0.05em;
}
.note-time {
    font-size: 11px;
    color: var(--text-tertiary);
}
.note-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.note-container:hover .note-actions {
    opacity: 1;
}
.note-action-btn {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 3px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.12s ease, background-color 0.12s ease;
}
.note-action-btn:hover {
    color: var(--text-primary);
    background-color: rgba(0,0,0,0.05);
}
.note-body {
    line-height: 1.55;
    white-space: pre-wrap;
    color: var(--text-primary);
}
.note-edit-form {
    margin-top: 4px;
}
.note-edit-textarea {
    width: 100%;
    resize: vertical;
    font-size: 13px;
    margin-bottom: var(--space-2);
    min-height: 70px;
}
.note-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
}

/* System Conversation Events */
.system-event-row {
    display: flex;
    justify-content: center;
    margin: var(--space-3) 0;
    width: 100%;
}
.system-event-bubble {
    background: var(--bg-sunken);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 4px 12px;
    font-size: 11px;
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.system-event-time {
    font-style: normal;
    font-size: 10px;
    color: var(--text-tertiary);
}

/* Image Lightbox Modal */
.lightbox-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-content {
    max-width: 85%;
    max-height: 85%;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    object-fit: contain;
    transform: scale(0.95);
    animation: lightboxScaleUp 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes lightboxScaleUp {
    to { transform: scale(1); }
}
.lightbox-close {
    position: absolute;
    top: var(--space-6);
    right: var(--space-6);
    color: #fff;
    font-size: 36px;
    font-weight: 300;
    background: transparent;
    border: none;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.08);
    transition: background-color 0.15s ease, transform 0.15s ease;
}
.lightbox-close:hover {
    background-color: rgba(255,255,255,0.18);
    transform: scale(1.05);
}
.attachment-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12.5px;
}
.att-mime-icon {
    flex-shrink: 0;
    color: var(--text-tertiary);
}

/* Redesigned Enterprise Support Additional Styles */
.support-upload-zone {
    border: 2px dashed var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-sunken);
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
    text-align: center;
}
.support-upload-zone:hover, .support-upload-zone.dragover {
    border-color: var(--color-primary);
    background: rgba(var(--color-primary-rgb, 99, 102, 241), 0.04);
}
.support-upload-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}
.support-upload-hint {
    font-size: 11px;
    color: var(--text-tertiary);
}

/* Conversation Mode Toggles */
.tab-toggle-option {
    transition: background-color 0.12s ease, color 0.12s ease;
}
.tab-toggle-option.active {
    background-color: var(--color-primary);
    color: white !important;
}

/* Pinned Internal Note Highlight */
.note-container.pinned {
    background: rgba(245, 158, 11, 0.08);
    border-left: 3px solid #d97706;
}

/* Resizable Columns */
.resizable-th {
    position: relative;
    user-select: none;
}
.resizer-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    z-index: 10;
    transition: background-color 0.15s ease;
}
.resizer-handle:hover, .resizer-handle.resizing {
    background-color: var(--color-primary);
}

/* Floating Bulk Actions Toolbar */
.floating-bulk-actions {
    position: fixed;
    bottom: var(--space-6);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: var(--space-3) var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    z-index: 999;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    opacity: 0;
}
.floating-bulk-actions.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.bulk-count-badge {
    background: var(--color-primary);
    color: white;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}



