/* Salespirit Sales — calendar in a Google Calendar layout, in the Mono Soft style */
.cal { display: grid; grid-template-columns: 256px minmax(0, 1fr); gap: 20px; align-items: start; }
.cal-side { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 22px; }

/* Create button (Google's big "+ Create") */
.cal-create {
  display: inline-flex; align-items: center; gap: 12px; align-self: flex-start;
  height: 56px; padding: 0 26px 0 12px; border: 0; border-radius: 18px;
  background: var(--bg); color: var(--fg); font-weight: 700; font-size: 15px;
  box-shadow: var(--sh-out); transition: box-shadow .2s;
}
.cal-create:hover { box-shadow: 12px 12px 26px var(--lo), -12px -12px 26px var(--hi); }
.cal-create:active { box-shadow: var(--sh-in); }
.cal-plus { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--on-ink); }
.cal-plus .ti { font-size: 18px; vertical-align: 0; }
.cal-fab { display: none; }

/* Mini month */
.cal-mini { padding: 14px 12px; border-radius: var(--r); background: var(--bg); box-shadow: var(--sh-out-sm); }
.cal-mini-h { display: flex; align-items: center; justify-content: space-between; font-size: 14px; margin: 0 0 6px 8px; }
.cal-mini-h > span { display: flex; }
.cal-mini-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 2px; text-align: center; }
.cal-mini-g span { font-size: 11px; font-weight: 700; color: var(--dim); padding: 4px 0; }
.cal-mini-g button { border: 0; background: none; width: 30px; height: 30px; margin: auto; padding: 0; border-radius: 50%; font-size: 12px; font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums; transition: box-shadow .15s; }
.cal-mini-g button.out { color: var(--dim); opacity: .6; }
.cal-mini-g button:hover { box-shadow: var(--sh-out-sm); }
.cal-mini-g button.inr { background: var(--soft); border-radius: 0; }
.cal-mini-g button.sel { box-shadow: var(--sh-in-sm); border-radius: 50%; }
.cal-mini-g button.today { background: var(--ink); color: var(--on-ink); border-radius: 50%; }

