/* Today, time reports and personal pages: the dashboard, My day, the timetable and month report, profile, MCP keys,
   Telavox and the sign-in page. Tabler first; only what Tabler has no component for lives here. */

/* ---------------------------------------------------------------- page hero (a page header with a greeting) */
.today-hero { margin-top: .25rem; }
.today-greeting { font-size: 1.6rem; font-weight: 600; letter-spacing: -.015em; }

/* ---------------------------------------------------------------- stat cards: icon avatar, one number, a label */
.today-stat .card-body { min-height: 5.25rem; }
.today-stat-value { font-size: 1.5rem; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.today-stat-of { font-size: .85rem; font-weight: 400; color: var(--tblr-secondary); }
.today-stat-label { font-weight: 500; }
.today-stat-attention { box-shadow: inset 3px 0 0 var(--tblr-yellow); }
a.today-stat { color: inherit; text-decoration: none; }

/* A progress ring: --p is the percentage (0-100); the colour follows the top bar's bands. */
.today-ring {
  --p: 0; --c: var(--tblr-primary); flex: 0 0 auto; position: relative; display: grid; place-items: center;
  width: 3.4rem; height: 3.4rem; border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--tblr-border-color) 0);
}
.today-ring::before { content: ""; position: absolute; inset: .3rem; border-radius: 50%; background: var(--tblr-bg-surface); }
.today-ring > span { position: relative; font-size: .75rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.today-ring-red { --c: var(--tblr-red); } .today-ring-yellow { --c: var(--tblr-yellow); }
.today-ring-azure { --c: var(--tblr-azure); } .today-ring-green { --c: var(--tblr-green); }

/* ---------------------------------------------------------------- dashboard: schedule timeline */
.today-timeline { margin-bottom: 0; }
.today-timeline .timeline-event-card { margin-bottom: 0; }
.today-slot-time { font-weight: 600; font-variant-numeric: tabular-nums; }
.today-slot-past .timeline-event-card { opacity: .62; }
.today-slot-now .timeline-event-card { box-shadow: inset 3px 0 0 var(--tblr-primary); }

/* ---------------------------------------------------------------- dashboard: queues and the firestarter board */
.today-queues .list-group-item { font-size: .875rem; }
.today-open { background: var(--tblr-bg-surface-secondary); color: var(--tblr-secondary); }
.today-rank { width: 1.5rem; text-align: center; font-weight: 600; color: var(--tblr-secondary); font-variant-numeric: tabular-nums; }
.today-rank .ti { font-size: 1.15rem; }
.today-rank-1 { color: #f5b301; } .today-rank-2 { color: #9aa5b1; } .today-rank-3 { color: #c97a3d; }
.today-week { gap: .2rem; }
.today-day {
  display: inline-flex; align-items: center; justify-content: center; gap: .1rem; min-width: 2.1rem; height: 1.45rem; padding: 0 .25rem;
  border-radius: var(--tblr-border-radius-pill); font-size: .7rem; font-variant-numeric: tabular-nums;
  color: var(--tblr-secondary); background: var(--tblr-bg-surface-secondary);
}
.today-day-hit { background: rgba(var(--tblr-primary-rgb), .16); color: var(--tblr-primary); font-weight: 600; }
.today-day-today { outline: 1px solid var(--tblr-border-color-dark, var(--tblr-border-color)); }

/* ---------------------------------------------------------------- dashboard and news: posts */
.today-post-img { height: 9rem; overflow: hidden; border-top-left-radius: inherit; border-top-right-radius: inherit; background: var(--tblr-bg-surface-secondary); }
.today-post-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.today-post-img-logo { background: #000; }
.today-post-img-logo img { object-fit: contain; padding: 1.25rem; }
.today-post-title { font-size: .95rem; line-height: 1.3; }
.today-post-teaser { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.today-article-img { max-height: 22rem; width: 100%; object-fit: cover; border-radius: var(--tblr-border-radius); }
.today-article-body img { max-width: 100%; height: auto; }

/* ---------------------------------------------------------------- My day: the calendar */
.today-total { font-weight: 500; font-size: .8rem; padding: .35em .6em; }
.today-calendar {
  --fc-button-bg-color: var(--tblr-bg-surface); --fc-button-border-color: var(--tblr-border-color);
  --fc-button-text-color: var(--tblr-body-color); --fc-button-hover-bg-color: var(--tblr-bg-surface-secondary);
  --fc-button-hover-border-color: var(--tblr-border-color); --fc-button-active-bg-color: rgba(var(--tblr-primary-rgb), .14);
  --fc-button-active-border-color: var(--tblr-primary);
}
.today-calendar .fc-button { font-size: .8125rem; font-weight: 500; padding: .3rem .75rem; text-transform: none; box-shadow: none !important; }
.today-calendar .fc-button-active, .today-calendar .fc-button:not(:disabled).fc-button-active { color: var(--tblr-primary); }
.today-calendar .fc-button:focus-visible { outline: 2px solid var(--tblr-primary); outline-offset: 1px; }
.today-calendar .fc-toolbar.fc-header-toolbar { margin-bottom: .75rem; flex-wrap: wrap; gap: .5rem; }
.today-calendar .fc-toolbar-title { font-size: 1.05rem; font-weight: 600; }
.today-calendar .fc-col-header-cell-cushion { font-weight: 500; }
.today-calendar .fc-event { border-radius: 4px; }

/* "Go to date": a month in a dropdown (myday.js), in the theme's colours. The days in view are tinted, the chosen one
   filled with the accent, today ringed. */
.today-datepick {
  position: absolute; z-index: 1000; padding: .5rem; font-size: .875rem; color: var(--tblr-body-color);
  background: var(--tblr-bg-surface); border-radius: var(--tblr-border-radius); box-shadow: var(--tblr-shadow-dropdown);
}
.today-datepick table { border-collapse: separate; border-spacing: 2px; }
.today-datepick th { padding: .15rem 0; text-align: center; font-size: .7rem; font-weight: 500; color: var(--tblr-secondary); }
.today-datepick td { padding: 0; }
.today-datepick-day {
  display: block; width: 2.1rem; height: 2rem; padding: 0; border: 0; border-radius: var(--tblr-border-radius);
  background: none; color: inherit; font-size: .8125rem; font-variant-numeric: tabular-nums;
}
.today-datepick-day:hover { background: var(--tblr-bg-surface-secondary); }
.today-datepick-day:focus-visible { outline: 2px solid var(--tblr-primary); outline-offset: 1px; }
.today-datepick-day.is-other { color: var(--tblr-secondary); }
.today-datepick-day.is-in-view { background: rgba(var(--tblr-primary-rgb), .14); }
.today-datepick-day.is-today { box-shadow: inset 0 0 0 1px var(--tblr-primary); font-weight: 600; }
.today-datepick [aria-selected=true] .today-datepick-day { background: var(--crm-accent); color: var(--crm-on-accent); font-weight: 600; }

/* The legend: the calendar's own colours (crm.css .fc .event-*) and the note types' chosen colours. */
.today-swatch { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin-inline-end: .35rem; vertical-align: -.1em; }
.today-swatch-registration { background: #0047ab; }
.today-swatch-scheduling { background: #7f00ff; }
.today-swatch-done { background: repeating-linear-gradient(45deg, #6c757d, #6c757d 3px, #868e96 3px, #868e96 6px); }
.today-swatch-private { background: #0047ab; box-shadow: inset 0 0 0 2px #ca0000; }
.today-swatch-task { background: #7f00ff; }
.today-swatch-full { background: var(--tblr-success); }
.today-swatch-over { background: var(--tblr-danger); }

/* ---------------------------------------------------------------- My day: the side panel */
/* Its width (--today-side-width, dragged on the separator) and which panel is hidden (data-myday-hidden on <html>) are
   remembered per browser; see the page's head. One panel at most: the other then has no hide button. */
.today-side-col { position: relative; }
.today-resize { display: none; }
@media (min-width: 1200px) {
  .today-split { flex-wrap: nowrap; }
  .today-split > .today-main { flex: 1 1 0; width: auto; min-width: 0; }
  .today-split > .today-side-col { flex: 0 0 clamp(20rem, var(--today-side-width, 33.333%), 60%); width: auto; min-width: 0; }
  .today-resize {
    display: block; position: absolute; top: 0; bottom: 0; left: -.375rem; width: .75rem; z-index: 2;
    cursor: col-resize; touch-action: none;
  }
  .today-resize::after {
    content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; transform: translateX(-50%);
    border-radius: 3px; background: transparent; transition: background-color .15s;
  }
  .today-resize:hover::after, .today-resize:focus-visible::after, .today-resize.is-dragging::after { background: var(--crm-accent); }
  .today-resize:focus-visible { outline: 0; }
  [data-myday-hidden=calendar] .today-split > .today-side-col { flex: 1 1 0; }
}
.today-resizing, .today-resizing * { cursor: col-resize !important; user-select: none; }
[data-myday-hidden=side] .today-side-col, [data-myday-hidden=calendar] .today-main { display: none; }
[data-myday-hidden] .today-resize, [data-myday-hidden] [data-myday-hide], .today-show { display: none; }
[data-myday-hidden=side] [data-myday-show=side], [data-myday-hidden=calendar] [data-myday-show=calendar] { display: inline-flex; }
.today-side .card-header-tabs .nav-link { white-space: nowrap; }
/* Beside the calendar, the side panel's tabs end at the window's bottom like the calendar does (crm.js
   data-fill-screen), so a short screen gets no page scrollbar on top of the calendar's. */
@media (min-width: 1200px) {
  .today-side-tabs { max-height: var(--crm-fill-screen, none); overflow-y: auto; }
  .today-side-tabs .today-tasks.crm-myday-tasks { max-height: none; overflow: visible; } /* one scroll box, the tabs' */
}
.today-timer { padding: .75rem 1rem; border-bottom: 1px solid var(--tblr-border-color); }
.today-timer:last-child { border-bottom: 0; }
.today-timer-1 { background: rgba(var(--tblr-green-rgb), .07); box-shadow: inset 3px 0 0 var(--tblr-green); }
.today-timer-1 [data-timer-field="minutes"] { font-weight: 600; color: var(--tblr-green); }
.today-timer-2 { opacity: .72; }
.today-timer-minutes { width: 7rem; flex: 0 0 auto; }
.today-timer-minutes .form-control { font-variant-numeric: tabular-nums; }
.today-timer-pickspace { display: inline-block; width: 1rem; }
.today-timer textarea { resize: vertical; min-height: calc(1.5em + .5rem + 2px); }
.today-timer-head { min-width: 0; }
.today-timer-edit > summary { cursor: pointer; }
.today-tasks.crm-myday-tasks { max-height: max(20rem, calc(100vh - 25rem)); }
.min-w-0 { min-width: 0; }

/* ---------------------------------------------------------------- reports: timetable and month report */
/* Chart.js sizes a responsive chart to its container, so the height sits on a wrapper around the canvas. */
.today-chart { position: relative; height: 15rem; }
.today-chart-tall { position: relative; height: 26rem; }
.today-idx { white-space: nowrap; }
.today-bar { display: inline-block; width: 3.5rem; height: .35rem; margin-inline-start: .4rem; border-radius: 1rem; background: var(--tblr-bg-surface-secondary); vertical-align: middle; overflow: hidden; }
.today-bar > span { display: block; height: 100%; border-radius: inherit; }
.today-expand .ti { transition: transform .15s; }
.today-expand:not(.collapsed) .ti { transform: rotate(180deg); }
.today-week-detail { background: var(--tblr-bg-surface-secondary); padding: .25rem 1rem .5rem 2rem; }
.today-week-detail .table { background: transparent; --tblr-table-bg: transparent; }
.today-money-flag { white-space: nowrap; }

/* ---------------------------------------------------------------- settings pages: profile, MCP keys, Telavox */
.today-avatar-xl { font-size: 1.6rem; }
.today-profile-thumb { height: 5.5rem; width: auto; }
.today-setting { cursor: pointer; }
.today-setting .form-switch .form-check-input { margin-top: .15rem; }
.today-code {
  display: block; padding: .5rem .75rem; border-radius: var(--tblr-border-radius); background: var(--tblr-bg-surface-secondary);
  border: 1px solid var(--tblr-border-color); color: var(--tblr-body-color); font-size: .8125rem; white-space: pre-wrap; word-break: break-all;
}
.today-facts li { display: flex; gap: .5rem; align-items: baseline; margin-bottom: .35rem; }
.today-new-key { box-shadow: inset 3px 0 0 var(--tblr-green); }

/* ---------------------------------------------------------------- sign in and access denied (_LayoutBare) */
.today-bare {
  background:
    radial-gradient(60rem 30rem at 50% -10rem, rgba(var(--tblr-primary-rgb), .14), transparent 70%),
    var(--tblr-body-bg);
}
.today-bare-brand { font-size: 1.6rem; }
.today-bare-brand .crm-brand-name { font-size: 1.6rem; }
.today-signin { border-top: 3px solid var(--crm-accent); }
.today-stat-value .badge { font-size: .7rem; vertical-align: middle; }
.today-timer-status { flex: 0 0 auto; width: 1.6rem; height: 1.6rem; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }

/* ---------------------------------------------------------------- /profile: Custom colours (custom-colors.js) */
/* A small mock of the CRM in the picked colours: sidebar, page, a card with text, a link and a button. */
.crm-palette-preview {
  display: flex; height: 7.5rem; border-radius: var(--tblr-border-radius); overflow: hidden;
  border: 1px solid var(--tblr-border-color); background: var(--pp-page);
}
.crm-pp-sidebar { flex: 0 0 22%; display: flex; flex-direction: column; gap: .4rem; padding: .6rem .5rem; background: var(--pp-sidebar); }
.crm-pp-item { height: .5rem; border-radius: 2px; background: color-mix(in srgb, var(--pp-text) 35%, transparent); }
.crm-pp-item.is-active { background: var(--pp-accent); }
.crm-pp-page { flex: 1; min-width: 0; padding: .75rem; }
.crm-pp-card {
  height: 100%; padding: .6rem .75rem; border-radius: var(--tblr-border-radius); background: var(--pp-cards); color: var(--pp-text);
  border: 1px solid color-mix(in srgb, var(--pp-cards) 84%, var(--pp-text)); font-size: .8rem; overflow-wrap: anywhere;
}
.crm-pp-title { font-weight: 600; margin-bottom: .25rem; }
.crm-pp-text { color: color-mix(in srgb, var(--pp-cards) 35%, var(--pp-text)); margin-bottom: .4rem; }
.crm-pp-link { color: var(--pp-link); }
.crm-pp-button { display: inline-block; padding: .1rem .6rem; border-radius: var(--tblr-border-radius); background: var(--pp-accent); color: var(--pp-on-accent); font-weight: 500; }
.crm-palette-fields { display: grid; gap: .6rem; }
.crm-palette-field { display: flex; align-items: center; gap: .75rem; cursor: pointer; }
.crm-palette-field .form-control-color { flex: none; width: 2.75rem; height: 2.25rem; padding: .2rem; }

/* ---------------------------------------------------------------- /profile: mail signatures (profile-signatures.js) */
.profile-signature-preview { height: 260px; }
