/* ── Components: Studio Production ─────────────────────────────── */

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-sm);
  padding: var(--sp-md) var(--sp-xl);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  min-height: var(--btn-height-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
}

.btn:active {
  transform: scale(0.95);
  transition: transform 80ms ease-in;
}

.btn-primary,
.btn-accent {
  background: var(--accent);
  color: var(--accent-on);
}

.btn-primary:hover,
.btn-accent:hover {
  background: var(--accent-hover);
  color: var(--accent-on);
  box-shadow: var(--shadow-accent);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: var(--accent-on);
}

.btn-secondary {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  backdrop-filter: blur(var(--blur-sm));
  -webkit-backdrop-filter: blur(var(--blur-sm));
}

.btn-secondary:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
}

.btn-ghost {
  color: var(--text-secondary);
  padding: var(--sp-sm) var(--sp-md);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--glass-bg);
}

.btn-xs {
  padding: var(--sp-xs) var(--sp-sm);
  font-size: 0.6875rem;
  min-height: unset;
  height: auto;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  gap: var(--sp-xs);
}

.btn-ghost.btn-xs {
  background: none;
  border: none;
}

/* Visible button — solid outline that works on every theme */
.btn-visible {
  background: var(--accent-soft) !important;
  border: 1.5px solid var(--text-secondary) !important;
  color: var(--text-primary) !important;
  border-radius: 6px !important;
  padding: 5px 10px !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  cursor: pointer !important;
}
.btn-visible:hover {
  background: var(--accent-glow) !important;
}

.btn-sm {
  padding: var(--sp-sm) var(--sp-md);
  font-size: 0.8125rem;
  min-height: var(--btn-height-sm);
}

.btn-lg {
  padding: var(--sp-lg) var(--sp-2xl);
  font-size: 1rem;
  min-height: var(--btn-height-lg);
  border-radius: var(--radius-md);
}

.btn-icon {
  padding: var(--sp-sm);
  min-height: auto;
  width: var(--btn-height-icon);
  height: var(--btn-height-icon);
  border-radius: var(--radius-sm);
}

.btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.btn-error {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.25);
}
.btn-error:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1.5px solid currentColor;
  background: transparent;
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
  opacity: 0.7;
  transition: opacity var(--duration-fast) var(--ease-out);
}
.btn-inline:hover { opacity: 1; }

.btn-icon-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  color: var(--text-inverse);
  transition: opacity var(--duration-fast) var(--ease-out);
}
.btn-icon-circle:hover { opacity: 0.85; }
.btn-icon-circle--accent { background: var(--accent); color: var(--accent-on); }
.btn-icon-circle--error { background: rgba(229, 62, 62, 0.7); }

/* ── Badges ───────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.6;
}

.badge-accent {
  background: var(--accent-soft);
  color: var(--accent-text);
}
.approval-needs-badge {
  background: rgba(255, 183, 77, 0.15);
  color: var(--color-warning, #ffb74d);
  border: 1px solid rgba(255, 183, 77, 0.3);
}

/* Stage badges */
.badge-forecast       { background: color-mix(in srgb, var(--stage-forecast) 15%, transparent); color: var(--stage-forecast); }
.badge-intake         { background: color-mix(in srgb, var(--stage-intake) 15%, transparent); color: var(--stage-intake); }
.badge-preproduction  { background: color-mix(in srgb, var(--stage-preproduction) 15%, transparent); color: var(--stage-preproduction); }
.badge-production     { background: color-mix(in srgb, var(--stage-production) 15%, transparent); color: var(--stage-production); }
.badge-post           { background: color-mix(in srgb, var(--stage-post) 15%, transparent); color: var(--stage-post); }
.badge-review         { background: color-mix(in srgb, var(--stage-review) 15%, transparent); color: var(--stage-review); }
.badge-completion     { background: color-mix(in srgb, var(--stage-completion) 15%, transparent); color: var(--stage-completion); }

