/* ==========================================================================
   GUNERY × GRUPO MÉDICO — COMPONENTS STYLESHEET
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. APP HEADER & COMMAND BAR
   -------------------------------------------------------------------------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-xs);
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.header-inner {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-partnership {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo-gm {
  height: 38px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.05));
}

.brand-divider {
  width: 1px;
  height: 28px;
  background: var(--border-medium);
}

.brand-logo-gg {
  height: 30px;
  width: auto;
  object-fit: contain;
}

[data-theme="dark"] .brand-logo-gg {
  filter: brightness(1.2) contrast(1.1);
}

.brand-title-wrap {
  display: flex;
  flex-direction: column;
}

.brand-main-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-sub-title {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.header-center-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 0.5rem;
}

.header-center-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.header-center-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.15rem;
}

@media (max-width: 900px) {
  .header-center-info {
    display: none; /* Keep clean on smaller mobile screens */
  }
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Role Selector Badge */
.role-pill-selector {
  display: flex;
  align-items: center;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  padding: 0.2rem 0.3rem 0.2rem 0.6rem;
  gap: 0.4rem;
  font-size: 0.8rem;
}

.role-pill-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  display: none;
}

@media (min-width: 768px) {
  .role-pill-label {
    display: inline;
  }
}

.role-select-btn {
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.role-select-btn:hover {
  background: var(--bg-surface-hover);
}

/* Lang Toggle Button */
.lang-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
  background: var(--bg-surface);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.lang-toggle-btn:hover {
  background: var(--bg-surface-hover);
}

.lang-opt {
  opacity: 0.45;
}

.lang-opt.active {
  opacity: 1;
  color: var(--gm-teal);
}

/* --------------------------------------------------------------------------
   2. "WHAT'S NEXT" PULSE & ACTION BAR
   -------------------------------------------------------------------------- */
.pulse-section {
  margin: 2.5rem 0 1.5rem 0;
}

.pulse-card {
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-surface-subtle) 100%);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
}

.pulse-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gm-teal);
}

.pulse-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.pulse-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.pulse-indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--gm-teal);
  box-shadow: 0 0 0 3px var(--gm-teal-light);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(8, 145, 178, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(8, 145, 178, 0); }
  100% { box-shadow: 0 0 0 0 rgba(8, 145, 178, 0); }
}

.pulse-title {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.countdown-box {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.countdown-unit {
  display: flex;
  align-items: baseline;
  gap: 0.15rem;
}

.countdown-num {
  font-size: 1.1rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--gm-teal-dark);
}

[data-theme="dark"] .countdown-num {
  color: var(--gm-teal);
}

.countdown-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.countdown-sep {
  color: var(--text-muted);
  font-weight: bold;
}

.pulse-integrated-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
  align-items: stretch;
}

@media (min-width: 960px) {
  .pulse-integrated-grid {
    grid-template-columns: 360px 1fr;
  }
}

/* Standout Next Shoot Spotlight Card */
.next-shoot-card {
  background: linear-gradient(145deg, var(--bg-surface) 0%, var(--bg-surface-subtle) 100%);
  border: 1px solid var(--border-medium);
  border-left: 4px solid var(--gm-teal);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.next-shoot-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--gm-teal);
}

.next-shoot-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.next-shoot-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gm-teal-dark);
  background: var(--gm-teal-light);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

[data-theme="dark"] .next-shoot-badge {
  background: rgba(8, 145, 178, 0.2);
  color: var(--gm-teal);
}

