/* The CRM's own styles, linked after the editor's main.css
   (crm/views/container.js). Everything the editor already styles (subnav,
   data tables, form split, sections, toasts, actions) is used as it is; this
   file adds only the CRM's own marks. Ported from the approved prototype
   (proto/crm-designs, editor/public/styles/crm-prototype.css). */

.crm-shell {
  overflow-x: hidden; /* the shell's body style, which the CSP does not allow inline */
  --crm-line: #d5dbe4;
  --crm-muted: #6b7482;
  /* The app header's height, with the same fallback as the editor's sticky
     Subnav (the CRM's client does not publish the measured height). */
  --crm-top: var(--editor-shell-header-height, var(--editor-shell-header-min-height));
}

/* ---- people marks ---- */

/* A person's calendar colour on their initials (marks.jsx Avatar), one class
   per palette id of crm/lib/calendar/colors.js. */
.crm-person-crimson { --crm-person: #b54452; }
.crm-person-coral { --crm-person: #c7786f; }
.crm-person-clay { --crm-person: #b66f52; }
.crm-person-ochre { --crm-person: #b28745; }
.crm-person-amber { --crm-person: #c99a22; }
.crm-person-olive { --crm-person: #7b8251; }
.crm-person-lime { --crm-person: #699447; }
.crm-person-pine { --crm-person: #4f765f; }
.crm-person-teal { --crm-person: #4f8a86; }
.crm-person-aqua { --crm-person: #2b93a3; }
.crm-person-sky { --crm-person: #3f7fba; }
.crm-person-denim { --crm-person: #4f6f9d; }
.crm-person-indigo { --crm-person: #4f5fa8; }
.crm-person-violet { --crm-person: #7d6fa6; }
.crm-person-plum { --crm-person: #91617d; }
.crm-person-rose { --crm-person: #b76c83; }
.crm-person-cocoa { --crm-person: #806a5d; }
.crm-person-slate { --crm-person: #64748b; }

.crm-avatar {
  align-items: center;
  background: color-mix(in srgb, var(--crm-person, #64748b) 16%, #fff);
  border: 1.5px solid var(--crm-person, #64748b);
  border-radius: 50%;
  color: color-mix(in srgb, var(--crm-person, #64748b) 70%, #000);
  display: inline-flex;
  flex: none;
  font-size: 10px;
  font-weight: 700;
  height: 28px;
  justify-content: center;
  width: 28px;
}

/* ---- the signed-in account, far right of the header ---- */

.crm-shell-account {
  align-self: center;
  margin-left: auto;
  padding-left: 10px;
}

.crm-account {
  position: relative;
}

.crm-account > summary {
  cursor: pointer;
  list-style: none;
}

.crm-account > summary::-webkit-details-marker {
  display: none;
}

.crm-account-menu {
  background: #fff;
  border: 1px solid var(--crm-line);
  border-radius: 9px;
  box-shadow: var(--editor-shell-shadow);
  display: grid;
  gap: 10px;
  justify-items: start;
  padding: 12px 14px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  white-space: nowrap;
  z-index: 1050;
}

.crm-account-email {
  color: var(--crm-muted);
  font-size: 13px;
}

.crm-account-menu form {
  margin: 0;
}

/* ---- sign in ---- */

.crm-sign-in {
  align-items: center;
  display: grid;
  height: 100vh;
  justify-items: center;
}

.crm-sign-in section {
  background: #fff;
  border: 1px solid var(--crm-line);
  border-radius: 12px;
  box-shadow: var(--editor-shell-shadow);
  display: grid;
  justify-items: center;
  padding: 38px 46px 42px;
  width: 380px;
}

.crm-sign-in .editor-shell-title-kicker {
  color: var(--crm-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.crm-sign-in h1 {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 2px 0 26px;
}

.crm-sign-in-error {
  color: #b42318;
  font-size: 13px;
  margin: -12px 0 16px;
  text-align: center;
}

.crm-google {
  align-items: center;
  border: 1px solid #c4ccd8;
  border-radius: 7px;
  color: #18181b;
  display: inline-flex;
  font-size: 14px;
  font-weight: 600;
  gap: 10px;
  justify-content: center;
  padding: 10px 18px;
  text-decoration: none;
  width: 100%;
}

.crm-google:hover {
  background: #f8fafc;
  color: #18181b;
}

/* ======================================================================
   Lists and records (People; Shoots reuses every rule here). Ported from the
   approved prototype's stylesheet; the components are in
   crm/views/components/ and the client in crm/public/app/.
   ====================================================================== */

/* ---- index: one full-width table under its own search and Filters ---- */

/* The page's Subnav and the search bar stick as one block under the header,
   so the search stays in view down a long table (the Subnav's own sticky
   rule then has nothing to do). */
.crm-index-head {
  position: sticky;
  top: var(--crm-top);
  z-index: 400;
}

.crm-filter-bar {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #b5c1d0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 10px 16px;
  position: relative;
}

.crm-filter-bar input[type="search"] {
  width: 240px;
}

.crm-name-link {
  align-items: center;
  display: inline-flex;
  gap: 9px;
}

body.editor-shell table.data-view tr.crm-past td,
body.editor-shell table.data-view tr.crm-past td a {
  color: #9aa3af;
}

.crm-overdue {
  color: #b3362f;
  font-weight: 600;
}

.crm-faces {
  display: inline-flex;
}

.crm-faces .crm-avatar {
  background: #fff;
  background-image: linear-gradient(color-mix(in srgb, var(--crm-person) 16%, #fff), color-mix(in srgb, var(--crm-person) 16%, #fff));
  margin-right: -6px;
}

/* ---- the Filters button: a <details> whose popup holds the checkboxes ---- */

.crm-filters > summary {
  cursor: pointer;
  list-style: none;
}

.crm-filters > summary::-webkit-details-marker {
  display: none;
}

.crm-filter-bar .crm-filters {
  position: relative;
}

.crm-filter-bar .crm-filters > summary .crm-count {
  margin-left: 6px;
}

.crm-filter-pop {
  background: #fff;
  border: 1px solid #b5c1d0;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(15, 18, 24, 0.22);
  color: #18181b;
  left: 8px;
  padding: 10px 14px 12px;
  position: absolute;
  top: calc(100% - 2px);
  width: 230px;
  z-index: 450;
}

.crm-filter-bar .crm-filter-pop {
  left: 0;
  top: calc(100% + 12px);
}

/* A list's Filters popup opens from a bar that stays put under the header,
   so scrolling the page can never bring its foot into view: in a short
   window it scrolls inside itself instead (120px covers the bars above it). */
.crm-filters > .crm-filter-pop {
  max-height: calc(100vh - var(--crm-top) - 120px);
  overflow-y: auto;
}

.crm-filter-pop .stories-field-label {
  display: block;
  margin-top: 8px;
}

.crm-filter-pop .stories-field-label:first-child {
  margin-top: 0;
}

.crm-filter-pop .col {
  padding: 0;
}

.crm-filter-pop .form-check-label {
  font-size: 14px;
}

.crm-filter-pop-foot {
  border-top: 1px solid var(--crm-line);
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 10px;
  padding-top: 10px;
}

/* Apply submits the plain GET form; with the script every tick applies. */
html.crm-js body .crm-filter-pop .crm-filter-apply {
  display: none;
}

/* ---- two panes: a narrow list of names beside the selected record.
   The list is a plain white rail with its own tool row and a hard edge, the
   record sits on the editor's grey page under its own bar; each pane holds
   its own controls. Light only (owner, 2026-11-25). ---- */

/* The split runs to the page's end, so the sticky list never rides up into
   the shell's bottom padding (the record pane has its own). */
#editor-page-root:has(> .crm-split) {
  padding-bottom: 0;
}

.crm-split {
  align-items: start;
  display: grid;
  grid-template-columns: 20% minmax(0, 1fr);
}

/* The list stays in view while the record scrolls: exactly one viewport tall
   under the header (never stretched to the row, or sticky has no room to
   move), tool row fixed at its top, the names scrolling inside it. The pane
   itself does not clip, so the Filters popup can reach past its edge. */
.crm-list-pane {
  background: #fff;
  border-right: 1px solid #b5c1d0;
  box-shadow: 2px 0 6px rgba(28, 32, 36, 0.05);
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--crm-top));
  position: sticky;
  top: var(--crm-top);
  z-index: 401;
}

.crm-list-tools {
  align-items: center;
  background: linear-gradient(#f3f6fa, #e6ecf4);
  border-bottom: 1px solid #b5c1d0;
  border-top: 1px solid #b5c1d0;
  display: flex;
  flex: none;
  gap: 6px;
  margin: 0;
  min-height: 48px;
  padding: 7px 8px;
  position: relative;
}

body.editor-shell .crm-list-tools input[type="search"] {
  flex: 1;
  font-size: 13px;
  height: 30px;
  min-width: 0;
  padding: 3px 9px;
}

.crm-tool {
  align-items: center;
  background: #fff;
  border: 1px solid #b5c1d0;
  border-radius: 6px;
  color: #33415a;
  display: inline-flex;
  flex: none;
  gap: 4px;
  height: 30px;
  justify-content: center;
  min-width: 30px;
  padding: 0 6px;
}

.crm-tool:hover {
  background: #f3f6fa;
  color: #18181b;
}

.crm-tool.is-on {
  background: #18181b;
  border-color: #18181b;
  color: #fff;
}

.crm-tool.is-on .crm-count {
  background: #fff;
  color: #18181b;
}

.crm-name-list {
  flex: 1;
  list-style: none;
  margin: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0;
}

.crm-name-list a {
  align-items: center;
  border-bottom: 1px solid #e6eaf0;
  color: inherit;
  display: flex;
  font-size: 13.5px;
  gap: 9px;
  overflow: hidden;
  padding: 7px 10px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-name-list a:hover {
  background: #f6f8fb;
}

.crm-name-list a[aria-current="true"] {
  background: #e6edf7;
  box-shadow: inset 3px 0 0 #18181b;
  font-weight: 650;
}

.crm-name-list li.crm-past a:not([aria-current]) {
  color: #9aa3af;
}

.crm-name-list .crm-avatar {
  font-size: 9px;
  height: 24px;
  width: 24px;
}

.crm-detail-pane {
  min-width: 0;
  padding-bottom: 60px;
}

.crm-detail-pane .tag-section:first-of-type {
  margin-top: 0;
}

/* Sections stack flush, so a run of closed ones reads as a list of rows. */
.crm-detail-pane .tag-section {
  margin: 0;
}

.crm-detail-pane .tag-section + .tag-section > .tag-section-header {
  border-top: 0;
}

/* ---- sections: a closed one says what matters in its title bar; an open
   one shows its actions there instead (crm/views/components/section.jsx) ---- */

.tag-section-heading {
  align-items: center;
  display: flex;
  min-width: 0;
}

.crm-section-summary {
  align-items: center;
  color: var(--crm-muted);
  display: inline-flex;
  font-size: 13.5px;
  gap: 12px;
  margin-left: 14px;
  min-width: 0;
}

.crm-section-summary:empty,
.crm-section .tag-section-heading:has(> [aria-expanded="true"]) > .crm-section-summary,
.crm-section > .tag-section-header:has([aria-expanded="false"]) > .crm-section-actions {
  display: none;
}

.crm-section-actions {
  display: inline-flex;
  gap: 6px;
}

.crm-required {
  color: var(--crm-muted);
  font-weight: 400;
}

/* ---- forms ---- */

body.editor-shell .crm-form .editor-form-split-main {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

body.editor-shell .crm-form.crm-form-single .editor-form-split-main {
  grid-template-columns: minmax(0, 300px);
}

.crm-form .crm-span {
  grid-column: 1 / -1;
}

body.editor-shell .crm-form textarea.crm-notes {
  height: 96px;
}

.crm-form-error {
  color: #b3362f;
  font-size: 13px;
  margin: 6px 0 0;
}

.crm-links {
  display: grid;
  gap: 6px;
  max-width: 760px;
}

.crm-links .tag-link-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 130px minmax(0, 1fr) 96px auto 26px auto auto;
}

.crm-links .crm-followers {
  text-align: right;
}

.crm-followers-read {
  color: var(--crm-muted);
  font-size: 12.5px;
  white-space: nowrap;
}

.crm-followers-refresh {
  background: none;
  border: 0;
  padding: 0;
}

.crm-row-actions {
  text-align: right;
  white-space: nowrap;
}

.crm-row-actions .btn + .btn {
  margin-left: 6px;
}

table.data-view .form-control {
  font-size: 13px;
  height: 30px;
  padding: 4px 8px;
}

.crm-days td:nth-child(-n+3) {
  width: 150px;
}

body.editor-shell table.data-view tr.crm-missing td:nth-child(2),
body.editor-shell table.data-view td.crm-overdue {
  color: #b3362f;
}

body.editor-shell table.data-view td.crm-warn {
  color: #a16207;
}

.crm-upload-row .file-upload {
  max-width: 220px;
}

/* A document's dates save as they change; the Expires cell's warning colours
   its box (crm/views/people.jsx). */
table.data-view .form-control.crm-document-date {
  width: 150px;
}

body.editor-shell table.data-view td.crm-overdue .crm-document-date,
body.editor-shell table.data-view td.crm-warn .crm-document-date {
  color: inherit;
}

/* Replace and Upload draw their upload's ghost over their own cell. */
.crm-documents .crm-row-actions {
  position: relative;
}

/* ---- payment, measurement sets ---- */

.crm-payment {
  display: grid;
  gap: 4px 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 760px;
}

body.editor-shell .crm-payment textarea.form-control {
  height: auto;
  min-height: 34px;
  resize: vertical;
}

.crm-sets {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.crm-set-head {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.crm-set-head .form-control {
  font-weight: 600;
}

body.editor-shell .crm-set textarea.form-control {
  font-size: 13px;
  height: auto;
  line-height: 1.45;
  resize: vertical;
}

.crm-invite {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.crm-invite.is-accepted { color: #1f8a4c; }
.crm-invite.is-invited,
.crm-invite.is-tentative { color: #a16207; }
.crm-invite.is-declined { color: #b3362f; }

/* ---- email dialog (crm/views/components/compose-email.jsx) ---- */

dialog.crm-compose {
  width: 680px;
}

dialog.crm-compose::backdrop {
  background: rgba(15, 18, 24, 0.45);
}

.crm-compose .editor-modal-body {
  padding: 16px;
}

.crm-compose .editor-modal-footer {
  justify-content: flex-end;
  padding: 10px 16px;
}

.crm-compose-fields {
  align-items: center;
  display: grid;
  gap: 8px 12px;
  grid-template-columns: 64px minmax(0, 1fr);
  margin-bottom: 12px;
}

.crm-compose-fields .col-form-label {
  font-size: 13px;
  margin: 0;
  padding: 0;
}

.crm-compose-from {
  font-size: 14px;
}

.crm-compose-to {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.crm-compose-chip {
  align-items: center;
  border: 1px solid var(--crm-line);
  border-radius: 16px;
  display: inline-flex;
  font-size: 13px;
  gap: 6px;
  padding: 2px 4px 2px 3px;
}

.crm-compose-chip .crm-avatar {
  font-size: 8.5px;
  height: 22px;
  width: 22px;
}

body.editor-shell .crm-compose textarea.form-control {
  height: auto;
}

/* ---- to-do lists (crm/views/components/todo-list.jsx) ---- */

.crm-todos {
  display: grid;
  gap: 4px;
  max-width: 760px;
}

.crm-todo {
  align-items: center;
  display: flex;
  font-size: 14px;
  gap: 8px;
}

.crm-todo.form-check .form-check-input {
  flex: none;
  margin-top: 0;
}

.crm-todo .form-check-label {
  flex: 1;
  min-width: 0;
}

body.editor-shell .crm-todos .crm-todo-due {
  flex: none;
  font-size: 13px;
  height: 28px;
  padding: 2px 6px;
  width: 136px;
}

body.editor-shell .crm-todo .crm-todo-due {
  background: transparent;
  border-color: transparent;
}

body.editor-shell .crm-todo .crm-todo-due:hover,
body.editor-shell .crm-todo .crm-todo-due:focus {
  background: #fff;
  border-color: #b5c1d0;
}

.crm-todo.is-checked .crm-todo-due {
  color: #9aa3af;
}

body.editor-shell .crm-todo.is-overdue .crm-todo-due {
  color: #b3362f;
  font-weight: 600;
}

.crm-todo.is-checked .form-check-label {
  color: #9aa3af;
  text-decoration: line-through;
}

/* A to-do's × shows on its row's hover, so the list reads as the design's. */
.crm-todo .crm-todo-remove {
  visibility: hidden;
}

.crm-todo:hover .crm-todo-remove,
.crm-todo .crm-todo-remove:focus-visible {
  visibility: visible;
}

.crm-todos .crm-todo-add {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) 136px auto;
  margin-top: 6px;
}

/* ---- people marks ---- */

.crm-paperwork {
  display: inline-flex;
  flex: none;
  gap: 3px;
}

.crm-paperwork-dot {
  border: 1.5px solid #c2413a;
  border-radius: 50%;
  height: 9px;
  width: 9px;
}

.crm-paperwork-dot.is-on {
  background: #c98a1b;
  border-color: #c98a1b;
}

.crm-paperwork-dot.is-on.is-complete {
  background: #1f8a4c;
  border-color: #1f8a4c;
}

.crm-count {
  background: #18181b;
  border-radius: 9px;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 18px;
  min-width: 18px;
  padding: 0 5px;
  text-align: center;
}

/* ---- photos ---- */

.crm-photos {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.crm-photo {
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  margin: 0;
  overflow: hidden;
  position: relative;
}

.crm-photo > img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

/* A HEIC photo, which only Safari draws: a tile that opens the file. */
.crm-photo-file {
  align-items: center;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  height: 100%;
  justify-content: center;
  width: 100%;
}

.crm-photo-file .editor-action-icon {
  height: 32px;
  width: 32px;
}

/* What a photo shows until (or unless) its picture loads. */
.crm-photo-0 { background: linear-gradient(160deg, #3b3f4a, #9a6f78); }
.crm-photo-1 { background: linear-gradient(200deg, #5a2a33, #c7949c); }
.crm-photo-2 { background: linear-gradient(140deg, #23262e, #6f7f96); }
.crm-photo-3 { background: linear-gradient(180deg, #7b5a4a, #d9bfae); }
.crm-photo-4 { background: linear-gradient(220deg, #2e3a35, #8ea79a); }

.crm-photo-badge {
  background: #18181b;
  border: 0;
  border-radius: 4px;
  bottom: var(--media-overlay-inset);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  left: var(--media-overlay-inset);
  padding: 2px 7px;
  position: absolute;
}

/* Any other photo offers to become the portrait on hover. */
.crm-photo-make-portrait {
  background: rgba(255, 255, 255, 0.92);
  color: #18181b;
  visibility: hidden;
}

.crm-photo:hover .crm-photo-make-portrait,
.crm-photo-make-portrait:focus-visible {
  visibility: visible;
}

.crm-photo-delete {
  align-items: center;
  background: #fff;
  border: 0;
  border-radius: var(--media-overlay-radius);
  box-shadow: var(--media-overlay-shadow);
  color: #b3362f;
  display: inline-flex;
  height: var(--media-overlay-size);
  justify-content: center;
  position: absolute;
  right: var(--media-overlay-inset);
  top: var(--media-overlay-inset);
  width: var(--media-overlay-size);
}

/* ---- people on a shoot (Shoots) ---- */

.crm-cast-list {
  display: grid;
  gap: 0;
  max-width: 900px;
}

.crm-cast {
  border-bottom: 1px solid var(--crm-line);
  padding: 12px 0 16px;
}

.crm-cast:first-child {
  padding-top: 0;
}

.crm-cast:last-child {
  border-bottom: 0;
}

.crm-cast-head {
  align-items: center;
  display: flex;
  gap: 14px;
  margin-bottom: 8px;
}

.crm-cast-head > a {
  align-items: center;
  color: inherit;
  display: inline-flex;
  gap: 9px;
  min-width: 190px;
  text-decoration: none;
}

.crm-cast-head select.form-control {
  font-size: 13px;
  height: 30px;
  padding: 3px 8px;
  width: 120px;
}

.crm-cast-days {
  flex: 1;
  white-space: nowrap;
}

.crm-cast .crm-todos {
  padding-left: 37px;
}

/* Add Person: the Filters popup's look, opening leftwards from the button. */
.crm-add-person {
  position: relative;
}

.crm-add-person .crm-filter-pop {
  left: auto;
  right: 0;
  top: calc(100% + 6px);
  width: 260px;
}

.crm-person-pick ul {
  list-style: none;
  margin: 8px 0 0;
  max-height: 320px;
  overflow-y: auto;
  padding: 0;
}

.crm-person-pick button {
  align-items: center;
  background: none;
  border: 0;
  border-radius: 6px;
  display: flex;
  gap: 9px;
  padding: 5px 6px;
  text-align: left;
  width: 100%;
}

.crm-person-pick button:hover,
.crm-person-pick button:focus-visible {
  background: #eef2f7;
}

.crm-person-pick-empty {
  color: var(--crm-muted);
  font-size: 13.5px;
  padding: 5px 6px;
}

.crm-invite-note {
  color: var(--crm-muted);
  font-size: 13.5px;
  margin: 0 0 10px;
}