/* Severity badges */
.badge-critical { background: color-mix(in srgb, var(--severity-critical) 15%, transparent); color: var(--severity-critical); }
.badge-warning  { background: color-mix(in srgb, var(--severity-warning) 15%, transparent); color: var(--severity-warning); }
.badge-watch    { background: color-mix(in srgb, var(--severity-watch) 15%, transparent); color: var(--severity-watch); }
.badge-insight  { background: color-mix(in srgb, var(--severity-insight) 15%, transparent); color: var(--severity-insight); }
/* Approval status badges */
.badge-success  { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }

/* Notification dot */
.badge-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-primary);
}

.badge-count {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-on);
  font-size: 0.625rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-primary);
}

/* ── Input ────────────────────────────────────────────────────── */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
}

.input-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.input-field {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: var(--sp-md) var(--sp-lg);
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
  width: 100%;
}

.input-field::placeholder { color: var(--text-muted); }

.input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

textarea.input-field {
  resize: vertical;
  min-height: 80px;
}

select.input-field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0a0b0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ── Avatar ───────────────────────────────────────────────────── */
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 600;
  flex-shrink: 0;
  background: var(--glass-bg-active);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
}

.avatar-sm  { width: 28px; height: 28px; font-size: 0.6875rem; }
.avatar-md  { width: 36px; height: 36px; font-size: 0.8125rem; }
.avatar-lg  { width: 48px; height: 48px; font-size: 1rem; }
.avatar-xl  { width: 64px; height: 64px; font-size: 1.25rem; }

.avatar-lead   { border-color: var(--accent); color: var(--accent-text); }
.avatar-camera { border-color: var(--stage-production); color: var(--stage-production); }
.avatar-editor { border-color: var(--stage-post); color: var(--stage-post); }
.avatar-floater { border-color: var(--stage-forecast); color: var(--stage-forecast); }

/* ── Tabs ─────────────────────────────────────────────────────────
   THE tab primitive (2026-09-13 audit §6). Five bespoke tab bars had
   grown up across the app, split between `.active` and `.is-active`.
   New and reworked bars use this one: .tabs > .tab, current tab gets
   .is-active. Add .tabs--scroll when a bar holds more than about five
   entries — tabs stop stretching and the row scrolls sideways instead
   of squeezing labels into two lines.
   Two holdouts keep their own classes because each carries structure
   this primitive does not — .pipeline-stage-tab has a count pill bound
   to the active tab, .booking-tab is an auto-width row with the
   underline on the container. They mirror this look through a rule in
   pages.css; migrate them when their markup is next touched. */
.tabs {
  display: flex;
  gap: 0;
  flex-shrink: 0;
  padding: 0 var(--sp-md);
  border-bottom: 1px solid var(--glass-border);
}

.tabs--scroll {
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.tabs--scroll::-webkit-scrollbar { display: none; }

.tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-xs);
  padding: var(--sp-sm) var(--sp-md);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
}

/* Scrolling bars size to their label instead of stretching */
.tabs--scroll .tab {
  flex: 0 0 auto;
  padding-left: var(--sp-lg);
  padding-right: var(--sp-lg);
}

.tab:hover { color: var(--text-primary); }

.tab.is-active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  background: var(--danger, var(--error));
  color: var(--text-inverse);
  font-size: 0.6rem;
  font-weight: 700;
}

/* ── Chip ─────────────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: var(--sp-xs) var(--sp-md);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 500;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.chip:hover {
  background: var(--glass-bg-hover);
  color: var(--text-primary);
}

.chip.active {
  background: var(--accent-soft);
  border-color: var(--accent-glow);
  color: var(--accent-text);
}

/* Dismiss/delete affordance inside a chip (e.g. the template chips on
   New Project). Sits flush with the label; the chip itself stays clickable. */
.chip-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: -4px;
  padding: 0;
  border: none;
  border-radius: var(--radius-full);
  background: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
}

