/* CRM additions on top of HOMER (blue skin "two"). Uses HOMER's --ins-* variables so dark mode works. */

/* HOMER 3.x skin "two" sets --ins-primary to blue but leaves link colours, the
   topbar hover colour and FullCalendar's "today" tint on the default green.
   Remove this block if a later HOMER release fixes it. */
html[data-skin="two"] {
    --ins-link-color: #3498db;
    --ins-link-color-rgb: 52, 152, 219;
    --ins-link-hover-color: #2a7cb0;
    --ins-link-hover-color-rgb: 42, 124, 176;
    --ins-focus-ring-color: rgba(52, 152, 219, .25);
}
html[data-skin="two"][data-topbar-color="light"],
html[data-skin="two"][data-topbar-color="gray"] { --ins-topbar-item-hover-color: #3498db; }
html[data-skin="two"][data-bs-theme="dark"] {
    --ins-link-color: #5dade2;
    --ins-link-color-rgb: 93, 173, 226;
    --ins-link-hover-color: #85c1e9;
    --ins-link-hover-color-rgb: 133, 193, 233;
    --ins-primary-bg-subtle: rgba(52, 152, 219, .2);
}
html[data-skin="two"] .fc .fc-daygrid-day.fc-day-today,
html[data-skin="two"] .fc .fc-timegrid-col.fc-day-today { background-color: rgba(52, 152, 219, .08); }

/* Logo image sizes */
.crm-logo-img.crm-logo-sm { height: 26px; }
.crm-logo-img.crm-logo-md { height: 32px; }
.crm-logo-img.crm-logo-lg { height: 44px; }

/* Call workspace: queue fills the viewport and scrolls on its own */
.crm-queue-list { max-height: calc(100vh - 260px); min-height: 240px; }
.crm-queue .list-group-item.active .text-muted { color: inherit !important; }
@media (max-width: 991.98px) { .crm-queue-list { max-height: 320px; } }

/* Keep the call log / import summary visible while the left column scrolls */
@media (min-width: 1400px) {
    .crm-sticky { position: sticky; top: calc(var(--ins-topbar-height) + 1.5rem); }
}

/* Script tab: readable line length and size for reading aloud */
.crm-script { font-size: var(--ins-font-size-md); line-height: 1.7; max-width: 70ch; }
.crm-script p:last-child { margin-bottom: 0; }

/* Disposition buttons wrap as a tight grid */
.crm-dispositions { display: flex; flex-wrap: wrap; gap: .375rem; }
.crm-dispositions .btn { flex: 1 1 auto; }

/* Import wizard: completed steps, upload box, ignored columns */
.crm-steps .nav-link.crm-step-done { color: var(--ins-body-color); }
.crm-steps .nav-link.disabled { opacity: .55; }
.crm-dropbox {
    border: 2px dashed var(--ins-border-color);
    border-radius: var(--ins-border-radius-lg);
    background: var(--ins-light-bg-subtle, var(--ins-tertiary-bg));
    cursor: pointer;
}
.crm-dropbox:hover { border-color: var(--ins-primary); }
.crm-file-input { max-width: 360px; }
.crm-row-muted td { opacity: .6; }

/* Calendar event colours (match HOMER soft badges) */
.crm-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; vertical-align: middle; }
.crm-dot.crm-ev-callback, .fc .crm-ev-callback { background: var(--ins-warning); border-color: var(--ins-warning); }
.crm-dot.crm-ev-meeting, .fc .crm-ev-meeting { background: var(--ins-primary); border-color: var(--ins-primary); }
.crm-dot.crm-ev-handoff, .fc .crm-ev-handoff { background: var(--ins-success); border-color: var(--ins-success); }
.crm-dot.crm-ev-overdue, .fc .crm-ev-overdue { background: var(--ins-danger); border-color: var(--ins-danger); }
.fc .crm-ev-callback .fc-event-main, .fc .crm-ev-callback .fc-event-title { color: #212529; }

/* Public intake form */
.crm-public { background: var(--ins-tertiary-bg); }
.crm-public .card { box-shadow: none; }
.crm-required > .form-label .text-danger { font-weight: 600; }

/* Neutral ("dark") soft badges are unreadable on HOMER's dark background */
html[data-bs-theme="dark"] .badge-soft-dark { --ins-badge-color: #c3cad3; color: #c3cad3; background-color: rgba(195, 202, 211, .14); }

/* FullCalendar: HOMER styles its toolbar with the purple "secondary" (some rules !important); use the blue skin */
.fc-toolbar-chunk .fc-button-group .fc-button { color: var(--ins-primary); background-color: var(--ins-primary-bg-subtle); }
.fc-toolbar-chunk .fc-button-group .fc-button:hover,
.fc-toolbar-chunk .fc-button-group .fc-button.active { color: #fff; background-color: var(--ins-primary); }
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active { background-color: var(--ins-primary) !important; border-color: var(--ins-primary) !important; }
.fc-toolbar-chunk .fc-today-button { background-color: var(--ins-primary) !important; border-color: var(--ins-primary) !important; }
.fc-toolbar-chunk .fc-today-button:disabled { opacity: .5; }
.fc .fc-timegrid-event .fc-event-main { padding: 1px 4px; font-size: var(--ins-font-size-xs); line-height: 1.3; }
/* Taller slots so 15/30-minute callbacks show their title */
.fc .fc-timegrid-slot { height: 2rem; }

/* Mobile topbar brand (HOMER hides .logo-topbar below lg) */
.crm-topbar-brand-sm .avatar-title { font-size: 11px; }
.fc .fc-timegrid-event-harness > .fc-timegrid-event { min-height: 28px; }
