/* Main Styles */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --info-color: #3b82f6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Global interactive cursor contract.
   Explicit cursor utilities (grab, zoom-in, default, etc.) remain valid overrides. */
:where(
    a[href]:not([aria-disabled="true"]),
    button:not(:disabled):not([aria-disabled="true"]),
    input[type="button"]:not(:disabled),
    input[type="submit"]:not(:disabled),
    input[type="reset"]:not(:disabled),
    input[type="checkbox"]:not(:disabled),
    input[type="radio"]:not(:disabled),
    select:not(:disabled),
    summary,
    label[for],
    [role="button"]:not([aria-disabled="true"]),
    [role="tab"]:not([aria-disabled="true"]),
    .ui-interactive
) {
    cursor: pointer;
}

:where(
    button:disabled,
    input:disabled,
    select:disabled,
    [aria-disabled="true"]
) {
    cursor: not-allowed;
}

/* Sidebar Styles */
.sidebar {
    transition: width 0.3s ease, transform 0.3s ease;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1), 4px 0 16px rgba(0, 0, 0, 0.05);
}

.sidebar.collapsed {
    width: 4rem;
    overflow-y: auto;
    overflow-x: hidden;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

.sidebar:hover::-webkit-scrollbar-thumb {
    background: #cbd5e1;
}

/* Sidebar Toggle Button - z-index thấp hơn modal (z-50) để không che popup */
#sidebarToggle {
    z-index: 30 !important;
    /* Không có transition để di chuyển ngay lập tức */
}

@media (min-width: 1024px) {
    #sidebarToggle {
        position: absolute !important;
        /* Không có transition để di chuyển ngay lập tức */
    }
}

#headerSidebarSlot {
    width: 256px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.75rem !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
}

#sidebarToggle {
    position: static !important;
    transform: none !important;
    flex-shrink: 0 !important;
}

#headerLogo {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
}

@media (max-width: 1023px) {
    #headerLogo img {
        height: 2.25rem !important;
        max-width: 180px !important;
    }
}

/* Mobile Sidebar - Hidden by default, shown when toggled */
@media (max-width: 1023px) {
    .sidebar {
        width: 16rem;
        top: 56px !important;
        height: calc(100% - 56px) !important;
    }
    
    .sidebar.collapsed {
        width: 4rem;
    }
}

.sidebar-text {
    transition: opacity 0.2s ease, visibility 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar .nav-section-title {
    position: relative;
    padding: 0.875rem 0.625rem 0.375rem;
    border-radius: 0.5rem;
    background: linear-gradient(90deg, rgb(241 245 249 / 90%) 0%, rgb(248 250 252 / 65%) 72%, rgb(255 255 255 / 0%) 100%);
}

.sidebar .sidebar-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border: 0;
    text-align: left;
    cursor: pointer;
}

.sidebar-group-caret {
    flex-shrink: 0;
    font-size: 0.875rem;
    transition: transform 0.25s ease;
}

.sidebar-group-toggle[aria-expanded="false"] .sidebar-group-caret {
    transform: rotate(-90deg);
}

.sidebar-group-content {
    display: grid;
    grid-template-rows: 1fr;
    opacity: 1;
    transition: grid-template-rows 0.3s ease, opacity 0.2s ease;
}

.sidebar-group-content-inner {
    min-height: 0;
    overflow: hidden;
}

.sidebar-group-content.is-collapsed {
    grid-template-rows: 0fr;
    opacity: 0;
}

.sidebar.sidebar-groups-initializing .sidebar-group-content,
.sidebar.sidebar-groups-initializing .sidebar-group-caret {
    transition: none;
}

.sidebar-menu-gradient-separator {
    position: relative;
    width: calc(100% - 1.5rem);
    height: 1px;
    min-height: 1px;
    margin: 0.4rem 0.75rem;
    border-radius: 9999px;
    background: linear-gradient(90deg, rgb(30 41 59 / 84%) 0%, rgb(71 85 105 / 52%) 30%, rgb(100 116 139 / 28%) 62%, rgb(148 163 184 / 12%) 86%, transparent 100%);
    box-shadow: none;
    transform: scaleY(0.5);
    transform-origin: center;
    flex-shrink: 0;
}