.next-shoot-time-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.next-shoot-date-row {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.next-shoot-date-main {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.next-shoot-sep {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.next-shoot-category {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gm-teal);
}

.next-shoot-video-topic {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}

.video-pill-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 850;
  color: #ffffff;
  background: var(--gm-teal-dark);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
}

[data-theme="dark"] .video-pill-num {
  background: var(--gm-teal);
  color: #0f172a;
}

.video-pill-title {
  font-size: 0.95rem;
  font-weight: 750;
  color: var(--text-primary);
  line-height: 1.35;
}

.next-shoot-location {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px dashed var(--border-subtle);
}

.loc-icon {
  font-size: 0.85rem;
}

.integrated-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 600px) {
  .integrated-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1100px) {
  .integrated-stats-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.integrated-stats-grid .stat-card {
  height: 100%;
  justify-content: center;
  margin-bottom: 0;
}

.pulse-col {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pulse-col-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pulse-col-content {
  font-size: 0.875rem;
  color: var(--text-primary);
  line-height: 1.45;
}

.pulse-highlight-video {
  font-weight: 700;
  color: var(--gm-teal-dark);
}

[data-theme="dark"] .pulse-highlight-video {
  color: var(--gm-teal);
}

.todo-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.todo-item {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  line-height: 1.35;
}

.todo-bullet {
  color: var(--gm-teal);
  font-weight: bold;
}

/* --------------------------------------------------------------------------
   3. STATS & METRICS ROW
   -------------------------------------------------------------------------- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .stats-row {
    grid-template-columns: repeat(5, 1fr);
  }
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: var(--shadow-xs);
  transition: transform var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   4. NAVIGATION & VIEW SWITCHER TABS
   -------------------------------------------------------------------------- */
.views-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.nav-tabs-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  max-width: 100%;
  padding: 0.25rem 0;
}

.view-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.15rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.view-tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.view-tab-btn:active {
  transform: translateY(0);
}

.view-tab-btn.active {
  background: var(--text-primary);
  color: var(--bg-surface);
  border-color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

[data-theme="dark"] .view-tab-btn.active {
  background: var(--gm-teal);
  color: #090d16;
  border-color: var(--gm-teal);
  box-shadow: 0 4px 14px rgba(8, 145, 178, 0.35);
}

/* Search & Filters Bar */
.filter-search-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-grow: 1;
  max-width: 450px;
}

.search-input-wrap {
  position: relative;
  flex-grow: 1;
}

.search-input {
  width: 100%;
  padding: 0.55rem 0.85rem 0.55rem 2.2rem;
  font-size: 0.85rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--gm-teal);
  box-shadow: 0 0 0 3px var(--gm-teal-light);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

.category-select {
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   5. KANBAN PIPELINE VIEW
   -------------------------------------------------------------------------- */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.25rem;
  overflow-x: auto;
  padding-bottom: 1rem;
}

@media (min-width: 900px) {
  .kanban-board {
    grid-template-columns: repeat(4, minmax(260px, 1fr));
  }
}

.kanban-col {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  min-height: 480px;
  max-height: calc(100vh - 260px);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.kanban-col.drag-over {
  background: var(--gm-teal-light);
  border: 2px dashed var(--gm-teal);
  transform: scale(1.01);
}

[data-theme="dark"] .kanban-col.drag-over {
  background: rgba(8, 145, 178, 0.15);
  border-color: var(--gm-teal);
}

.kanban-col-header {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
}

.kanban-col-header:hover {
  background: var(--bg-surface-hover);
}

.kanban-col-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.col-stage-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
}

.dot-blue { background: var(--color-script); }
.dot-amber { background: var(--color-shoot); }
.dot-purple { background: var(--color-edit); }
.dot-cyan { background: var(--color-review); }
.dot-emerald { background: var(--color-publish); }

.kanban-col-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.kanban-col-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.kanban-col-count {
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  background: var(--bg-surface-subtle);
  color: var(--text-muted);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.col-accordion-chevron {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: transform var(--transition-normal);
  display: inline-block;
}

.kanban-col.is-collapsed {
  min-height: auto;
}

.kanban-col.is-collapsed .kanban-col-header {
  border-bottom: none;
}

.kanban-col.is-collapsed .col-accordion-chevron {
  transform: rotate(-90deg);
}

.kanban-col.is-collapsed .kanban-col-cards {
  display: none;
}

.kanban-col-cards {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  overflow-y: auto;
  flex-grow: 1;
  transition: all var(--transition-normal);
}

/* Video Card */
.video-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  cursor: grab;
  transition: all var(--transition-fast);
  position: relative;
  user-select: none;
}

.video-card:active {
  cursor: grabbing;
}

.video-card.dragging {
  opacity: 0.45;
  transform: scale(0.96) rotate(1deg);
  border: 2px dashed var(--gm-teal);
  box-shadow: var(--shadow-lg);
}

.video-card:hover {
  transform: translateY(-2px);
  border-color: var(--gm-teal);
  box-shadow: var(--shadow-md);
}

.video-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.video-card-num {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-surface-subtle);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.video-card-category {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--gm-teal);
  text-transform: uppercase;
}

