/* ═══════════════════════════════════════════════════════ */
/*  CASEBOARD V5 — Real Tailwind-compatible styles          */
/* ═══════════════════════════════════════════════════════ */

#view-caseboard { display: none; flex-direction: column; height: 100%; overflow: hidden; }
#view-caseboard.active { display: flex; }

/* ─── Sidebar Type Rows ─── */
.cb2-type-row {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 7px;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.12s;
    list-style: none;
}
.cb2-type-row:hover { background: rgba(255,255,255,0.05); }
.cb2-type-dot { width: 7px; height: 7px; border-radius: 2px; flex-shrink: 0; }

/* ─── Connection Color Rows ─── */
.cb2-link-color-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 7px;
    border-radius: 7px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.12s;
}
.cb2-link-color-row:hover { background: rgba(255,255,255,0.05); }
.cb2-link-color-row.active {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
}
.cb2-link-swatch { width: 28px; height: 3px; border-radius: 2px; flex-shrink: 0; }

/* ─── Line Style Buttons ─── */
.cb2-line-style-btn {
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.72rem;
    transition: all 0.12s;
}
.cb2-line-style-btn:hover { background: rgba(255,255,255,0.05); color: #e5e7eb; }
.cb2-line-style-btn.active { background: #2563eb; color: #fff; }

/* ─── Active toolbar buttons ─── */
#cb-btn-connect.cb-active,
#cb-btn-freeline.cb-active {
    background: rgba(37,99,235,0.15) !important;
    border-color: rgba(59,130,246,0.5) !important;
    color: #60a5fa !important;
}

/* ─── Canvas ─── */
.cb-workspace {
    background: #080a0c;
    background-image: radial-gradient(circle, rgba(59,130,246,0.06) 1px, transparent 1px);
    background-size: 36px 36px;
    cursor: grab;
}
.cb-workspace:active { cursor: grabbing; }
.cb-canvas {
    position: absolute; top: 0; left: 0;
    width: 5000px; height: 5000px;
    transform-origin: 0 0;
    will-change: transform;
}
.cb-canvas::before {
    content: '';
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 500px; height: 500px;
    background: url('../assets/l-lspd.png') no-repeat center / contain;
    opacity: 0.03;
    pointer-events: none;
}

/* ══════════════════════════════════════════════════ */
/*  PIN CARDS                                         */
/* ══════════════════════════════════════════════════ */
.cb-pin {
    position: absolute;
    width: 230px;
    background: #111827;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    cursor: grab;
    user-select: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    transition: box-shadow 0.15s, border-color 0.15s;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10;
}
.cb-pin:hover {
    border-color: rgba(255,255,255,0.14);
    box-shadow: 0 8px 32px rgba(0,0,0,0.65);
}
.cb-pin.selected {
    border-color: rgba(59,130,246,0.55);
    box-shadow: 0 0 0 2px rgba(59,130,246,0.2), 0 8px 32px rgba(0,0,0,0.65);
}
.cb-pin.pin-small  { width: 180px; }
.cb-pin.pin-large  { width: 300px; }
.cb-pin.priority-urgent { animation: cbUrgentPulse 2.5s ease-in-out infinite; }
@keyframes cbUrgentPulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.35), 0 4px 20px rgba(0,0,0,0.5); }
    50%      { box-shadow: 0 0 0 7px rgba(239,68,68,0), 0 4px 20px rgba(0,0,0,0.5); }
}