.chip-x:hover {
  background: var(--glass-bg-hover);
  color: var(--error);
}

.chip-count {
  font-size: 0.6875rem;
  font-weight: 600;
  background: var(--accent-soft, rgba(196, 62, 62, 0.15));
  color: var(--accent-text, var(--accent));
  border-radius: var(--radius-full);
  padding: 0 5px;
  min-width: 16px;
  text-align: center;
  line-height: 16px;
}

/* ── Toast ────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: calc(var(--safe-top) + var(--sp-lg));
  left: 50%;
  transform: translateX(-50%);
  z-index: 100001; /* above every overlay (wall remote 9998/9999, takeover 100000) — a toast is never the thing being covered */
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  pointer-events: none;
  width: calc(100% - var(--sp-2xl) * 2);
  max-width: 400px;
}

.toast {
  background: var(--bg-secondary);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--sp-md) var(--sp-lg);
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn var(--duration-normal) var(--ease-out);
}

.toast-error   { border-left: 3px solid var(--severity-critical); }
.toast-warning { border-left: 3px solid var(--severity-warning); }
.toast-success { border-left: 3px solid var(--stage-completion); }
.toast-info    { border-left: 3px solid var(--severity-insight); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Modal ────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(var(--blur-xs));
  -webkit-backdrop-filter: blur(var(--blur-xs));
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-xl);
  animation: fadeIn var(--duration-fast) var(--ease-out);
}

.modal {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--glass-inner-shadow), var(--shadow-lg), var(--shadow-sm);
  animation: modalIn 350ms var(--ease-spring);
}

/* Tall modals: body scrolls while header/footer stay pinned */
.modal .modal-body {
  flex: 1;
  overflow-y: auto;
}

/* Alias: some modals (calendar create-event, photo crop, asset detail) use
   .modal-panel / .modal-title instead of .modal / <h3>. Keep them styled
   identically so those features don't render unstyled. */
.modal-panel {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow: auto;
  box-shadow: var(--glass-inner-shadow), var(--shadow-lg), var(--shadow-sm);
  animation: modalIn 350ms var(--ease-spring);
}

.modal-header {
  padding: var(--sp-xl) var(--sp-xl) var(--sp-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3,
.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
}

.modal-body { padding: 0 var(--sp-xl) var(--sp-xl); }

.modal-footer {
  padding: var(--sp-lg) var(--sp-xl);
  display: flex;
  gap: var(--sp-sm);
  justify-content: flex-end;
  border-top: 1px solid var(--glass-border);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Empty State ──────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-3xl) var(--sp-xl);
  text-align: center;
  color: var(--text-muted);
  animation: emptyFadeIn 400ms var(--ease-out) both;
}

@keyframes emptyFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  margin-bottom: var(--sp-lg);
}

.empty-state-icon svg {
  width: 28px;
  height: 28px;
  opacity: 0.5;
}

.empty-state-icon--positive {
  background: color-mix(in srgb, var(--success) 10%, transparent);
  border-color: color-mix(in srgb, var(--success) 20%, transparent);
}

.empty-state-icon--positive svg {
  color: var(--success);
  opacity: 0.7;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: var(--sp-lg);
  opacity: 0.4;
}

.empty-state-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--sp-xs);
}

.empty-state-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  max-width: 280px;
  line-height: 1.5;
  margin-bottom: var(--sp-lg);
}

.empty-state .btn {
  margin-top: var(--sp-sm);
}

/* ── Divider ──────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--glass-border);
  margin: var(--sp-lg) 0;
}

/* ── Loading Spinner ──────────────────────────────────────────── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--glass-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-lg {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Skeleton Loading ─────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg,
    var(--glass-bg) 25%,
    var(--glass-bg-hover) 50%,
    var(--glass-bg) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Skeleton screen building blocks */
