/* Nexra admin — Toast + Inline Alert (Ticker) */

.nexra-toast-host {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100020;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: min(420px, calc(100vw - 2rem));
    pointer-events: none;
}

.nexra-toast {
    pointer-events: auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.65rem 0.75rem;
    align-items: center;
    padding: 0.85rem 0.9rem;
    border-radius: 12px;
    border: 1px solid transparent;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.nexra-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.nexra-toast.is-leaving {
    opacity: 0;
    transform: translateY(-6px);
}

.nexra-toast__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    flex-shrink: 0;
}

.nexra-toast__body {
    min-width: 0;
}

.nexra-toast__title {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.35;
    color: #0f172a;
}

.nexra-toast__desc {
    margin: 0.2rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: #475569;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nexra-toast__close {
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    width: 1.5rem;
    height: 1.5rem;
}

.nexra-toast__close:hover {
    color: #64748b;
}

.nexra-toast--success {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.nexra-toast--success .nexra-toast__icon {
    background: #dcfce7;
    color: #15803d;
}

.nexra-toast--warning {
    border-color: #fde68a;
    background: #fffbeb;
}

.nexra-toast--warning .nexra-toast__icon {
    background: #fef3c7;
    color: #b45309;
}

.nexra-toast--info {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.nexra-toast--info .nexra-toast__icon {
    background: #dbeafe;
    color: #1d4ed8;
}

.nexra-toast--error {
    border-color: #fecaca;
    background: #fef2f2;
}

.nexra-toast--error .nexra-toast__icon {
    background: #fee2e2;
    color: #dc2626;
}

/* Inline alert / ticker */
.nexra-ticker {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.75rem 0.85rem;
    align-items: start;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    border: 1px solid transparent;
    margin: 0 0 1rem;
}

.nexra-ticker__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 999px;
    flex-shrink: 0;
}

.nexra-ticker__content {
    min-width: 0;
}

.nexra-ticker__title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.35;
    color: #0f172a;
}

.nexra-ticker__desc {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
    line-height: 1.45;
    color: #475569;
}

.nexra-ticker__details,
.nexra-ticker__details-wrap .nexra-ticker__details {
    list-style: none;
    margin: 0.65rem 0 0;
    padding: 0;
}

.nexra-ticker__details li {
    font-size: 0.8125rem;
    line-height: 1.45;
    color: #334155;
}

.nexra-ticker__details li + li,
.nexra-ticker__details-row + .nexra-ticker__details-row {
    margin-top: 0.25rem;
}

.nexra-ticker__details-row {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
}

.nexra-ticker__details-label {
    flex: 0 0 auto;
    font-weight: 500;
}

.nexra-ticker__details-dots {
    flex: 1 1 auto;
    min-width: 1rem;
    border-bottom: 1px dotted #cbd5e1;
    transform: translateY(-0.15rem);
}

.nexra-ticker__details-count {
    flex: 0 0 auto;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.nexra-ticker__details-toggle {
    margin-top: 0.55rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-primary);
    cursor: pointer;
}

.nexra-ticker__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.65rem;
}

.nexra-ticker__dismiss {
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 1.35rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

.nexra-ticker__dismiss:hover {
    color: #64748b;
}

.nexra-ticker--success {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.nexra-ticker--success .nexra-ticker__icon {
    background: #dcfce7;
    color: #15803d;
}

.nexra-ticker--warning {
    background: #fffbeb;
    border-color: #fde68a;
}

.nexra-ticker--warning .nexra-ticker__icon {
    background: #fef3c7;
    color: #b45309;
}

.nexra-ticker--info {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.nexra-ticker--info .nexra-ticker__icon {
    background: #dbeafe;
    color: #1d4ed8;
}

.nexra-ticker--error {
    background: #fef2f2;
    border-color: #fecaca;
}

.nexra-ticker--error .nexra-ticker__icon {
    background: #fee2e2;
    color: #dc2626;
}

.nexra-ticker--price-review .nexra-ticker__details li {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
}

.nexra-ticker-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

/* Slot alert kontekstual (di atas stepper / tab) */
.nexra-page-alerts {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.nexra-page-alerts > .nexra-ticker:last-child,
.nexra-page-alerts > .nexra-ticker:only-child {
    margin-bottom: 0;
}

/* Follow-up admin — WO detail, survey jadwal lewat, … */
.nexra-ticker--followup.nexra-ticker--warning .nexra-ticker__title {
    color: #92400e;
}

.nexra-ticker--followup .nexra-ticker__desc {
    margin-top: 0.2rem;
    color: #78716c;
    font-size: 0.8125rem;
}

.nexra-ticker__details--links {
    list-style: disc;
    margin: 0.4rem 0 0;
    padding: 0 0 0 1.15rem;
}

.nexra-ticker__details--links li {
    margin: 0 0 0.2rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #92400e;
}

.nexra-ticker__followup-link {
    color: #1d4ed8;
    font-weight: 600;
    text-decoration: none;
}

.nexra-ticker__followup-link:hover {
    color: #1e40af;
    text-decoration: underline;
}

.nexra-ticker--followup-clear {
    padding: 0.65rem 1rem;
}

.nexra-ticker--followup-clear .nexra-ticker__title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #166534;
}

.nexra-ticker--followup-clear .nexra-ticker__icon {
    width: 1.65rem;
    height: 1.65rem;
}

/* Legacy .alert maps to ticker visuals */
.alert {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    line-height: 1.45;
    border: 1px solid transparent;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.alert-ok,
.alert-success {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.app-flash {
    display: none;
}

@media (max-width: 640px) {
    .nexra-toast-host {
        top: auto;
        bottom: 1rem;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: calc(100vw - 1.5rem);
    }
}