.video-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
}

.video-card-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.video-card-meta-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.meta-icon {
  font-size: 0.8rem;
  opacity: 0.75;
}

.video-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.75rem;
}

.takes-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--color-edit-bg);
  color: var(--color-edit);
  font-weight: 600;
  font-size: 0.7rem;
}

.comments-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.75rem;
}

/* Stage changer inside card */
.stage-quick-select {
  font-size: 0.7rem;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-subtle);
  color: var(--text-primary);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   6. TIMELINE / GANTT ROADMAP VIEW
   -------------------------------------------------------------------------- */
.timeline-view-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.timeline-header {
  margin-bottom: 1.5rem;
}

.timeline-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.timeline-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.timeline-track-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.timeline-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.timeline-row:hover {
  background: var(--bg-surface-subtle);
}

.timeline-video-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.timeline-video-num {
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--gm-teal);
}

.timeline-video-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.timeline-bar-container {
  position: relative;
  height: 42px;
  background: var(--bg-surface-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.timeline-progress-bar {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  box-shadow: var(--shadow-xs);
  transition: width 0.4s ease;
}

.bar-shoot {
  background: var(--color-shoot);
}

.bar-edit {
  background: var(--color-edit);
}

.bar-publish {
  background: var(--color-publish);
}

/* --------------------------------------------------------------------------
   7. CALENDAR GRID VIEW
   -------------------------------------------------------------------------- */
.calendar-view-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.calendar-legend-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  font-weight: 600;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.calendar-events-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .calendar-events-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .calendar-events-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.shoot-day-card {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.shoot-day-card.active-day {
  border-color: var(--gm-teal);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.shoot-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.shoot-day-date {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}

.shoot-day-videos-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.calendar-video-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.calendar-video-item:hover {
  border-color: var(--gm-teal);
}

.calendar-video-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
}

.calendar-video-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   8. SCRIPT DRAWER & TELEPROMPTER MODAL
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(9, 13, 22, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 960px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: translateY(20px) scale(0.98);
  transition: transform var(--transition-normal);
}

.modal-overlay.open .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 1.25rem 1.5rem 0.85rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-surface);
}

.modal-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
  min-width: 0;
}

.modal-tag-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
  word-break: break-word;
}

.modal-close-btn {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
}

.modal-close-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

/* Modern Segmented Pill Modal Tab Bar */
.modal-tabs-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  margin: 0.85rem 1.5rem 0.25rem 1.5rem;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.modal-tabs-nav::-webkit-scrollbar {
  display: none;
}

.modal-tab-btn {
  padding: 0.55rem 1rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.modal-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .modal-tab-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

.modal-tab-btn.active {
  color: #ffffff;
  background: var(--gm-teal);
  box-shadow: 0 2px 8px rgba(8, 145, 178, 0.35);
}

.modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex-grow: 1;
}

/* Script Tab Content */
.script-table-wrap {
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 1rem;
}

.script-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.script-table th {
  background: var(--bg-surface-subtle);
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-medium);
}

.script-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-primary);
  vertical-align: top;
}

.script-table tr:last-child td {
  border-bottom: none;
}

.timecode-chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gm-teal-dark);
  background: var(--gm-teal-light);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  white-space: nowrap;
}

[data-theme="dark"] .timecode-chip {
  background: rgba(8, 145, 178, 0.2);
  color: var(--gm-teal);
}