.skeleton-line {
  height: 12px;
  margin-bottom: var(--sp-sm);
}
.skeleton-line--lg { height: 18px; }
.skeleton-line--xl { height: 24px; }
.skeleton-line--short { width: 40%; }
.skeleton-line--med { width: 65%; }
.skeleton-line--full { width: 100%; }

.skeleton-card {
  padding: var(--sp-lg);
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  margin-bottom: var(--sp-md);
}

.skeleton-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-row {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  margin-bottom: var(--sp-md);
}

/* Skeleton stat cards row */
.skeleton-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-md);
  margin-bottom: var(--sp-xl);
}
.skeleton-stat {
  padding: var(--sp-lg);
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}
.skeleton-stat .skeleton-line--xl { width: 50%; margin-bottom: var(--sp-sm); }
.skeleton-stat .skeleton-line { width: 70%; margin-bottom: 0; }

/* Skeleton pipeline columns */
.skeleton-kanban {
  display: flex;
  gap: var(--sp-md);
  overflow: hidden;
}
.skeleton-kanban-col {
  flex: 1;
  min-width: 0;
}
.skeleton-kanban-col .skeleton-line--lg { margin-bottom: var(--sp-md); width: 60%; }

/* Skeleton chat list */
.skeleton-chat-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-md);
  padding: var(--sp-md) var(--sp-lg);
  border-bottom: 1px solid var(--glass-border);
}
.skeleton-chat-item .skeleton-chat-lines { flex: 1; }

/* Skeleton calendar grid */
.skeleton-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.skeleton-cal-cell {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
}

/* Skeleton detail page */
.skeleton-detail-header {
  display: flex;
  gap: var(--sp-md);
  align-items: center;
  margin-bottom: var(--sp-xl);
}

/* Mobile: 2-col stats */
@media (max-width: 599px) {
  .skeleton-stats { grid-template-columns: repeat(2, 1fr); }
  .skeleton-kanban { flex-direction: column; }
}

/* ── Global Search Categories ──────────────────────────────────── */
.search-category-header {
  padding: var(--sp-xs) var(--sp-sm);
  font-size: 0.6875rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-secondary);
  border-top: 1px solid var(--glass-border);
}
.search-category-header:first-child { border-top: none; }
.header-search-result.selected { background: var(--glass-bg-hover); }

/* ── @-Mentions ────────────────────────────────────────────────── */
.mention {
  background: var(--accent-soft); padding: 1px 4px;
  border-radius: 3px; font-weight: 600;
}
/* Links in comments and chat (renderMentionsHTML): underlined in the
   accent, and allowed to break anywhere so a long one can't widen a bubble. */
.msg-link {
  color: var(--accent); text-decoration: underline;
  text-underline-offset: 2px; overflow-wrap: anywhere;
}
.msg-link:hover { text-decoration-thickness: 2px; }
/* On a solid-accent bubble (your own sidebar chat lines) the accent vanishes. */
.sidebar-chat-bubble--own .msg-link { color: inherit; }

/* ── Report Charts ─────────────────────────────────────────────── */
.report-chart {
  display: flex; gap: var(--sp-xs); align-items: flex-end;
  min-height: 200px; padding: var(--sp-md) 0;
}
.report-bar-group {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; flex: 1; min-width: 30px;
}
.report-bar {
  width: 100%; max-width: 40px; border-radius: 4px 4px 0 0;
  min-height: 4px; transition: height 0.3s;
}
.report-bar-label { white-space: nowrap; }
.report-bar-value { font-weight: 600; }
.report-chart--horizontal { flex-direction: column; gap: var(--sp-sm); min-height: auto; }
.report-hbar-group { display: flex; align-items: center; gap: var(--sp-sm); }
.report-hbar-label { min-width: 100px; text-align: right; }
.report-hbar { height: 28px; border-radius: 4px; display: flex; align-items: center; min-width: 4px; transition: width 0.3s; }

/* ── Checklist Drag ────────────────────────────────────────────── */
.checklist-item--dragging { opacity: 0.5; transform: scale(0.98); }
.checklist-item--dragover { border-top: 2px solid var(--accent); }

