/* loading spinner */
/* Overlay seluruh layar */
#backMenu {
    cursor: pointer;
}

#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    /* transparan gelap */
    display: none;
    /* Awalnya disembunyikan */
    justify-content: center;
    align-items: center;
    z-index: 9999;
    pointer-events: auto;
}

.loading-overlay {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Icon Font Awesome */
.loading-icon {
    color: #ffffff;
    margin-bottom: 20px;
    animation: pulse 1.2s infinite;
}

/* Spinner */
.spinner {
    width: 60px;
    height: 60px;
    border: 8px solid #f3f3f3;
    border-top: 8px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

/* Blok interaksi saat loading */
body.loading-active {
    overflow: hidden;
    pointer-events: none;
}

#bodyTable.tbody-error {
    background-color: #f8d7da !important;
    /* merah lembut */
    border: 2px solid #dc3545;
    box-shadow: inset 0 0 5px #dc3545;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.garis-pembatas {
    height: 0.5px;
    background-color: rgba(0, 0, 0, 0.05);
    /* Sangat halus */
    margin: 16px 0;
    width: 100%;
}

.tx-12 {
    font-size: 12px !important;
}

.fs9 {
    font-size: 9px !important;
}

.fs10 {
    font-size: 10px !important;
}

.fs11 {
    font-size: 11px !important;
}

.readonly-style {
    background-color: #e9ecef !important;
    color: #6c757d !important;
    cursor: not-allowed !important;
}

.cursor-pointer:hover {
    cursor: pointer;
    color: #0d6efd;
    /* Warna biru seperti link */
    text-decoration: none;
}

.mxh-200 {
    max-height: 200px;
}

.mxh-300 {
    max-height: 300px;
}

.mxh-400 {
    max-height: 400px;
}

.mxh-600 {
    max-height: 600px;
}

.mxh-800 {
    max-height: 800px;
}

.scrollable-div {
    /* Atur tinggi maksimum */
    overflow-y: auto;
    /* Aktifkan scroll vertikal */
    overflow-y: auto;
    /* aktif scroll ke bawah */
    overflow-x: hidden;
    /* nonaktif scroll ke samping */
    padding: 10px;
    border: 1px solid #ccc;
}

.tr-error {
    background-color: #f8d7da !important;
    /* merah muda seperti alert-danger */
    transition: background-color 0.3s;
}

td.highlight-column-table-warning {
    border: 1px solid #ffc107;
    background-color: #fffbe6;
}

td.highlight-column-table-danger {
    border: 1px solid #ef052c;
    background-color: #fffbe6;
}

input.highlight-input-warning {
    border: 1px solid #ffc107;
    /* kuning tipis */
    background-color: #f6f6f6;
    /* opsional: latar belakang putih gading */
    box-shadow: 0 0 4px #ffe082;
    /* efek glow halus */
}

select.highlight-input-warning {
    border: 1px solid #ffc107 !important;
    /* kuning tipis */
    background-color: #f6f6f6 !important;
    /* opsional: latar belakang putih gading */
    box-shadow: 0 0 4px #ffe082 !important;
    /* efek glow halus */
}

.select2-container--default .select2-selection--single.highlight-input-warning {
    border: 1px solid #ffc107 !important;
    background-color: #fef9e7 !important;
    box-shadow: 0 0 4px #ffe082 !important;
}

select.highlight-input-danger {
    border: 1px solid #ef052c;
    /* kuning tipis */
    background-color: #f6f6f6;
    /* opsional: latar belakang putih gading */
    box-shadow: 0 0 4px rgb(243, 108, 108);
    /* efek glow halus */
}

input.highlight-input-danger {
    border: 1px solid #ef052c;
    /* kuning tipis */
    background-color: #f6f6f6;
    /* opsional: latar belakang putih gading */
    box-shadow: 0 0 4px rgb(243, 108, 108);
    /* efek glow halus */
}

.copy {
    /* button */
    --button-bg: #f19029;
    --button-hover-bg: #464646;
    --button-text-color: #fcfcfc;
    --button-hover-text-color: #8bb9fe;
    --button-border-radius: 10px;
    --button-diameter: 36px;
    --button-outline-width: 1px;
    --button-outline-color: rgb(141, 141, 141);
    /* tooltip */
    --tooltip-bg: #f4f3f3;
    --toolptip-border-radius: 4px;
    --tooltip-font-family: Menlo, Roboto Mono, monospace;
    /* 👆 this field should not be empty */
    --tooltip-font-size: 12px;
    /* 👆 this field should not be empty */
    --tootip-text-color: rgb(50, 50, 50);
    --tooltip-padding-x: 7px;
    --tooltip-padding-y: 7px;
    --tooltip-offset: 8px;
    /* --tooltip-transition-duration: 0.3s; */
    /* 👆 if you need a transition,
                  just remove the comment,
                  but I didn't like the transition :| */
}

.copy {
    box-sizing: border-box;
    width: var(--button-diameter);
    height: var(--button-diameter);
    border-radius: var(--button-border-radius);
    background-color: var(--button-bg);
    color: var(--button-text-color);
    border: none;
    cursor: pointer;
    position: relative;
    outline: none;
}

.tooltip {
    position: absolute;
    opacity: 0;
    visibility: 0;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font: var(--tooltip-font-size) var(--tooltip-font-family);
    color: var(--tootip-text-color);
    background: var(--tooltip-bg);
    padding: var(--tooltip-padding-y) var(--tooltip-padding-x);
    border-radius: var(--toolptip-border-radius);
    pointer-events: none;
    transition: all var(--tooltip-transition-duration) cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.tooltip::before {
    content: attr(data-text-initial);
}

.tooltip::after {
    content: "";
    position: absolute;
    bottom: calc(var(--tooltip-padding-y) / 2 * -1);
    width: var(--tooltip-padding-y);
    height: var(--tooltip-padding-y);
    background: inherit;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    z-index: -999;
    pointer-events: none;
}

.copy svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.checkmark {
    display: none;
}

/* actions */
.copy:hover .tooltip,
.copy:focus:not(:focus-visible) .tooltip {
    opacity: 1;
    visibility: visible;
    top: calc((100% + var(--tooltip-offset)) * -1);
}

.copy:focus:not(:focus-visible) .tooltip::before {
    content: attr(data-text-end);
}

.copy:focus:not(:focus-visible) .clipboard {
    display: none;
}

.copy:focus:not(:focus-visible) .checkmark {
    display: block;
}

.copy:hover,
.copy:focus {
    background-color: var(--button-hover-bg);
}

.copy:active {
    outline: var(--button-outline-width) solid var(--button-outline-color);
}

.copy:hover svg {
    color: var(--button-hover-text-color);
}

.kanban-item {
    cursor: pointer;
    transition: background 0.2s ease;
}

.kanban-item:hover {
    background: #f8f9fa;
    /* kasih efek hover ringan */
}

.kanban-item {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Ghost element saat drag */
.bg-light.ghost {
    opacity: 0.5;
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Placeholder fade in */
.empty-placeholder {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.empty-placeholder.show {
    opacity: 1;
}

/* Timeline container */
.lead-history-container {
    padding: 10px 0;
    max-height: 60vh;
    overflow-y: auto;
}

/* Timeline vertical line */
.timeline {
    position: relative;
    margin-left: 20px;
    /* buat space untuk bullets */
    padding-left: 20px;
}

/* vertical line */
.timeline::before {
    content: "";
    position: absolute;
    left: 8px;
    /* posisi garis terhadap container */
    top: 0;
    width: 2px;
    height: 100%;
    background: #e9ecef;
    border-radius: 2px;
}

/* each event */
.timeline-item {
    position: relative;
    padding: 12px 16px 12px 36px;
    margin-bottom: 8px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.02);
}

/* bullet */
.timeline-item::before {
    content: "";
    position: absolute;
    left: -16px;
    /* aligns to the vertical line */
    top: 18px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #0d6efd;
    /* bootstrap primary */
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.08);
}

/* alternate color for special statuses (won/lost) */
.timeline-item.won::before {
    background: #198754;
    box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.08);
}

.timeline-item.lost::before {
    background: #dc3545;
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.08);
}

.timeline-item.closed::before {
    background: #6c757d;
    box-shadow: 0 0 0 4px rgba(108, 117, 125, 0.08);
}

/* header row inside item */
.timeline-item .row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

/* small status badge */
.timeline-item .status-badge {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    color: #fff;
    display: inline-block;
}

/* colors for badges */
.status-badge.new {
    background: #0d6efd;
}

.status-badge.followup {
    background: #0d6efd;
}

.status-badge.won {
    background: #198754;
}

.status-badge.lost {
    background: #dc3545;
}

.status-badge.closed {
    background: #6c757d;
}

/* meta text */
.timeline-item .meta {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 8px;
}

/* note/content */
.timeline-item .note {
    font-size: 14px;
    color: #212529;
    white-space: pre-wrap;
}

/* responsive tweaks */
@media (max-width: 576px) {
    .timeline {
        margin-left: 8px;
        padding-left: 18px;
    }

    .timeline-item {
        padding-left: 38px;
    }

    .timeline-item::before {
        left: -12px;
        top: 16px;
    }
}