/* Script Approval Gate Card */
.approval-gate-card {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.approval-gate-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.approval-status-text {
  font-size: 0.875rem;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   9. TELEPROMPTER & LIVE AUDIO RECORDER
   -------------------------------------------------------------------------- */
.prompter-studio-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.prompter-toolbar {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.prompter-timer-badge {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.prompter-timer-max {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
}

.prompter-controls-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* Prompter Viewport Window */
.prompter-viewport {
  background: #0f172a;
  color: #f8fafc;
  border-radius: var(--radius-lg);
  padding: 2rem;
  min-height: 380px;
  max-height: 480px;
  overflow-y: auto;
  position: relative;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.5);
  transition: font-size var(--transition-fast);
}

.prompter-viewport.prompter-mirrored {
  transform: scaleX(-1);
}

.prompter-script-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-bottom: 8rem;
}

.prompter-line-item {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border-left: 4px solid transparent;
  transition: all 0.25s ease;
  cursor: pointer;
}

.prompter-line-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.prompter-line-item.active {
  background: rgba(8, 145, 178, 0.25);
  border-left-color: #38bdf8;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
  transform: scale(1.02);
}

.prompter-line-item.past {
  opacity: 0.45;
}

.prompter-time-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 0.35rem;
}

.prompter-text {
  line-height: 1.5;
  font-weight: 500;
}

/* Audio Level Visualizer */
.audio-visualizer-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
}

.visualizer-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

.visualizer-meter-track {
  flex-grow: 1;
  height: 12px;
  background: var(--bg-surface-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.visualizer-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981 0%, #f59e0b 70%, #ef4444 100%);
  border-radius: var(--radius-full);
  transition: width 0.08s ease-out;
}

/* Font Size Stepper */
.font-size-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 0.15rem 0.25rem;
}

.font-size-stepper button {
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
}

/* Compact Top Audio Takes Bar */
.compact-takes-strip {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-left: 3px solid var(--gm-teal);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: var(--shadow-xs);
}

.compact-takes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Recorded Takes Section */
.takes-vault-section {
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.25rem;
  margin-top: 1rem;
}

.takes-vault-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.takes-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.take-item-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.take-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.take-num-badge {
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-mono);
  background: var(--color-edit-bg);
  color: var(--color-edit);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
}

.take-duration {
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.take-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* --------------------------------------------------------------------------
   10. COMMENT THREADS & REPLIES
   -------------------------------------------------------------------------- */
.comments-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.comment-input-box {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.comment-textarea {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.875rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  resize: vertical;
}

.comment-textarea:focus {
  outline: none;
  border-color: var(--gm-teal);
}

.comment-input-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.timecode-input-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.timecode-input {
  width: 70px;
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comment-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  box-shadow: var(--shadow-xs);
}

.comment-card.is-resolved {
  opacity: 0.75;
  background: var(--bg-surface-subtle);
}

.comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
  flex-wrap: wrap;
}

.comment-author-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.comment-role-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
  white-space: nowrap;
}

.comment-timecode-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gm-teal);
}

.comment-date {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.comment-content {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-primary);
}

.comment-actions-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border-subtle);
}

.replies-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
  padding-left: 1rem;
  border-left: 2px solid var(--border-medium);
}

.reply-item {
  background: var(--bg-surface-subtle);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.82rem;
}

.reply-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
}

.author-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-right: 0.3rem;
}

.dot-client { background: #0284c7; }
.dot-agency { background: #0f172a; }
[data-theme="dark"] .dot-agency { background: #cbd5e1; }

.reply-date {
  color: var(--text-muted);
}

.reply-body {
  color: var(--text-primary);
  line-height: 1.4;
}

.reply-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-left: 1rem;
  border-left: 2px solid var(--gm-teal);
}

.reply-input {
  width: 100%;
  padding: 0.5rem;
  font-size: 0.82rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

.reply-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
}

/* --------------------------------------------------------------------------
   11. FOOTER
   -------------------------------------------------------------------------- */
.app-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--border-subtle);
  padding: 2rem 1.25rem;
  background: var(--bg-surface);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

.footer-logos {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
  opacity: 0.8;
}

.footer-logo-gm { height: 26px; }
.footer-logo-gg { height: 16px; }
[data-theme="dark"] .footer-logo-gg { filter: invert(1); }
