.ticket-ltr {
    direction: ltr;
    unicode-bidi: isolate;
    display: inline-block;
    text-align: left;
}

.ticket-text-break {
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: normal;
}

.ticket-summary {
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 55%, rgba(245, 158, 11, 0.08) 100%);
    padding: 1.5rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ticket-summary__layout {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.ticket-summary__content {
    min-width: 0;
}

.ticket-summary__label {
    margin: 0 0 0.5rem;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.ticket-summary__number {
    margin: 0;
    color: #b45309;
    font-size: 0.95rem;
    font-weight: 700;
}

.ticket-summary__subject {
    margin: 0.75rem 0 0;
    color: #111827;
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: break-word;
}

.ticket-summary__badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.ticket-badge {
    display: inline-flex;
    align-items: center;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.ticket-badge--gray {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #374151;
}

.ticket-badge--info {
    background: #eef6ff;
    border-color: #c6ddff;
    color: #1d4ed8;
}

.ticket-badge--success {
    background: #ecfdf3;
    border-color: #b7ebcb;
    color: #15803d;
}

.ticket-badge--warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #b45309;
}

.ticket-badge--danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.ticket-badge--primary {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #c2410c;
}

.ticket-timeline__item {
    position: relative;
    padding-inline-start: 2rem;
}

.ticket-timeline__line {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0.75rem;
    width: 1px;
    background: #e5e7eb;
}

.ticket-timeline__marker {
    position: absolute;
    inset-inline-start: 0;
    top: 0.375rem;
    width: 1.5rem;
    height: 1.5rem;
    border: 4px solid #ffffff;
    border-radius: 999px;
    background: #9ca3af;
    box-sizing: border-box;
}

.ticket-timeline__item--primary .ticket-timeline__marker {
    background: #f59e0b;
}

.ticket-timeline__item--info .ticket-timeline__marker {
    background: #3b82f6;
}

.ticket-timeline__item--success .ticket-timeline__marker {
    background: #22c55e;
}

.ticket-timeline__item--warning .ticket-timeline__marker {
    background: #f59e0b;
}

.ticket-timeline__item--danger .ticket-timeline__marker {
    background: #ef4444;
}

.ticket-timeline__item--gray .ticket-timeline__marker {
    background: #9ca3af;
}

.ticket-timeline__body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-radius: 1rem;
    background: rgba(249, 250, 251, 0.92);
    padding: 1rem;
}

.ticket-timeline__header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ticket-timeline__title {
    margin: 0;
    color: #111827;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
}

.ticket-timeline__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    color: #4b5563;
    font-size: 0.9375rem;
}

.ticket-timeline__actor {
    color: #1f2937;
    font-weight: 600;
}

.ticket-timeline__separator {
    color: #9ca3af;
}

.ticket-timeline__datetime {
    color: #6b7280;
}

.ticket-transfer {
    display: grid;
    gap: 0.75rem;
}

.ticket-transfer__party {
    border: 1px solid #e5e7eb;
    border-radius: 0.875rem;
    background: rgba(255, 255, 255, 0.92);
    padding: 0.875rem 1rem;
}

.ticket-transfer__label,
.ticket-timeline__detail-label,
.ticket-timeline__note-label {
    margin: 0;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 700;
}

.ticket-transfer__department {
    margin: 0.5rem 0 0;
    color: #111827;
    font-size: 0.95rem;
    font-weight: 600;
}

.ticket-transfer__user {
    margin: 0.25rem 0 0;
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.5;
}

.ticket-transfer__arrow {
    color: #9ca3af;
    font-size: 1.25rem;
    line-height: 1;
    text-align: center;
}

.ticket-timeline__details {
    display: grid;
    gap: 0.75rem;
}

.ticket-timeline__detail,
.ticket-timeline__note {
    border-radius: 0.875rem;
    background: rgba(255, 255, 255, 0.92);
    padding: 0.875rem 1rem;
}

.ticket-timeline__detail-value {
    margin: 0.25rem 0 0;
    color: #1f2937;
    font-size: 0.95rem;
    line-height: 1.5;
}

.ticket-timeline__note-content {
    margin-top: 0.5rem;
    color: #1f2937;
    font-size: 0.95rem;
    line-height: 1.7;
}