/* People (calendars) */
.cal-side-h { font-size: 12px; font-weight: 800; color: var(--dim); text-transform: uppercase; letter-spacing: .07em; margin: 0 0 6px 10px; }
.cal-people { display: flex; flex-direction: column; gap: 1px; }
.cal-people label { display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: 12px; font-size: 14px; font-weight: 600; cursor: pointer; }
.cal-people label:hover { background: var(--soft); }
.cal-people input { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin: 0; flex: none; border-radius: 5px; border: 2px solid var(--c); display: grid; place-items: center; cursor: pointer; }
.cal-people input:checked { background: var(--c); }
.cal-people input:checked::after { content: ""; width: 4px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.cal-only { align-self: flex-start; border: 0; background: none; color: var(--dim); font-size: 12.5px; font-weight: 700; padding: 6px 10px; border-radius: 99px; }
.cal-only:hover { color: var(--fg); box-shadow: var(--sh-out-sm); }

/* Main area */
.cal-main { padding: 0; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.cal-bar { display: flex; align-items: center; gap: 6px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cal-title { flex: 1; margin: 0 0 0 10px; font-size: 22px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cal-arrow { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; color: var(--fg); flex: none; transition: box-shadow .15s; }
.cal-arrow .ti { font-size: 19px; vertical-align: 0; }
.cal-arrow:hover { box-shadow: var(--sh-out-sm); }
.cal-arrow:active { box-shadow: var(--sh-in-sm); }
.cal-arrow.sm { width: 28px; height: 28px; }
.cal-arrow.sm .ti { font-size: 16px; }
.cal-body { position: relative; min-height: 300px; }
.cal-loading { height: calc(100vh - 210px); min-height: 420px; display: grid; place-items: center; }
.cal-loading span { width: 40px; height: 40px; border-radius: 50%; box-shadow: var(--sh-out); animation: bootPulse 1.1s ease-in-out infinite; }

/* Time grid (day / week) */
.cal-grid { display: flex; flex-direction: column; height: calc(100vh - 196px); min-height: 480px; }
.cal-head, .cal-allday { display: grid; grid-template-columns: 64px repeat(var(--n), minmax(0, 1fr)); flex: none; padding-right: var(--sbw, 0px); }
.cal-head { border-bottom: 1px solid var(--line); }
.cal-gutter { display: flex; align-items: flex-end; justify-content: flex-end; padding: 0 8px 8px 0; font-size: 10.5px; font-weight: 600; color: var(--dim); }
.cal-dh { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 0 8px; color: var(--dim); }
.cal-dh span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.cal-dh b { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; font-size: 24px; font-weight: 600; color: var(--fg); transition: box-shadow .15s; font-variant-numeric: tabular-nums; }
.cal-dh:hover b { box-shadow: var(--sh-out-sm); }
.cal-dh.today span { color: var(--fg); }
.cal-dh.today b { background: var(--ink); color: var(--on-ink); box-shadow: 4px 4px 10px var(--lo); }
.cal-grid.day .cal-dh { align-items: flex-start; padding-left: 14px; }
.cal-allday { border-bottom: 1px solid var(--line); }
.cal-allday-in { grid-column: 2 / -1; position: relative; }
.cal-bar-ev { position: absolute; height: 21px; margin-left: 3px; border: 0; border-radius: 6px; background: var(--c); color: #fff; font-size: 12px; font-weight: 700; text-align: left; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-scroll { flex: 1; overflow-y: auto; display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: start; scrollbar-width: thin; overscroll-behavior: contain; }
.cal-times { position: relative; height: calc(var(--h) * 24); }
.cal-times span { position: absolute; right: 10px; transform: translateY(-50%); font-size: 10.5px; font-weight: 600; color: var(--dim); font-variant-numeric: tabular-nums; }
.cal-cols {
  position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); height: calc(var(--h) * 24);
  background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px var(--h));
  user-select: none; -webkit-user-select: none;
}
.cal-col { position: relative; border-left: 1px solid var(--line); }
.cal-col.today { background: color-mix(in srgb, var(--fg) 3%, transparent); }

/* Appointments */
.cal-ev {
  position: absolute; z-index: 1; margin-left: 2px; padding: 3px 7px; overflow: hidden;
  display: flex; flex-direction: column; border-radius: 7px; background: var(--c); color: #fff;
  font-size: 12px; line-height: 1.3; cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 0 0 1px color-mix(in srgb, var(--bg) 80%, transparent);
  transition: box-shadow .15s, opacity .15s;
}
.cal-ev b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev span { opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.short { flex-direction: row; align-items: center; gap: 6px; padding-top: 0; padding-bottom: 0; }
.cal-ev.short b { flex: 0 1 auto; }
.cal-ev.past, .cal-chip.past { opacity: .62; }
.cal-ev:hover, .cal-ev:focus-visible { z-index: 9 !important; box-shadow: 0 8px 18px rgba(0, 0, 0, .25); opacity: 1; outline: none; }
.cal-ev.dragging { z-index: 6; opacity: .92; cursor: grabbing; transition: none; box-shadow: 0 14px 28px rgba(0, 0, 0, .3); }
.cal-rs { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; cursor: ns-resize; }
.cal-ghost { position: absolute; left: 2px; right: 6px; z-index: 4; pointer-events: none; padding: 3px 7px; border-radius: 7px; background: color-mix(in srgb, var(--ink) 80%, transparent); color: var(--on-ink); font-size: 12px; font-weight: 700; box-shadow: 0 8px 20px rgba(0, 0, 0, .25); }
.cal-now { position: absolute; left: -1px; right: 0; height: 2px; background: #ea4335; z-index: 7; pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -6px; top: -5px; width: 12px; height: 12px; border-radius: 50%; background: #ea4335; }

/* Month */
.cal-month { display: flex; flex-direction: column; height: calc(100vh - 196px); min-height: 520px; }
.cal-mh { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.cal-mh span { padding: 8px 0; text-align: center; font-size: 11px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .07em; }
.cal-mgrid { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(var(--w, 6), minmax(0, 1fr)); }
.cal-mc { min-width: 0; overflow: hidden; display: flex; flex-direction: column; gap: 2px; padding: 4px 4px 2px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal-mc:nth-child(7n) { border-right: 0; }
.cal-mc:nth-last-child(-n + 7) { border-bottom: 0; }
.cal-mc.out { background: color-mix(in srgb, var(--fg) 2.5%, transparent); }
.cal-mc.out .cal-mnum { color: var(--dim); }
.cal-mnum { align-self: center; min-width: 26px; height: 26px; padding: 0 7px; border: 0; border-radius: 99px; background: none; color: var(--fg); font-size: 12px; font-weight: 700; flex: none; }
.cal-mnum:hover { box-shadow: var(--sh-out-sm); }
.cal-mc.today .cal-mnum { background: var(--ink); color: var(--on-ink); }
.cal-chip { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 1px 6px; border: 0; border-radius: 6px; background: none; color: var(--fg); font-size: 12px; text-align: left; white-space: nowrap; overflow: hidden; flex: none; }
.cal-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.cal-chip em { font-style: normal; color: var(--dim); font-variant-numeric: tabular-nums; }
.cal-chip b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.cal-chip:hover { background: var(--soft); }
.cal-chip.span { background: var(--c); color: #fff; }
.cal-more { align-self: flex-start; border: 0; background: none; padding: 1px 6px; border-radius: 6px; color: var(--dim); font-size: 12px; font-weight: 700; flex: none; }
.cal-more:hover { background: var(--soft); color: var(--fg); }

/* Detail popover */
.cal-pop {
  position: fixed; z-index: 70; width: 380px; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); overflow: auto;
  padding: 10px 12px 18px; border-radius: 22px; background: var(--bg);
  box-shadow: 16px 16px 36px rgba(0, 0, 0, .22), -8px -8px 24px var(--hi);
  animation: pop .16s ease-out;
}
.cal-pop-acts { display: flex; justify-content: flex-end; gap: 4px; margin-bottom: 2px; }
.cal-pop-row { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: start; padding: 6px 8px; font-size: 14px; }
.cal-pop-row > .ti { justify-self: center; margin-top: 2px; color: var(--dim); font-size: 19px; }
.cal-pop-sq { justify-self: center; width: 15px; height: 15px; margin-top: 7px; border-radius: 4px; background: var(--c); }
.cal-pop h3 { margin: 0 0 2px; font-size: 21px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; overflow-wrap: anywhere; }
.cal-pop .muted { font-size: 13.5px; }
.cal-pop a { overflow-wrap: anywhere; }
.cal-pop-att { display: flex; flex-direction: column; gap: 7px; }
.cal-pop-att span { display: flex; align-items: center; gap: 8px; }
.cal-pop-desc { white-space: pre-wrap; color: var(--dim); font-size: 13.5px; max-height: 180px; overflow: auto; }

/* Smaller screens: no side column, a round + button instead (like the Google Calendar app) */
@media (max-width: 1100px) {
  .cal { grid-template-columns: minmax(0, 1fr); }
  .cal-side { display: none; }
  .cal-fab { display: grid; place-items: center; position: fixed; right: 20px; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 30; width: 58px; height: 58px; border: 0; border-radius: 20px; background: var(--ink); color: var(--on-ink); box-shadow: 8px 8px 20px var(--lo), -6px -6px 16px var(--hi); }
  .cal-fab .ti { font-size: 26px; vertical-align: 0; }
}
@media (max-width: 820px) {
  .cal-bar { padding: 12px; gap: 4px; }
  .cal-title { order: -1; flex-basis: 100%; margin: 0 0 6px 2px; font-size: 19px; }
  .cal-views { margin-left: auto; }
  .cal-views button { padding: 7px 11px; }
  .cal-grid, .cal-month, .cal-loading { height: calc(100vh - 250px); min-height: 440px; }
  .cal-head, .cal-allday { grid-template-columns: 46px repeat(var(--n), minmax(0, 1fr)); }
  .cal-scroll { grid-template-columns: 46px minmax(0, 1fr); }
  .cal-times span { right: 6px; font-size: 10px; }
  .cal-dh b { width: 36px; height: 36px; font-size: 18px; }
  .cal-grid.week .cal-dh span { font-size: 9.5px; letter-spacing: .02em; }
  .cal-grid.week .cal-ev { padding: 2px 3px; font-size: 10.5px; }
  .cal-grid.week .cal-ev span { display: none; }
  .cal-mc { padding: 2px 1px; }
  .cal-chip { padding: 1px 3px; font-size: 10.5px; gap: 3px; }
  .cal-chip em, .cal-chip i { display: none; }
  .cal-chip:not(.span) { background: color-mix(in srgb, var(--c) 18%, transparent); }
  .cal-pop { left: 12px !important; right: 12px; top: auto !important; bottom: calc(12px + env(safe-area-inset-bottom)); width: auto; max-height: 70vh; }
}
@media (prefers-reduced-motion: reduce) { .cal-pop, .cal-loading span { animation: none; } }