.sidebar-menu-gradient-separator::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 0;
    width: 100%;
    height: 1px;
    border-radius: inherit;
    background: linear-gradient(90deg, rgb(255 255 255 / 94%) 0%, rgb(255 255 255 / 58%) 34%, rgb(255 255 255 / 26%) 66%, rgb(255 255 255 / 10%) 88%, transparent 100%);
}

.sidebar.collapsed .sidebar-text {
    opacity: 0;
    visibility: hidden;
    width: 0;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
    margin-left: 0;
    margin-right: 0;
}

.sidebar.collapsed .nav-item i {
    margin: 0 !important;
    font-size: 1.25rem;
}

.sidebar.collapsed .nav-section-title {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .sidebar-group-content,
    .sidebar-group-caret {
        transition: none;
    }
}

.sidebar.collapsed .sidebar-menu-gradient-separator {
    width: 2rem;
    margin-left: auto;
    margin-right: auto;
}

/* Shared data-grid action column: always first and visible during horizontal scroll. */
.data-grid-actions-sticky {
    position: sticky;
    left: 0;
    z-index: 10;
    min-width: 96px;
    white-space: nowrap;
    background-color: #fff;
    box-shadow: 1px 0 0 #e5e7eb, 8px 0 12px -12px rgb(15 23 42 / 55%);
}

thead .data-grid-actions-sticky {
    z-index: 20;
    background-color: #f9fafb;
}

tr:hover > .data-grid-actions-sticky {
    background-color: #f9fafb;
}

/* Keep overlay-style horizontal scrollbars clear of the final data row. */
.data-grid-horizontal-scroll {
    padding-bottom: 12px;
}

.settings-time-layout {
    align-items: start;
}

.settings-time-controls,
.settings-time-preview {
    align-self: start;
    padding: 20px;
    border: 1px solid #dbe4f0;
    border-radius: 14px;
}

.settings-time-controls {
    background-color: #ffffff;
    box-shadow: 0 8px 22px -20px rgb(15 23 42 / 32%);
}