/* ── Pipeline DnD Polish ──────────────────────────────────────── */
.kanban-column--drop-target { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.kanban-card--dragging { opacity: 0.6; transform: scale(0.95); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }

/* ── Deadline Urgency Glow ─────────────────────────────────────── */
.card--urgency-green  { box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.45), 0 0 12px -2px rgba(74, 222, 128, 0.35); }
.card--urgency-yellow { box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.55), 0 0 12px -2px rgba(250, 204, 21, 0.45); }
.card--urgency-red    { box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.65),  0 0 14px -2px rgba(239, 68, 68, 0.55); }

/* ── Sunday / Service Air-Date Highlight ───────────────────────────
   Marks videos that play on a Sunday (WOV + any Sunday play_date).
   Uses a solid left bar (border, not shadow) + faint tint + a banner
   strip so it reads from across the board yet coexists with the
   deadline-urgency glow, which lives entirely on box-shadow. */
.card--sunday {
  border-left: 3px solid var(--sunday-accent);
  background: color-mix(in srgb, var(--sunday-accent) 9%, var(--glass-bg));
}
.card--sunday:hover {
  background: color-mix(in srgb, var(--sunday-accent) 14%, var(--glass-bg));
}
.card-sunday-banner {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: var(--sp-xs);
  padding: 3px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--sunday-accent) 22%, transparent);
  color: var(--sunday-accent-text);
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}
.card-sunday-banner svg {
  flex-shrink: 0;
  color: var(--sunday-accent);
}

/* ── Recording Indicator: viewport edge glow + floating pill ───── */
.recording-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  box-shadow:
    inset 0 0 0 2px rgba(228, 62, 62, 0.85),
    inset 0 0 32px 4px rgba(228, 62, 62, 0.45);
  animation: recording-glow-pulse 2s ease-in-out infinite;
}
@keyframes recording-glow-pulse {
  0%, 100% {
    box-shadow:
      inset 0 0 0 2px rgba(228, 62, 62, 0.75),
      inset 0 0 24px 2px rgba(228, 62, 62, 0.35);
  }
  50% {
    box-shadow:
      inset 0 0 0 2px rgba(228, 62, 62, 0.95),
      inset 0 0 40px 6px rgba(228, 62, 62, 0.55);
  }
}
.recording-pill {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  right: calc(env(safe-area-inset-right, 0px) + 12px);
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 12px;
  background: rgba(228, 62, 62, 0.95);
  color: #fff;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  max-width: calc(100vw - 24px);
}
/* On iOS, push the pill below the Dynamic Island region */
html.is-ios .recording-pill {
  top: calc(env(safe-area-inset-top, 0px) + 38px);
}
.recording-pill-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.recording-pill-time {
  font-family: var(--font-mono, monospace);
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}
.recording-pill-stop {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.recording-pill-stop:hover,
.recording-pill-stop:active {
  background: rgba(255, 255, 255, 0.3);
}
/* Narrow phones: hide the title, keep dot + time + Stop */
@media (max-width: 380px) {
  .recording-pill-title { display: none; }
}

/* ── Grid Cards ─────────────────────────────────────────────────── */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* ── Meeting Grid Cards ─────────────────────────────────────────── */
.meeting-grid-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  min-height: 130px;
}
.meeting-grid-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.meeting-grid-card--active {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 1px var(--accent);
}

/* ── Offline Banner ─────────────────────────────────────────────── */
.offline-data-banner {
  padding: var(--sp-xs) var(--sp-md); text-align: center;
  font-size: 0.75rem; background: rgba(196,62,62,0.15);
  color: var(--text-secondary);
}

