/* ─────────────────────────────────────────────
   DSRM – app.css
   Custom overrides on top of Bootstrap 5
───────────────────────────────────────────── */

/* ── Navbar ── */
.navbar-brand img {
    max-height: 36px;
    object-fit: contain;
}
.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bs-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}
.notification-bell .badge {
    font-size: .55rem;
    top: 2px !important;
    right: 2px !important;
}

/* ── Flash messages ── */
.flash-container {
    position: fixed;
    top: 70px;
    right: 1rem;
    z-index: 1055;
    min-width: 300px;
    max-width: 420px;
}

/* ── Status badge helpers ── */
.status-badge {
    font-size: 0.72rem;
    padding: .25em .6em;
    border-radius: .25rem;
    white-space: nowrap;
}

/* ── Urgent row ── */
tr.urgent-row td:first-child {
    border-left: 3px solid var(--bs-danger);
}
.urgent-indicator {
    color: var(--bs-danger);
}

/* ── Referral show ── */
.status-timeline .timeline-item {
    position: relative;
    padding-left: 1.4rem;
    margin-bottom: 0.75rem;
}
.status-timeline .timeline-item::before {
    content: '';
    position: absolute;
    left: 0.45rem;
    top: 1.1rem;
    bottom: -0.7rem;
    border-left: 2px solid #dee2e6;
}
.status-timeline .timeline-item:last-child::before { display: none; }
.status-timeline .timeline-dot {
    position: absolute;
    left: 0;
    top: 0.3rem;
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 50%;
    background: var(--bs-primary);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--bs-primary);
}
.note-card { background: #fffbe6; border-left: 3px solid #ffc107; }
.note-card.pinned { background: #fff3cd; border-left-color: #fd7e14; }

/* ── Forms list ── */
.form-page {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: .5rem;
    margin-bottom: 1rem;
    overflow: hidden;
}
.form-page-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: .6rem 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.form-page.drag-over {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(13,110,253,.15);
}
.fields-container {
    padding: .75rem 1rem;
    min-height: 80px;
}
.fields-container.drag-over { background: #e8f0fe; }
.field-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: .375rem;
    padding: .55rem .75rem;
    margin-bottom: .5rem;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.field-card:hover,
.field-card.selected {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 2px rgba(13,110,253,.2);
}
.field-card .drag-handle {
    cursor: grab;
    color: #adb5bd;
}
.field-card .drag-handle:active { cursor: grabbing; }
.drop-zone {
    border: 2px dashed #ced4da;
    border-radius: .375rem;
    padding: 1.5rem;
    text-align: center;
    color: #6c757d;
    font-size: .875rem;
}
.palette-item {
    cursor: grab;
    user-select: none;
}
.palette-item:active { cursor: grabbing; }

/* ── Form builder props panel ── */
#fieldPropsPanel label {
    font-size: .75rem;
    font-weight: 600;
    margin-bottom: .2rem;
    color: #495057;
    display: block;
}

/* ── Reports ── */
.chart-container {
    position: relative;
    height: 280px;
}
.filter-bar {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: .375rem;
    padding: .75rem 1rem;
    margin-bottom: 1rem;
}

/* ── Misc ── */
.btn-xs {
    padding: .1rem .3rem;
    font-size: .75rem;
}
.font-monospace { font-family: var(--bs-font-monospace); }
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cursor-pointer { cursor: pointer; }
.page-header {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: .75rem;
    margin-bottom: 1.25rem;
}

/* Hide scrollbar on tab nav wrapper (Chrome/Safari) */
.tab-nav-scroll::-webkit-scrollbar { display: none; }