.settings-time-preview {
    display: flex;
    flex-direction: column;
    background: linear-gradient(145deg, #f8fafc 0%, #eff6ff 100%);
    box-shadow: 0 12px 28px -18px rgb(15 23 42 / 35%);
}

@media (min-width: 1024px) {
    .settings-time-layout {
        align-items: stretch;
    }

    .settings-time-controls,
    .settings-time-preview {
        align-self: stretch;
    }

    .settings-time-preview {
        justify-content: center;
    }
}

.settings-time-preview__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.settings-time-preview__icon {
    display: inline-flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background-color: #dbeafe;
    color: #2563eb;
}

.settings-time-preview__primary,
.settings-time-preview__detail {
    border: 1px solid #e2e8f0;
    background-color: rgb(255 255 255 / 82%);
}

.settings-time-preview__primary {
    padding: 16px;
    border-radius: 10px;
}

.settings-time-preview__details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.settings-time-preview__detail {
    min-width: 0;
    padding: 12px;
    border-radius: 9px;
}

.settings-time-preview__label {
    display: block;
    margin-bottom: 5px;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.settings-time-preview__value {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
    color: #1e293b;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.9375rem;
    font-weight: 600;
}

.settings-time-preview__value--primary {
    color: #1d4ed8;
    font-size: 1.125rem;
}

@media (max-width: 479px) {
    .settings-time-preview__details {
        grid-template-columns: 1fr;
    }
}

/* Shared lifecycle segmented tabs. Active states use both color and a
   stronger border/shadow so they remain distinct without relying on text. */
[data-lifecycle-tabs] {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    background: linear-gradient(180deg, #e8edf4 0%, #dbe3ed 100%);
    border-color: #c5d0de;
    box-shadow: inset 0 1px 2px rgb(15 23 42 / 9%), 0 1px 2px rgb(15 23 42 / 6%);
}

[data-lifecycle-tabs] > :is(a, button) {
    flex: 0 0 auto;
}

@media (max-width: 1023px) {
    [data-lifecycle-tabs] {
        flex-wrap: wrap;
        overflow: visible;
    }
}

[data-lifecycle-tabs] > :is(a, button):not(.bg-white) {
    color: #475569;
}

[data-lifecycle-tabs] > :is(a, button):not(.bg-white) > i {
    color: #64748b;
}

[data-lifecycle-tabs] > :is(a, button):not(.bg-white):hover {
    background-color: rgb(255 255 255 / 58%);
    color: #1e293b;
}

[data-lifecycle-tabs] > :is(a, button):not(.bg-white):hover > i {
    color: #334155;
}

[data-lifecycle-tabs] > :is(a, button).bg-white.text-blue-700 {
    background-color: #eff6ff;
    border-color: #93c5fd;
    box-shadow: inset 0 -3px 0 #2563eb, 0 1px 3px rgb(37 99 235 / 18%);
}

[data-lifecycle-tabs] > :is(a, button).bg-white.text-emerald-700 {
    background-color: #ecfdf5;
    border-color: #6ee7b7;
    box-shadow: inset 0 -3px 0 #059669, 0 1px 3px rgb(5 150 105 / 18%);
}

[data-lifecycle-tabs] > :is(a, button).bg-white.text-orange-700 {
    background-color: #fff7ed;
    border-color: #fdba74;
    box-shadow: inset 0 -3px 0 #ea580c, 0 1px 3px rgb(234 88 12 / 18%);
}

[data-lifecycle-tabs] > :is(a, button).bg-white.text-red-700 {
    background-color: #fef2f2;
    border-color: #fca5a5;
    box-shadow: inset 0 -3px 0 #dc2626, 0 1px 3px rgb(220 38 38 / 18%);
}

[data-lifecycle-tabs] > :is(a, button):focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Sidebar Tooltip Styles */
.nav-item {
    position: relative;
}

/* Active sidebar item: a restrained tab treatment that identifies location
   without competing visually with the page-level lifecycle tabs. */
.sidebar .nav-item.bg-blue-50.text-blue-600 {
    background-color: rgb(239 246 255 / 72%) !important;
    color: #2563eb !important;
    font-weight: 500;
    box-shadow: inset 0 0 0 1px rgb(147 197 253 / 42%), inset 0 -2px 0 rgb(59 130 246 / 48%), 0 1px 2px rgb(37 99 235 / 7%);
}

.sidebar .nav-item.bg-blue-50.text-blue-600:hover {
    background-color: rgb(239 246 255 / 88%) !important;
}

/* Tooltip khi sidebar collapsed được xử lý bằng JS (sidebar.js -> initSidebarTooltips):
   dùng phần tử position:fixed gắn vào <body> để không bị overflow-x:hidden của sidebar cắt. */

/* Modal Dialog Styles */
#modalDialog {
    /* Confirmation/alert dialogs can be opened from another active modal. */
    z-index: 1100000;
}

#modalBackdrop {
    backdrop-filter: blur(2px);
}

#commentModal {
    z-index: 10001;
}

/* Card Styles */
.card {
    @apply bg-white rounded-lg shadow-lg border border-gray-200;
}

.card-header {
    @apply px-6 py-4 border-b border-gray-200;
}

.card-body {
    @apply p-6;
}

/* Button Styles */
.btn {
    @apply px-4 py-2 rounded-lg font-medium transition duration-200;
}

.btn-primary {
    @apply bg-blue-600 text-white hover:bg-blue-700;
}

.btn-secondary {
    @apply bg-gray-200 text-gray-700 hover:bg-gray-300;
}

.btn-danger {
    @apply bg-red-600 text-white hover:bg-red-700;
}

.btn-success {
    @apply bg-green-600 text-white hover:bg-green-700;
}

/* Badge Styles */
.badge {
    @apply px-2 py-1 text-xs rounded;
}

.badge-primary {
    @apply bg-blue-100 text-blue-800;
}

.badge-success {
    @apply bg-green-100 text-green-800;
}

.badge-warning {
    @apply bg-yellow-100 text-yellow-800;
}

.badge-danger {
    @apply bg-red-100 text-red-800;
}

/* Notification Badge Blink Animation */
@keyframes notificationBlink {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.15);
    }
}

.notification-badge {
    animation: notificationBlink 1.2s ease-in-out infinite !important;
    will-change: opacity, transform;
}