/* ── Display utilities ──────────────────────────────────────────────
   x-show toggles an element by writing and then REMOVING an inline
   `display:none`. Anything else that lived in that same inline style
   attribute goes with it, so an `x-show` row declared as
   style="display:flex" collapses to a block the first time it is hidden
   and shown again. Layout for an x-show element belongs in a class.

   Deliberately NOT !important: x-show has to be able to hide these with
   its inline display:none. (2026-09-13 audit) */
.d-flex        { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-grid        { display: grid; }
.d-inline-grid { display: inline-grid; }
.d-block       { display: block; }
.d-inline-block{ display: inline-block; }

/* ── Native date & time pickers ──────────────────────────────────
   Every <input type="date|time|datetime-local"> in the app, whatever
   class it carries, gets one treatment:
   - a real field: left-aligned value in the UI font (iOS centres the
     value in a bare grey pill, and unclassed inputs inherit the serif)
   - an icon that says what it opens (calendar / clock), themed with
     light-dark() so it reads on every theme's color-scheme
   - a placeholder when empty — iOS renders an empty picker as a blank
     box; app.js toggles .has-value so the ::before text can show
   - it never overflows its row (min-width:0 in flex/grid), and on
     Chrome/Edge the whole field opens the picker, not just the icon.
   Scoped to the app shell / any modal so these (0,2,1) rules beat the
   class-group shorthands (.modal-card .input, .slot-row .input) that
   would otherwise reset the icon padding and background. Sizes and
   density still come from the field's own class. */
:is(.app-shell, .modal-overlay) input:is([type="date"], [type="time"], [type="datetime-local"]) {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  text-align: left;
  line-height: 1.35;
  padding-right: 2.25rem;
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem 1rem;
  cursor: pointer;
}
/* "12:30 PM" plus the icon — never let a row squeeze a time field below this */
:is(.app-shell, .modal-overlay) input[type="time"] { min-width: 8.5rem; }

/* Icons: muted dark stroke on light schemes, muted light stroke on dark. */
:is(.app-shell, .modal-overlay) input:is([type="date"], [type="datetime-local"]) { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23909aa6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E"); }
:is(.app-shell, .modal-overlay) input[type="time"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23909aa6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
@supports (color: light-dark(#000, #fff)) {
  :is(.app-shell, .modal-overlay) input:is([type="date"], [type="datetime-local"]) {
    background-image: light-dark(url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%235d6673' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23a9b2bd' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E"));
  }
  :is(.app-shell, .modal-overlay) input[type="time"] {
    background-image: light-dark(url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%235d6673' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23a9b2bd' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"));
  }
}

/* Chrome / Edge: stretch the (hidden) native indicator over the whole
   field so a click anywhere opens the picker. */
:is(.app-shell, .modal-overlay) input:is([type="date"], [type="time"], [type="datetime-local"])::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

/* iOS Safari: the value is a centred pill by default; keep it left and
   give an empty field a line of height. */
:is(.app-shell, .modal-overlay) input:is([type="date"], [type="time"], [type="datetime-local"])::-webkit-date-and-time-value {
  text-align: left;
  min-height: 1.35em;
  margin: 0;
}

/* iOS / iPadOS only: an empty picker is a blank box there, so paint a
   placeholder (Chrome and desktop Safari show their own mm/dd/yyyy).
   A placeholder attribute wins; otherwise a sensible default per type. */
@supports (-webkit-touch-callout: none) {
  :is(.app-shell, .modal-overlay) input:is([type="date"], [type="time"], [type="datetime-local"]):not(.has-value)::before {
    content: attr(placeholder);
    color: var(--text-muted);
    white-space: nowrap;
    pointer-events: none;
  }
  :is(.app-shell, .modal-overlay) input[type="date"]:not(.has-value):not([placeholder])::before { content: "Pick a date"; }
  :is(.app-shell, .modal-overlay) input[type="time"]:not(.has-value):not([placeholder])::before { content: "Pick a time"; }
  :is(.app-shell, .modal-overlay) input[type="datetime-local"]:not(.has-value):not([placeholder])::before { content: "Pick date & time"; }
}