.dark .ticket-summary {
    border-color: rgba(255, 255, 255, 0.08);
    background: linear-gradient(135deg, #111827 0%, #111827 60%, rgba(245, 158, 11, 0.12) 100%);
    box-shadow: none;
}

.dark .ticket-summary__label,
.dark .ticket-transfer__label,
.dark .ticket-timeline__detail-label,
.dark .ticket-timeline__note-label,
.dark .ticket-timeline__datetime {
    color: #9ca3af;
}

.dark .ticket-summary__number {
    color: #fbbf24;
}

.dark .ticket-summary__subject,
.dark .ticket-timeline__title,
.dark .ticket-transfer__department,
.dark .ticket-timeline__detail-value {
    color: #f9fafb;
}

.dark .ticket-timeline__line {
    background: rgba(255, 255, 255, 0.1);
}

.dark .ticket-timeline__marker {
    border-color: #030712;
}

.dark .ticket-timeline__body {
    background: rgba(255, 255, 255, 0.04);
}

.dark .ticket-timeline__meta,
.dark .ticket-transfer__user,
.dark .ticket-timeline__note-content {
    color: #d1d5db;
}

.dark .ticket-timeline__actor {
    color: #f3f4f6;
}

.dark .ticket-timeline__separator {
    color: #6b7280;
}

.dark .ticket-transfer__party,
.dark .ticket-timeline__detail,
.dark .ticket-timeline__note {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(3, 7, 18, 0.42);
}

@media (min-width: 1280px) {
    .ticket-summary__layout {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }

    .ticket-summary__badges {
        justify-content: flex-end;
        max-width: 40rem;
    }
}

@media (min-width: 1024px) {
    .ticket-transfer {
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
    }

    .ticket-timeline__details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .ticket-summary {
        padding: 1.25rem;
    }

    .ticket-summary__subject {
        font-size: 1.5rem;
    }
}

.ticket-time {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ticket-time__integrity {
    border: 1px solid #fecaca;
    border-radius: 1rem;
    background: #fef2f2;
    padding: 1rem 1.125rem;
}

.ticket-time__integrity-title {
    margin: 0;
    color: #991b1b;
    font-size: 0.95rem;
    font-weight: 700;
}

.ticket-time__integrity-list {
    margin: 0.75rem 0 0;
    padding-inline-start: 1.25rem;
    color: #7f1d1d;
}

.ticket-time__metrics {
    display: grid;
    gap: 0.875rem;
}

.ticket-time__metric,
.ticket-time__panel {
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    background: #ffffff;
    padding: 1rem 1.125rem;
}

.ticket-time__metric-label,
.ticket-time__panel-description,
.ticket-time__segment-user,
.ticket-time__total-meta,
.ticket-time__empty {
    margin: 0;
    color: #6b7280;
    font-size: 0.875rem;
}

.ticket-time__metric-value,
.ticket-time__segment-duration,
.ticket-time__total-duration {
    margin: 0.5rem 0 0;
    color: #111827;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
}

.ticket-time__grid,
.ticket-time__segments,
.ticket-time__totals {
    display: grid;
    gap: 1rem;
}

.ticket-time__panel-header {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.ticket-time__panel-header--spaced {
    margin-top: 1.25rem;
}

.ticket-time__panel-title,
.ticket-time__segment-department,
.ticket-time__total-name {
    margin: 0;
    color: #111827;
    font-size: 1rem;
    font-weight: 700;
}

.ticket-time__segment {
    border: 1px solid #e5e7eb;
    border-radius: 0.875rem;
    background: #f9fafb;
    padding: 0.875rem 1rem;
}

.ticket-time__segment-header,
.ticket-time__total {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.ticket-time__segment-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.ticket-time__segment-datetime {
    color: #4b5563;
}

.ticket-time__segment-arrow {
    color: #9ca3af;
}

.dark .ticket-time__integrity {
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(127, 29, 29, 0.18);
}

.dark .ticket-time__integrity-title {
    color: #fca5a5;
}

.dark .ticket-time__integrity-list {
    color: #fecaca;
}

.dark .ticket-time__metric,
.dark .ticket-time__panel {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

.dark .ticket-time__metric-label,
.dark .ticket-time__panel-description,
.dark .ticket-time__segment-user,
.dark .ticket-time__total-meta,
.dark .ticket-time__empty,
.dark .ticket-time__segment-meta,
.dark .ticket-time__segment-datetime {
    color: #9ca3af;
}

.dark .ticket-time__metric-value,
.dark .ticket-time__panel-title,
.dark .ticket-time__segment-department,
.dark .ticket-time__segment-duration,
.dark .ticket-time__total-name,
.dark .ticket-time__total-duration {
    color: #f9fafb;
}

.dark .ticket-time__segment {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(3, 7, 18, 0.42);
}

.dark .ticket-time__segment-arrow {
    color: #6b7280;
}

@media (min-width: 900px) {
    .ticket-time__metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ticket-time__grid {
        grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .ticket-time__metric-value,
    .ticket-time__segment-duration,
    .ticket-time__total-duration {
        font-size: 1.05rem;
    }

    .ticket-time__segment-header,
    .ticket-time__total {
        flex-direction: column;
    }
}

.dashboard-shell {
    display: grid;
    gap: 1.25rem;
    max-width: 100%;
}

.dashboard-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
    gap: 1rem;
    align-items: end;
    padding: 1.125rem 1.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 1.25rem;
    background: linear-gradient(135deg, #fff7ed 0%, #ffffff 58%, #f8fafc 100%);
}

.dashboard-header__eyebrow,
.dashboard-kpi__label,
.dashboard-kpi__help,
.dashboard-panel__description,
.dashboard-ticket-row__label {
    margin: 0;
    color: #64748b;
}

.dashboard-header__eyebrow {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dashboard-header__title,
.dashboard-panel__title {
    margin: 0;
    color: #0f172a;
}

.dashboard-header__title {
    font-size: 1.625rem;
    font-weight: 800;
    line-height: 1.15;
}

.dashboard-header__description {
    margin: 0.35rem 0 0;
    max-width: 42rem;
    color: #334155;
    font-size: 0.95rem;
    line-height: 1.6;
}

.dashboard-header__user {
    min-width: 0;
    padding: 0.8rem 0.95rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(251, 191, 36, 0.25);
}

.dashboard-header__user-label {
    margin: 0;
    color: #92400e;
    font-size: 0.8rem;
}

.dashboard-header__user-name {
    margin: 0.25rem 0 0;
    color: #111827;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.dashboard-kpi {
    min-height: 8.9rem;
    padding: 1rem 1.05rem;
    border: 1px solid #e5e7eb;
    border-radius: 1.25rem;
    background: #ffffff;
}

.dashboard-kpi:nth-child(-n + 4) {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.dashboard-kpi__value {
    margin: 0.45rem 0 0.55rem;
    color: #0f172a;
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.1;
}

.dashboard-kpi__label {
    font-size: 0.84rem;
    font-weight: 700;
}

.dashboard-kpi__help {
    font-size: 0.83rem;
    line-height: 1.5;
}

.dashboard-kpi--total {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.dashboard-kpi--open {
    background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%);
}

.dashboard-kpi--completed {
    background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
}

.dashboard-kpi--overdue {
    background: linear-gradient(180deg, #fff1f2 0%, #ffffff 100%);
}

.dashboard-kpi--new {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.dashboard-kpi--progress {
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}

.dashboard-kpi--blocked {
    background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
}

.dashboard-kpi--average {
    background: linear-gradient(180deg, #fffbeb 0%, #fff7ed 100%);
}

.dashboard-panels {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.dashboard-panel {
    align-self: start;
    min-width: 0;
    padding: 1rem 1.05rem;
    border: 1px solid #e5e7eb;
    border-radius: 1.25rem;
    background: #ffffff;
}

.dashboard-panel--full {
    grid-column: 1 / -1;
}

.dashboard-panel__header {
    margin-bottom: 0.85rem;
}

.dashboard-panel__description {
    margin-top: 0.3rem;
    font-size: 0.9rem;
    line-height: 1.55;
}

.dashboard-ticket-list {
    display: grid;
    gap: 0.75rem;
    max-width: 100%;
}

.dashboard-ticket-row {
    display: grid;
    gap: 0.65rem;
    min-width: 0;
    max-width: 100%;
    padding: 0.85rem 0.9rem;
    border: 1px solid #e5e7eb;
    border-radius: 1.1rem;
    background: #fcfcfd;
    text-decoration: none;
}

.dashboard-ticket-row:hover,
.dashboard-ticket-row:focus-visible {
    border-color: #f59e0b;
    background: #fffbeb;
    outline: none;
}

.dashboard-ticket-row__summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem 0.75rem;
    align-items: start;
    min-width: 0;
}

.dashboard-ticket-row__number,
.dashboard-ticket-row__subject,
.dashboard-ticket-row__value,
.dashboard-panel__empty {
    margin: 0;
}

.dashboard-ticket-row__number {
    color: #b45309;
    font-size: 0.875rem;
    font-weight: 700;
    justify-self: end;
    align-self: start;
    max-width: 100%;
}

.dashboard-ticket-row__subject {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.5;
    min-width: 0;
    overflow-wrap: anywhere;
}

.dashboard-ticket-row__meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem 0.85rem;
    align-items: start;
    min-width: 0;
}

.dashboard-ticket-row__item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 0.25rem 0.45rem;
    min-width: 0;
}

.dashboard-ticket-row__label {
    font-size: 0.75rem;
}

.dashboard-ticket-row__value {
    color: #1f2937;
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 0;
    overflow-wrap: anywhere;
}

.dashboard-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    justify-self: start;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.dashboard-badge--gray {
    background: #e5e7eb;
    color: #374151;
}

.dashboard-badge--info {
    background: #dbeafe;
    color: #1d4ed8;
}

.dashboard-badge--success {
    background: #dcfce7;
    color: #166534;
}

.dashboard-badge--warning {
    background: #fef3c7;
    color: #92400e;
}

.dashboard-badge--danger {
    background: #fee2e2;
    color: #b91c1c;
}

.dashboard-badge--primary {
    background: #fef3c7;
    color: #a16207;
}

.dark .dashboard-header {
    border-color: #334155;
    background: linear-gradient(135deg, rgba(120, 53, 15, 0.35) 0%, rgba(15, 23, 42, 0.96) 55%, rgba(30, 41, 59, 0.96) 100%);
}

.dark .dashboard-header__eyebrow,
.dark .dashboard-kpi__label,
.dark .dashboard-kpi__help,
.dark .dashboard-panel__description,
.dark .dashboard-ticket-row__label {
    color: #94a3b8;
}

.dark .dashboard-header__title,
.dark .dashboard-panel__title,
.dark .dashboard-kpi__value,
.dark .dashboard-ticket-row__subject,
.dark .dashboard-ticket-row__value,
.dark .dashboard-header__user-name {
    color: #f8fafc;
}

.dark .dashboard-header__description {
    color: #cbd5e1;
}

.dark .dashboard-header__user,
.dark .dashboard-kpi,
.dark .dashboard-panel,
.dark .dashboard-ticket-row {
    border-color: #334155;
    background: rgba(15, 23, 42, 0.88);
}

.dark .dashboard-ticket-row:hover,
.dark .dashboard-ticket-row:focus-visible {
    border-color: #f59e0b;
    background: rgba(51, 65, 85, 0.95);
}

.dark .dashboard-ticket-row__number,
.dark .dashboard-header__user-label {
    color: #fbbf24;
}

.dark .dashboard-badge--gray {
    background: rgba(148, 163, 184, 0.18);
    color: #e2e8f0;
}

.dark .dashboard-badge--info {
    background: rgba(59, 130, 246, 0.18);
    color: #bfdbfe;
}

.dark .dashboard-badge--success {
    background: rgba(34, 197, 94, 0.18);
    color: #bbf7d0;
}

.dark .dashboard-badge--warning {
    background: rgba(245, 158, 11, 0.18);
    color: #fde68a;
}

.dark .dashboard-badge--danger {
    background: rgba(239, 68, 68, 0.18);
    color: #fecaca;
}

.dark .dashboard-badge--primary {
    background: rgba(251, 191, 36, 0.18);
    color: #fde68a;
}

@media (max-width: 1100px) {
    .dashboard-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-panels {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        grid-template-columns: 1fr;
    }

    .dashboard-kpis {
        grid-template-columns: 1fr;
    }

    .dashboard-ticket-row__meta {
        grid-template-columns: 1fr;
    }

    .dashboard-ticket-row__summary {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .dashboard-ticket-row__number {
        justify-self: start;
    }
}