/* ─── Action Bar ─── */
.cb-pin-action-bar {
    position: absolute; top: -36px; right: 0;
    display: flex; gap: 4px;
    opacity: 0; transition: opacity 0.15s, top 0.15s;
    z-index: 20;
}
.cb-pin:hover .cb-pin-action-bar { opacity: 1; top: -34px; }
.cb-pin-action {
    width: 28px; height: 28px;
    border: 1px solid rgba(255,255,255,0.08);
    background: #1f2937;
    color: #9ca3af;
    border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 0.68rem;
    transition: all 0.12s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.cb-pin-action:hover { background: rgba(255,255,255,0.1); color: #fff; }
.cb-pin-action.delete:hover { background: rgba(239,68,68,0.25); color: #ef4444; border-color: rgba(239,68,68,0.4); }

/* ─── Pin Header ─── */
.cb-pin-header {
    padding: 10px 12px 8px 18px;
    position: relative;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.cb-pin-sidebar {
    position: absolute; left: 6px; top: 8px; bottom: 8px;
    width: 3px; border-radius: 2px;
}
.cb-pin-title {
    font-size: 0.88rem; font-weight: 700;
    color: #f1f5f9;
    line-height: 1.2; margin-bottom: 3px;
    word-break: break-word;
}
.cb-pin-type-name {
    font-size: 0.62rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    display: flex; align-items: center; gap: 5px;
}

/* ─── Pin Body ─── */
.cb-pin-body { padding: 8px 12px; flex: 1; }
.cb-pin-image {
    width: 100%; height: 100px;
    object-fit: cover; border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid rgba(255,255,255,0.06);
}
.cb-pin-details-text {
    font-size: 0.72rem; line-height: 1.5;
    color: #9ca3af;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    white-space: pre-wrap;
}
.cb-pin-meta { display: flex; flex-direction: column; gap: 3px; margin-bottom: 6px; }
.cb-pin-meta .meta-row { display: flex; font-size: 0.68rem; align-items: flex-start; gap: 4px; }
.cb-pin-meta .meta-row .label { color: rgba(255,255,255,0.3); width: 64px; flex-shrink: 0; font-weight: 600; }
.cb-pin-meta .meta-row .val { color: #e2e8f0; font-weight: 600; flex: 1; word-break: break-word; }

/* ─── Pin Footer ─── */
.cb-pin-footer {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.65rem; color: rgba(255,255,255,0.25);
    font-weight: 600;
    border-top: 1px solid rgba(255,255,255,0.04);
    padding: 7px 12px;
}
.cb-pin-footer .fp-item { display: flex; align-items: center; gap: 4px; }
.cb-pin-priority-badge {
    font-size: 0.58rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.06em;
    padding: 1px 5px; border-radius: 4px; margin-left: auto;
}

/* ══════════════════════════════════════════════════ */
/*  CONNECTIONS                                       */
/* ══════════════════════════════════════════════════ */
.cb-line-label {
    position: absolute; transform: translate(-50%, -50%);
    background: #1f2937;
    color: #e2e8f0;
    padding: 2px 8px; border-radius: 6px;
    font-size: 0.62rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em;
    pointer-events: auto; cursor: pointer;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    transition: all 0.12s; z-index: 1001;
}
.cb-line-label:hover { background: #2563eb; border-color: #3b82f6; color: #fff; }

/* ══════════════════════════════════════════════════ */
/*  MODALS                                            */
/* ══════════════════════════════════════════════════ */
.cb2-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: none; align-items: center; justify-content: center;
    padding: 1rem;
}
.cb2-modal-overlay.active {
    display: flex;
    animation: cbFadeIn 0.15s ease;
}
@keyframes cbFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ─── Input shorthand ─── */
.cb2-input {
    width: 100%;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 10px 16px;
    color: #f1f5f9;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none;
}
.cb2-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
.cb2-input::placeholder { color: #4b5563; }
select.cb2-input option { background: #1f2937; color: #f1f5f9; }

/* ─── Dropdown menus ─── */
.cb2-dropdown { display: none; }
.cb2-dropdown.active { display: block; animation: cbDropPop 0.12s ease; }
@keyframes cbDropPop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.cb2-dropdown-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border-radius: 8px;
    font-size: 0.82rem; font-weight: 500;
    color: #d1d5db;
    cursor: pointer; transition: all 0.1s;
}
.cb2-dropdown-item:hover { background: rgba(59,130,246,0.15); color: #93c5fd; }

/* ══════════════════════════════════════════════════ */
/*  CONTEXT MENUS                                     */
/* ══════════════════════════════════════════════════ */
.cb2-ctx-menu {
    position: fixed; z-index: 10000;
    width: 200px;
    background: #1f2937;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; padding: 6px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
    display: none;
}
.cb2-ctx-item {
    display: flex; align-items: center; gap: 9px;
    padding: 7px 9px; font-size: 0.8rem; font-weight: 500;
    color: #d1d5db;
    cursor: pointer; border-radius: 8px;
    transition: all 0.1s;
}
.cb2-ctx-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.cb2-ctx-danger { color: #f87171 !important; }
.cb2-ctx-danger:hover { background: rgba(239,68,68,0.12) !important; }
.cb2-ctx-sep { height: 1px; background: rgba(255,255,255,0.06); margin: 5px 0; }

/* ══════════════════════════════════════════════════ */
/*  VEHICLE AUTOCOMPLETE                              */
/* ══════════════════════════════════════════════════ */
.cb-autocomplete-suggestions {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 12px; z-index: 10001;
    max-height: 220px; overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    display: none; padding: 6px;
    scrollbar-width: thin;
}
.cb-autocomplete-suggestions.active { display: block; }
.cb-suggestion-item { padding: 8px 10px; border-radius: 8px; cursor: pointer; transition: background 0.1s; }
.cb-suggestion-item:hover, .cb-suggestion-item.selected { background: rgba(37,99,235,0.2); }
.cb-suggestion-name { font-size: 0.8rem; font-weight: 600; color: #f1f5f9; }
.cb-suggestion-model { font-size: 0.7rem; color: #6b7280; font-family: monospace; }
mark.cb-highlight { background: rgba(234,179,8,0.2); color: #fcd34d; border-radius: 2px; padding: 0 1px; }