/* Form Styles */
.form-group {
    @apply mb-4;
}

.form-label {
    @apply block text-sm font-medium text-gray-700 mb-1;
}

.form-input {
    @apply w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-hidden focus:ring-2 focus:ring-blue-500;
}

.form-select {
    @apply w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-hidden focus:ring-2 focus:ring-blue-500;
}

.form-textarea {
    @apply w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-hidden focus:ring-2 focus:ring-blue-500;
}

/* Table Styles */
.table {
    @apply min-w-full divide-y divide-gray-200;
}

.table thead {
    @apply bg-gray-50;
}

.table th {
    @apply px-6 py-3 text-left text-xs font-semibold text-gray-600 uppercase tracking-wide;
}

.table td {
    @apply px-6 py-4 whitespace-nowrap text-sm text-gray-900;
}

/* Alert Styles */
.alert {
    @apply p-4 rounded-lg border-l-4;
}

.alert-success {
    @apply bg-green-50 border-green-500 text-green-700;
}

.alert-error {
    @apply bg-red-50 border-red-500 text-red-700;
}

.alert-warning {
    @apply bg-yellow-50 border-yellow-500 text-yellow-700;
}

.alert-info {
    @apply bg-blue-50 border-blue-500 text-blue-700;
}

/* Loading Spinner */
.spinner {
    @apply inline-block animate-spin rounded-full border-2 border-solid border-current border-r-transparent;
}

/* Logo Styles - Đảm bảo background trong suốt */
img[src*="jivo_logo.png"],
img[src*="jivo_fav.png"] {
    background: transparent !important;
    background-color: transparent !important;
    mix-blend-mode: normal;
}

/* Utilities */
.text-truncate {
    @apply truncate;
}

.shadow-hover {
    @apply transition-shadow duration-200 hover:shadow-lg;
}

/* Mobile Safe Area Support - Tránh bị che bởi notch/system bar */
/* Chỉ áp dụng trên mobile (max-width: 1023px) */
@media (max-width: 1023px) {
    .top-nav-mobile-safe {
        padding-top: max(0px, env(safe-area-inset-top, 0px));
    }
    
    /* Điều chỉnh spacing cho mobile */
    .top-nav-mobile-safe > div {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
    
    /* Đảm bảo các phần tử trong header không bị tràn */
    .top-nav-mobile-safe .flex.items-center {
        gap: 0.25rem;
    }
}

/* Hỗ trợ tốt hơn cho các trình duyệt hiện đại với safe-area-inset */
@supports (padding: max(0px)) {
    @media (max-width: 1023px) {
        .top-nav-mobile-safe {
            padding-top: max(0px, env(safe-area-inset-top));
        }
    }
}

/* Responsive adjustments cho header trên các kích thước màn hình khác nhau */
@media (max-width: 640px) {
    /* Mobile nhỏ */
    .top-nav-mobile-safe .flex.items-center {
        gap: 0.125rem;
    }
}

@media (min-width: 641px) and (max-width: 1023px) {
    /* Tablet */
    .top-nav-mobile-safe .flex.items-center {
        gap: 0.5rem;
    }
}

/* Custom Date Picker Styles */
.custom-date-picker-wrapper {
    position: relative;
}

.custom-date-picker-calendar {
    position: absolute !important;
    z-index: 9999 !important;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.custom-date-picker-calendar.hidden {
    display: none !important;
}

.custom-date-picker-calendar:not(.hidden) {
    display: block !important;
}

/* Calendar Header */
.custom-date-picker-calendar > div:first-child {
    margin-bottom: 0.5rem;
}

.custom-date-picker-calendar > div:first-child button {
    border: none;
    background: transparent;
    cursor: pointer;
}

.custom-date-picker-calendar > div:first-child button:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.custom-date-picker-weekdays,
.custom-date-picker-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    width: 100%;
}

.custom-date-picker-empty-cell {
    min-width: 0;
}

.custom-date-picker-day {
    min-width: 0;
    padding: 0 0.125rem;
    margin-bottom: 0.25rem;
}

.custom-date-picker-day > div {
    cursor: pointer;
    text-align: center;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    line-height: 1.25rem;
    border-radius: 9999px;
    transition: background-color 100ms ease, color 100ms ease, border-color 100ms ease;
}

.custom-date-picker-day:not(.disabled):not(.selected):not(.other-month) > div:hover {
    background-color: #bfdbfe;
}

.custom-date-picker-day.selected > div {
    background-color: #2563eb;
    color: #ffffff !important;
    font-weight: 700;
}

.custom-date-picker-day.today:not(.selected) > div {
    color: #2563eb;
    border: 1px solid #2563eb;
    font-weight: 700;
}

.custom-date-picker-day.other-month > div {
    color: #d1d5db;
    cursor: default;
}

.custom-date-picker-day.disabled > div {
    color: #d1d5db !important;
    cursor: not-allowed;
    opacity: 0.5;
}

.custom-date-picker-day:not(.selected):not(.today):not(.other-month):not(.disabled) > div {
    color: #374151;
}

@media (max-width: 640px) {
    .custom-date-picker-calendar {
        position: fixed !important;
        top: 50% !important;
        left: 1rem !important;
        right: 1rem !important;
        width: auto;
        min-width: 0;
        max-width: none;
        max-height: calc(100vh - 2rem);
        margin-top: 0;
        padding: 1rem;
        overflow-y: auto;
        transform: translateY(-50%);
    }

    .custom-date-picker-layout {
        flex-direction: column;
    }

    .custom-date-picker-sidebar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        padding: 0 0 1rem;
        border-right: 0;
        border-bottom: 1px solid #f3f4f6;
    }

    .custom-date-picker-sidebar > div:first-child {
        grid-column: 1 / -1;
        margin-bottom: 0.75rem;
        padding-top: 0;
    }

    .custom-date-picker-sidebar > button {
        margin: 0 0.25rem;
    }
}

