.shared-log-page .toolbar,
.shared-log-page .log-toolbar,
.shared-log-page .shared-toolbar {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: none !important;
}

.shared-log-page details {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  border-radius: var(--radius-lg) !important;
}

.shared-log-page summary {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-bottom: 1px solid var(--border);
}

.shared-log-page table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

.shared-log-page table th {
  background: var(--surface-muted) !important;
  color: var(--text) !important;
  border-left: 0 !important;
  border-right: 0 !important;
}

.shared-log-page table td {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-left: 0 !important;
  border-right: 0 !important;
}

.shared-log-page table tr:hover td {
  background: var(--surface-hover) !important;
}

.shared-log-page input,
.shared-log-page select,
.shared-log-page textarea {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

.focus-row,
.shared-log-page tr.focus-row td {
  background: rgba(37, 99, 235, 0.06) !important;
}

html[data-theme="dark"] .focus-row,
html[data-theme="dark"] .shared-log-page tr.focus-row td {
  background: rgba(96, 165, 250, 0.10) !important;
}

/* Type color coding */
.type-select,
.shared-log-page select[name$="_category"] {
  font-weight: 700 !important;
}

.type-program {
  background: #e0ecff !important;
  color: #1d4ed8 !important;
  border-color: #bfdbfe !important;
}

.type-uwr {
  background: #f3e8ff !important;
  color: #6d28d9 !important;
  border-color: #d8b4fe !important;
}

.type-promo {
  background: #fff7ed !important;
  color: #c2410c !important;
  border-color: #fed7aa !important;
}

.type-weather {
  background: #ecfeff !important;
  color: #0e7490 !important;
  border-color: #a5f3fc !important;
}

.type-news {
  background: #eef2ff !important;
  color: #4338ca !important;
  border-color: #c7d2fe !important;
}

.type-filler {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border-color: #cbd5e1 !important;
}

.type-eas {
  background: #fee2e2 !important;
  color: #991b1b !important;
  border-color: #fca5a5 !important;
}

.type-other {
  background: #f8fafc !important;
  color: #334155 !important;
  border-color: #cbd5e1 !important;
}

html[data-theme="dark"] .type-program { background:#1e3a8a !important; color:#bfdbfe !important; }
html[data-theme="dark"] .type-uwr { background:#3b0764 !important; color:#e9d5ff !important; }
html[data-theme="dark"] .type-promo { background:#431407 !important; color:#fed7aa !important; }
html[data-theme="dark"] .type-weather { background:#164e63 !important; color:#a5f3fc !important; }
html[data-theme="dark"] .type-news { background:#312e81 !important; color:#c7d2fe !important; }
html[data-theme="dark"] .type-filler { background:#334155 !important; color:#e2e8f0 !important; }
html[data-theme="dark"] .type-eas { background:#7f1d1d !important; color:#fecaca !important; }
html[data-theme="dark"] .type-other { background:#1e293b !important; color:#cbd5e1 !important; }

/* Force type dropdown colors after global form styles */
.shared-log-page select.type-program,
.shared-log-page select.type-program:focus {
  background-color: #e0ecff !important;
  color: #1d4ed8 !important;
  border-color: #bfdbfe !important;
}

.shared-log-page select.type-uwr,
.shared-log-page select.type-uwr:focus {
  background-color: #f3e8ff !important;
  color: #6d28d9 !important;
  border-color: #d8b4fe !important;
}

.shared-log-page select.type-promo,
.shared-log-page select.type-promo:focus {
  background-color: #fff7ed !important;
  color: #c2410c !important;
  border-color: #fed7aa !important;
}

.shared-log-page select.type-weather,
.shared-log-page select.type-weather:focus {
  background-color: #ecfeff !important;
  color: #0e7490 !important;
  border-color: #a5f3fc !important;
}

.shared-log-page select.type-news,
.shared-log-page select.type-news:focus {
  background-color: #eef2ff !important;
  color: #4338ca !important;
  border-color: #c7d2fe !important;
}

.shared-log-page select.type-filler,
.shared-log-page select.type-filler:focus {
  background-color: #f1f5f9 !important;
  color: #475569 !important;
  border-color: #cbd5e1 !important;
}

.shared-log-page select.type-eas,
.shared-log-page select.type-eas:focus {
  background-color: #fee2e2 !important;
  color: #991b1b !important;
  border-color: #fca5a5 !important;
}

.shared-log-page select.type-other,
.shared-log-page select.type-other:focus {
  background-color: #f8fafc !important;
  color: #334155 !important;
  border-color: #cbd5e1 !important;
}

/* Clean commercial Type badge selector */
.shared-log-page select.type-select,
.shared-log-page select[name$="_category"] {
  background: var(--surface) !important;
  color: var(--text) !important;
  font-weight: 800 !important;
  border: 1px solid var(--border) !important;
  border-left-width: 7px !important;
  border-radius: 10px !important;
  padding: 8px 10px !important;
  min-width: 92px;
}

/* Light/Dark-compatible type accent stripes */
.shared-log-page select.type-program,
.shared-log-page select.type-program:focus {
  border-left-color: #2563eb !important;
}

.shared-log-page select.type-uwr,
.shared-log-page select.type-uwr:focus {
  border-left-color: #7c3aed !important;
}

.shared-log-page select.type-promo,
.shared-log-page select.type-promo:focus {
  border-left-color: #d97706 !important;
}

.shared-log-page select.type-weather,
.shared-log-page select.type-weather:focus {
  border-left-color: #0f766e !important;
}

.shared-log-page select.type-news,
.shared-log-page select.type-news:focus {
  border-left-color: #4338ca !important;
}

.shared-log-page select.type-filler,
.shared-log-page select.type-filler:focus {
  border-left-color: #64748b !important;
}

.shared-log-page select.type-eas,
.shared-log-page select.type-eas:focus {
  border-left-color: #dc2626 !important;
}

.shared-log-page select.type-other,
.shared-log-page select.type-other:focus {
  border-left-color: #94a3b8 !important;
}

/* Prevent old full-background type rules from winning */
.shared-log-page select.type-program,
.shared-log-page select.type-uwr,
.shared-log-page select.type-promo,
.shared-log-page select.type-weather,
.shared-log-page select.type-news,
.shared-log-page select.type-filler,
.shared-log-page select.type-eas,
.shared-log-page select.type-other {
  background-color: var(--surface) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .shared-log-page select.type-program,
html[data-theme="dark"] .shared-log-page select.type-uwr,
html[data-theme="dark"] .shared-log-page select.type-promo,
html[data-theme="dark"] .shared-log-page select.type-weather,
html[data-theme="dark"] .shared-log-page select.type-news,
html[data-theme="dark"] .shared-log-page select.type-filler,
html[data-theme="dark"] .shared-log-page select.type-eas,
html[data-theme="dark"] .shared-log-page select.type-other {
  background-color: var(--surface-muted) !important;
  color: var(--text) !important;
}

/* Shared log: stabilize Last Updated By column */
.shared-log-page table th:last-child,
.shared-log-page table td:last-child {
  width: 140px !important;
  min-width: 140px !important;
  max-width: 140px !important;
  white-space: normal !important;
  color: var(--muted) !important;
  font-size: 13px !important;
}

.shared-log-page table td:last-child {
  vertical-align: top !important;
}

.shared-log-page table th:last-child {
  text-align: left !important;
}

/* Shared Daily Log v2 */
.shared-log-page {
  --shared-sticky-offset: 0px;
}

.shared-log-page .page-header,
.shared-log-page .log-hero,
.shared-log-page .shared-log-header {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 18px !important;
  padding: 22px 24px !important;
  margin-bottom: 18px !important;
}

.shared-log-page .toolbar,
.shared-log-page .log-toolbar,
.shared-log-page .shared-toolbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 40 !important;
  background: color-mix(in srgb, var(--surface) 94%, transparent) !important;
  backdrop-filter: blur(12px);
  border: 1px solid var(--border) !important;
  border-radius: 16px !important;
  padding: 12px !important;
  margin-bottom: 16px !important;
}

.shared-log-page details {
  border: 1px solid var(--border) !important;
  border-radius: 18px !important;
  margin-bottom: 18px !important;
  overflow: visible !important;
  background: var(--surface) !important;
}

.shared-log-page summary {
  position: sticky !important;
  top: 58px !important;
  z-index: 25 !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 14px 18px !important;
  font-size: 15px !important;
  font-weight: 900 !important;
  letter-spacing: -0.02em;
}

.shared-log-page table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  font-size: 14px !important;
}

.shared-log-page thead th {
  position: sticky !important;
  top: 111px !important;
  z-index: 20 !important;
  background: var(--surface-muted) !important;
  color: var(--text) !important;
  border-top: 0 !important;
  border-left: 0 !important;
  border-right: 0 !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 10px 12px !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  letter-spacing: .06em !important;
  white-space: nowrap !important;
}

.shared-log-page tbody td {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-left: 0 !important;
  border-right: 0 !important;
  border-top: 0 !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 9px 12px !important;
  vertical-align: top !important;
}

.shared-log-page tbody tr:hover td {
  background: var(--surface-hover) !important;
}

.shared-log-page tbody tr.row-is-focused td,
.shared-log-page tbody tr:focus-within td {
  background: rgba(37, 99, 235, 0.07) !important;
  box-shadow: inset 3px 0 0 var(--primary);
}

html[data-theme="dark"] .shared-log-page tbody tr.row-is-focused td,
html[data-theme="dark"] .shared-log-page tbody tr:focus-within td {
  background: rgba(96, 165, 250, 0.12) !important;
}

.shared-log-page input,
.shared-log-page select,
.shared-log-page textarea {
  border-radius: 10px !important;
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  font-size: 13px !important;
}

.shared-log-page textarea {
  min-height: 44px !important;
  resize: vertical !important;
  line-height: 1.35 !important;
}

.shared-log-page textarea:focus,
.shared-log-page input:focus,
.shared-log-page select:focus {
  outline: none !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14) !important;
}

.shared-log-page .original-log-textarea {
  min-height: 54px !important;
  font-weight: 650 !important;
}

.shared-log-page .original-log-details-textarea {
  min-height: 42px !important;
  color: var(--muted) !important;
}

.shared-log-page select.type-select,
.shared-log-page select[name$="_category"] {
  min-width: 105px !important;
  font-weight: 900 !important;
  border-left-width: 7px !important;
}

.shared-log-page .status-pill,
.shared-log-page .pill,
.shared-log-page .status-big {
  white-space: nowrap !important;
}

/* Fixed column feel for common narrow columns */
.shared-log-page table th:first-child,
.shared-log-page table td:first-child {
  width: 86px !important;
  min-width: 86px !important;
}

.shared-log-page table th:last-child,
.shared-log-page table td:last-child {
  width: 135px !important;
  min-width: 135px !important;
  max-width: 135px !important;
  color: var(--muted) !important;
  font-size: 12px !important;
}

/* Floating action area if form buttons are near bottom */
.shared-log-page form > .toolbar:last-child,
.shared-log-page form > .action-row:last-child,
.shared-log-page .form-actions,
.shared-log-page .save-actions {
  position: sticky !important;
  bottom: 12px !important;
  z-index: 50 !important;
  background: color-mix(in srgb, var(--surface) 94%, transparent) !important;
  backdrop-filter: blur(12px);
  border: 1px solid var(--border) !important;
  border-radius: 16px !important;
  padding: 12px !important;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .16) !important;
}

html[data-theme="dark"] .shared-log-page form > .toolbar:last-child,
html[data-theme="dark"] .shared-log-page form > .action-row:last-child,
html[data-theme="dark"] .shared-log-page .form-actions,
html[data-theme="dark"] .shared-log-page .save-actions {
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35) !important;
}

/* Compact mode */
.shared-log-page.compact-log tbody td {
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}

.shared-log-page.compact-log textarea {
  min-height: 34px !important;
}

/* Small screen fallback */
@media (max-width: 900px) {
  .shared-log-page thead th {
    top: 0 !important;
  }

  .shared-log-page summary,
  .shared-log-page .toolbar,
  .shared-log-page .log-toolbar,
  .shared-log-page .shared-toolbar {
    position: static !important;
  }
}