/* Respect the operating-system accessibility preference globally. */
@media (prefers-reduced-motion: reduce) {
    html:focus-within {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    .ph-spin,
    .notification-badge {
        animation: none !important;
    }
}

/* --- Ticket Highlight (focused row animation) --- */
@keyframes startupFlashBg {
    0% { background-color: #eff6ff !important; }
    10%, 80% { background-color: #bfdbfe !important; }
    100% { background-color: transparent !important; }
}
@keyframes startupRowOutline {
    0% { outline: 2px solid #93c5fd; outline-offset: -2px; }
    10%, 80% { outline: 2px solid #3b82f6; outline-offset: -2px; }
    100% { outline: 2px solid transparent; outline-offset: -2px; }
}
@keyframes startupRowShadow {
    0% { box-shadow: none; z-index: 0; }
    10%, 80% { box-shadow: 0 15px 30px -5px rgba(59, 130, 246, 0.4), 0 8px 10px -6px rgba(59, 130, 246, 0.3); z-index: 50; }
    100% { box-shadow: none; z-index: 0; }
}
@keyframes startupMobileOutline {
    0% { outline-color: #93c5fd; box-shadow: none; z-index: 0; }
    10%, 80% { outline-color: #3b82f6; box-shadow: 0 15px 30px -5px rgba(59, 130, 246, 0.4); z-index: 50; }
    100% { outline-color: transparent; box-shadow: none; z-index: 0; }
}
@keyframes pulseNativePointer {
    0% { transform: translateY(-50%) scale(1); opacity: 1; }
    50% { transform: translateY(-50%) scale(1.1) translateX(3px); opacity: 0.9; }
    100% { transform: translateY(-50%) scale(1); opacity: 1; }
}
@keyframes mobilePointerPulse {
    0% { opacity: 0.7; width: 5px; }
    50% { opacity: 1; width: 8px; box-shadow: 4px 0 12px rgba(59, 130, 246, 0.4); }
    100% { opacity: 0.7; width: 5px; }
}

tr.ticket-focused-flash {
    animation: startupRowShadow 8s cubic-bezier(0.4, 0, 0.2, 1) forwards, startupRowOutline 8s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
    position: relative;
    scroll-margin-top: calc(50vh - 100px);
}
tr.ticket-focused-flash td {
    animation: startupFlashBg 8s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
    position: relative;
}
tr.ticket-focused-flash td:first-child {
    border-top-left-radius: 6px; border-bottom-left-radius: 6px;
}
tr.ticket-focused-flash td:last-child {
    border-top-right-radius: 6px; border-bottom-right-radius: 6px;
}
div.ticket-focused-flash {
    animation: startupFlashBg 8s cubic-bezier(0.4, 0, 0.2, 1) forwards, startupMobileOutline 8s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
    border: 2px solid transparent;
    position: relative;
    scroll-margin-top: calc(50vh - 100px);
}

tr.ticket-focused-flash td:first-child::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    background-color: #3b82f6;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Crect width='256' height='256' fill='none'/%3E%3Cpolyline points='96 48 176 128 96 208' fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='24'/%3E%3C/svg%3E");
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 9999px;
    z-index: 60;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
    animation: pulseNativePointer 1.5s infinite;
    pointer-events: none;
}
div.ticket-focused-flash::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(to bottom, #3b82f6, #60a5fa);
    z-index: 60;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
    animation: mobilePointerPulse 2s infinite;
}

/* Reserve a stable pointer gutter for catalog return-focus on desktop and mobile. */
tr[data-company-status-item] td:first-child,
tr[data-catalog-item] td:first-child,
tr[data-user-lifecycle] td:first-child {
    padding-left: 3.25rem;
}

div[data-company-status-item],
div[data-catalog-item],
div[data-user-lifecycle] {
    padding-left: 3rem;
}

div.ticket-focused-flash.catalog-return-focus::before {
    left: 0.5rem;
    top: 50%;
    bottom: auto;
    width: 1.5rem;
    height: 1.5rem;
    transform: translateY(-50%);
    border-radius: 9999px;
    background-color: #3b82f6;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpolyline points='96 48 176 128 96 208' fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='24'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 0.75rem;
    box-shadow: 0 2px 8px rgb(59 130 246 / 0.4);
    animation: pulseNativePointer 1.5s infinite;
}

/* Catalog tables frame each cell so sticky action cells and scroll hosts cannot clip the focus ring. */
tr.ticket-focused-flash.catalog-return-focus {
    animation: none !important;
    outline: 0 !important;
    box-shadow: none !important;
}

tr.ticket-focused-flash.catalog-return-focus > td {
    animation: none !important;
    background-color: #eff6ff !important;
    box-shadow: inset 0 2px 0 #3b82f6, inset 0 -2px 0 #3b82f6;
}

tr.ticket-focused-flash.catalog-return-focus > td:first-child {
    box-shadow: inset 2px 0 0 #3b82f6, inset 0 2px 0 #3b82f6, inset 0 -2px 0 #3b82f6;
}

tr.ticket-focused-flash.catalog-return-focus > td:last-child {
    box-shadow: inset -2px 0 0 #3b82f6, inset 0 2px 0 #3b82f6, inset 0 -2px 0 #3b82f6;
}
/* Keep the cursor consistent across controls while the global page loader blocks interaction. */
html.page-loading-active,
html.page-loading-active * {
    cursor: wait !important;
}
/* Copy controls provide immediate, CSP-safe success feedback. */
.copy-success {
    transform: scale(1.1);
    box-shadow: 0 0 0 3px rgb(134 239 172 / 55%);
}

/* Highlight an encrypt/decrypt result without shifting the page layout. */
.crypto-result-updated {
    animation: crypto-result-updated 420ms ease-out;
}

@keyframes crypto-result-updated {
    0% {
        opacity: 0.55;
        transform: translateY(4px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .crypto-result-updated {
        animation: none;
    }
}
@keyframes dorFocusHighlight {
    0%, 100% {
        box-shadow: 0 0 0 2px rgb(245 158 11 / 0.35);
    }
    50% {
        box-shadow: 0 0 0 5px rgb(245 158 11 / 0.55);
    }
}

.dor-focus-highlight {
    position: relative;
    z-index: 2;
    border-radius: 0.5rem;
    animation: dorFocusHighlight 1s ease-in-out 3;
}

@media (prefers-reduced-motion: reduce) {
    .dor-focus-highlight {
        animation: none;
        box-shadow: 0 0 0 3px rgb(245 158 11 / 0.5);
    }
}
[data-lifecycle-icon-loading] {
    display: none !important;
}
