body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 24px;
  background: #0b1220;
  color: #e8eefc;
}


.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
  flex-wrap: wrap;
}

.topbar h1 {
  margin: 0;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.topbar-user {
  color: #a5bfff;
  font-weight: 600;
  white-space: nowrap;
}

.topbar .link {
  color: #a5bfff;
  text-decoration: none;
}

.topbar .link:hover,
.topbar .link.is-active {
  text-decoration: underline;
}

.box {
  background: #121a2b;
  border: 1px solid #26324d;
  border-radius: 14px;
  padding: 16px;
  max-width: 900px;
  margin-bottom: 16px;
}

.box-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.box-header h2 {
  margin: 0;
}

.box-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.box-header-action {
  margin-left: auto;
}

.box-header-actions .box-header-action {
  margin-left: 0;
}

.box-header-message {
  color: #9aacd1;
  font-size: 0.9rem;
  min-height: 1.2em;
}

.box.recordings-box {
  max-width: 1400px;
}

@media (max-width: 768px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-actions {
    margin-left: 0;
  }
}

.hidden {
  display: none !important;
}

label {
  display: block;
  margin-top: 8px;
}

input,
textarea,
select {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #3a4970;
  background: #0f1626;
  color: #e8eefc;
}

input[type="checkbox"] {
  width: auto;
  height: auto;
  margin: 0;
}

label.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

button {
  padding: 8px 12px;
  border-radius: 9px;
  border: 1px solid #3a4970;
  background: #17223a;
  color: #e8eefc;
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-inline {
  padding: 4px 8px;
  font-size: 0.85rem;
}

.recordings-table .btn-inline {
  padding: 3px 6px;
  font-size: 0.8rem;
}

.btn-danger {
  background: #b5403c;
  border-color: #b5403c;
  color: #fff;
}

.btn-danger:hover {
  background: #c7504b;
  border-color: #c7504b;
}

.recording-summary {
  max-width: 340px;
  white-space: pre-wrap;
  word-break: break-word;
}

.recording-summary-missing {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.box ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.box ul li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #1f2b44;
  border-radius: 10px;
  transition: background 0.2s ease;
}

.box ul li:hover {
  background: #17233d;
}

.box ul li:last-child {
  border-bottom: none;
}

.participant-item {
  cursor: pointer;
}

.participant-item.selected {
  background: #1b2a47;
}

.participant-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.participant-list-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.participant-import {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 260px;
  align-items: flex-end;
}

.participant-import-input {
  display: none;
}

.participant-import-drop {
  width: 100%;
  min-height: 120px;
  border: 2px dashed #405a91;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  color: #c3cdef;
  background: rgba(15, 24, 46, 0.6);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.participant-import-drop:hover,
.participant-import-drop:focus {
  border-color: #6c8ee6;
  background: rgba(20, 32, 60, 0.8);
  outline: none;
}

.participant-import-drop.is-dragover {
  border-color: #9bb7ff;
  background: rgba(35, 52, 89, 0.9);
}

.participant-import-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  width: 100%;
}

.participant-import-status {
  width: 100%;
  font-size: 0.85rem;
  min-height: 1.2em;
  text-align: right;
}

.participant-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.participant-filter-label {
  font-size: 0.9rem;
  color: #c3cdef;
}

.participant-filter-input {
  min-width: 200px;
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #2c3f66;
  background: #0f182e;
  color: #e4ecff;
}

.participant-filter-input:focus {
  outline: none;
  border-color: #6c8ee6;
  box-shadow: 0 0 0 1px rgba(108, 142, 230, 0.25);
}

.participant-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.participant-name {
  font-weight: 600;
  flex: 0 0 auto;
  white-space: nowrap;
}

.participant-email,
.participant-meta,
.participant-notes {
  font-size: 0.85rem;
  color: #9aacd1;
}

.participant-meta {
  flex: 0 0 auto;
  white-space: nowrap;
}

.participant-group {
  background: rgba(82, 115, 179, 0.25);
  border: 1px solid rgba(82, 115, 179, 0.6);
  border-radius: 999px;
  padding: 2px 10px;
  color: #c7d5ff;
}

.participant-email {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.participant-notes {
  white-space: pre-wrap;
}

.participant-url {
  flex-basis: 100%;
  font-size: 0.85rem;
  color: #7fb0ff;
  text-decoration: underline;
  overflow-wrap: anywhere;
}

.campaign-item {
  cursor: pointer;
}

.campaign-item.selected {
  background: #1b2a47;
}

.campaign-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.campaign-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
  font-size: 1rem;
}

.campaign-title-text {
  flex: 1;
  min-width: 0;
}

.campaign-recording-count {
  font-size: 0.85rem;
  font-weight: 500;
  color: #9aacd1;
  white-space: nowrap;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.15s ease-in-out;
}

.campaign-recording-count:focus,
.campaign-recording-count:hover {
  color: #c3d5ff;
}

.campaign-meta {
  font-size: 0.85rem;
  color: #9aacd1;
}

.campaign-desc {
  font-size: 0.85rem;
  color: #c3cdef;
}

.campaign-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}

.editor-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.editor-section {
  flex: 1;
}

.editor-section h3 {
  margin: 0;
}

.editor-desc {
  font-size: 0.9rem;
  color: #b9c5e5;
  margin: 4px 0 12px;
}

.editor-actions {
  margin-top: 12px;
}

.editor-status {
  margin-top: 8px;
  font-size: 0.9rem;
  color: #9aacd1;
  min-height: 1.2em;
}

.editor-status.is-error {
  color: #ffb8c2;
}

.editor-status.is-success {
  color: #bff5c8;
}

.hearing-image-field {
  margin-top: 12px;
}

.hearing-image-preview {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.hearing-image-preview img {
  max-width: 320px;
  border-radius: 12px;
  border: 1px solid #26324d;
  background: #0b1220;
}

.hearing-image-actions {
  display: flex;
  gap: 8px;
}

.form-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
}

.form-section {
  flex: 1 1 260px;
  min-width: 240px;
  padding: 12px;
  border-radius: 12px;
  background: #0f1626;
  border: 1px solid #1d2942;
}

.form-section h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

.admin-users {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-user-card {
  border: 1px solid #233356;
  border-radius: 10px;
  padding: 12px;
  background: #121d33;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-user-card h4 {
  margin: 0;
  font-size: 1rem;
}

.admin-user-meta {
  font-size: 0.85rem;
  color: #8094c6;
}

.admin-user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 12px;
}

.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-user-actions button {
  flex: 0 0 auto;
}

.admin-user-status {
  flex: 1 1 auto;
  min-width: 180px;
  font-size: 0.9rem;
  color: #9aacd1;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.danger-zone {
  border-top: 1px solid #26324d;
  margin-top: 16px;
  padding-top: 12px;
}

.danger-zone h3 {
  margin: 0 0 8px;
}

.danger-zone-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.danger-zone .editor-status {
  color: #f2a5a2;
  margin-top: 0;
  min-height: 1.2em;
}

.organization-table-wrapper {
  margin-top: 12px;
  overflow-x: auto;
}

.organization-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.organization-table th,
.organization-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #1f2b44;
  text-align: left;
  font-size: 0.95rem;
  white-space: nowrap;
}

.organization-table th {
  background: #18253f;
  font-weight: 600;
  color: #d6e0f7;
}

.organization-table tbody tr:nth-child(even) {
  background: rgba(15, 22, 38, 0.7);
}

.organization-table tbody tr:hover {
  background: rgba(32, 48, 79, 0.7);
}

.organization-table tbody tr {
  cursor: pointer;
}

.organization-table tbody tr.selected {
  background: #1b2a47;
}

.notice {
  padding: 12px;
  border-radius: 10px;
  background: #18253f;
  color: #c0cee9;
}

.participant-linker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.participant-linker-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.participant-linker-actions button {
  flex: 1 1 auto;
  white-space: nowrap;
}

.participant-linker button {
  align-self: flex-start;
}

.participant-selector { 
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}


.participant-filter {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  width: 100%;
}

.participant-filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 0;
}

.participant-filter-field.is-full {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .participant-filter {
    grid-template-columns: 1fr;
  }
}

.participant-filter-field-label {
  font-size: 0.8rem;
  color: #94a3c7;
}

.participant-selector-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: #d5def5;
}

.participant-selector-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px solid #1f2b44;
  border-radius: 10px;
  background: #0f1626;
  max-height: 280px;
  overflow-y: auto;
}

.participant-selector-empty {
  color: #94a3c7;
  font-size: 0.9rem;
  padding: 4px;
}

.participant-selector-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.participant-selector-item:hover {
  background: rgba(52, 85, 141, 0.25);
}

.participant-selector-item.is-linked {
  opacity: 0.6;
  cursor: not-allowed;
}

.participant-selector-item.is-linked:hover {
  background: transparent;
}

.participant-selector-item input[type='checkbox'] {
  margin-top: 3px;
}

.participant-selector-text {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  min-width: 0;
}

.participant-selector-name {
  font-weight: 500;
  color: #e5ecff;
  flex: 0 0 auto;
  white-space: nowrap;
}

.participant-selector-email {
  font-size: 0.85rem;
  color: #94a3c7;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.participant-selector-group {
  font-size: 0.8rem;
  color: #c7d5ff;
  background: rgba(82, 115, 179, 0.25);
  border: 1px solid rgba(82, 115, 179, 0.6);
  border-radius: 999px;
  padding: 2px 10px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.participant-selector-status {
  margin-left: auto;
  font-size: 0.75rem;
  color: #9bb2dd;
  padding-top: 2px;
}

.participant-list {
  margin-top: 12px;
}

.participant-table-wrapper {
  overflow-x: auto;
  border: 1px solid #1f2b44;
  border-radius: 10px;
  background: #0f1626;
}

.participant-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.participant-table thead {
  background: #1b2a45;
}

.participant-table th,
.participant-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #1f2b44;
  text-align: left;
  vertical-align: top;
}

.participant-table th {
  font-weight: 600;
  font-size: 0.9rem;
  color: #b9c5e5;
  white-space: nowrap;
}

.participant-table tbody tr {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.participant-table tbody tr:hover {
  background: rgba(52, 85, 141, 0.25);
}

.participant-table tbody tr.selected {
  background: rgba(77, 118, 196, 0.35);
}

.participant-table td {
  font-size: 0.95rem;
  color: #d6def3;
  word-break: break-word;
}

.participant-table td.col-id {
  font-variant-numeric: tabular-nums;
}

.participant-table td.col-note {
  white-space: pre-wrap;
}

.participant-table td.col-actions {
  text-align: right;
}

.participant-table .col-id {
  width: 60px;
}

.participant-table .col-email {
  width: 220px;
}

.participant-table .col-group {
  width: 160px;
}

.participant-table .col-phone {
  width: 140px;
}

.participant-table .col-note {
  width: 200px;
}

.participant-table .col-actions {
  width: 100px;
}

.email-status-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.email-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #1c2742;
  color: #d5e1ff;
}

.email-status-badge.is-queued {
  background: #2a3456;
  color: #dbe1ff;
}

.email-status-badge.is-running {
  background: #344262;
  color: #dbe1ff;
}

.email-status-badge.is-sent {
  background: #1f4b33;
  color: #bff5c8;
}

.email-status-badge.is-error {
  background: #5a2630;
  color: #ffd7e0;
}

.email-status-time {
  font-size: 0.78rem;
  color: #9aacd1;
}

.email-status-error {
  font-size: 0.78rem;
  color: #ffb8c2;
  word-break: break-word;
}

.participant-empty {
  padding: 16px;
  color: #9aacd1;
  text-align: center;
}

.participant-pagination {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.participant-pagination-info {
  color: #9aacd1;
  font-size: 0.95rem;
}

code {
  background: #0f1626;
  padding: 2px 6px;
  border-radius: 6px;
}

.recordings-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  justify-content: space-between;
}

.recordings-actions-left,
.recordings-actions-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.recordings-actions-right {
  margin-left: auto;
}

.recordings-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.recordings-filter label {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.recordings-filter input[type='text'] {
  width: auto;
  min-width: 200px;
  padding: 6px 8px;
}

.recordings-container {
  overflow-x: auto;
}

.recordings-pagination {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.recordings-pagination .pagination-info {
  color: #9aacd1;
  font-size: 0.95rem;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination-page-info {
  color: #e8eefc;
  font-size: 0.95rem;
}

.pagination-size-control {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #e8eefc;
}

.pagination-size-control select {
  background: #0f1626;
  color: #e8eefc;
  border: 1px solid #1f2b44;
  border-radius: 6px;
  padding: 4px 8px;
}

.recordings-layout {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.recordings-list {
  flex: 1 1 60%;
  min-width: 0;
}

.recordings-table { 
  width: 100%;
  border-collapse: collapse;
  min-width: 580px;
  table-layout: auto;
}

.recordings-table tbody tr {
  cursor: pointer;
  transition: background 0.2s ease;
}

.recordings-table th,
.recordings-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #1f2b44;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
  font-size: 0.9rem;
}

.recordings-table .col-campaign,
.recordings-table .col-group,
.recordings-table .col-participant,
.recordings-table .col-user,
.recordings-table .col-date {
  max-width: 90px;
  min-width: 60px;
}

.recordings-table .col-date {
  min-width: 80px;
}

.recordings-table .col-size {
  min-width: 60px;
  max-width: 80px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.recordings-table .col-size.is-small {
  color: #ffb8c2;
  background: rgba(181, 64, 60, 0.25);
  font-weight: 600;
}

.recordings-table .col-campaign,
.recordings-table .col-date {
  white-space: normal;
  word-break: break-word;
  overflow: visible;
  text-overflow: clip;
}

.recordings-table .col-group,
.recordings-table .col-participant,
.recordings-table .col-user {
  white-space: normal;
  word-break: break-word;
  overflow: visible;
  text-overflow: clip;
}

.recordings-table th {
  background: #101a30;
  font-weight: 600;
}

.recordings-table tbody tr:hover {
  background: #17233d;
}

.recordings-table tbody tr.is-selected {
  background: #1b2a47;
}

.recordings-table tbody tr.is-selected:hover {
  background: #1e3053;
}

.recordings-table td.actions-cell {
  width: auto;
  min-width: 280px;
  text-align: center;
  white-space: nowrap;
}

.recording-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.transcription-panel {
  flex: 1 1 20%;
  min-width: 200px;
  background: #101a30;
  border: 1px solid #1f2b44;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.transcription-status {
  color: #9aacd1;
  font-size: 0.9rem;
  margin: 0;
}

@keyframes transcription-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

.transcription-status.is-transcribing {
  color: #ffd48b;
  font-weight: 600;
  animation: transcription-blink 1.1s ease-in-out infinite;
}

.transcription-meta {
  color: #9aacd1;
  font-size: 0.85rem;
  white-space: pre-wrap;
}

.transcription-output {
  background: #0f1626;
  border: 1px solid #1f2b44;
  border-radius: 10px;
  padding: 12px;
  color: #e8eefc;
  white-space: pre-wrap;
  word-break: break-word;
  flex: 1 1 auto;
  overflow-y: auto;
  font-size: 0.95rem;
}

.summary-panel {
  flex: 1 1 20%;
  min-width: 200px;
  background: #101a30;
  border: 1px solid #1f2b44;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-status {
  color: #9aacd1;
  font-size: 0.9rem;
  margin: 0;
}

.summary-status.is-summarizing {
  color: #ffd48b;
  font-weight: 600;
  animation: transcription-blink 1.1s ease-in-out infinite;
}

.summary-meta {
  color: #9aacd1;
  font-size: 0.85rem;
  white-space: pre-wrap;
}

.summary-output {
  background: #0f1626;
  border: 1px solid #1f2b44;
  border-radius: 10px;
  padding: 12px;
  color: #e8eefc;
  white-space: pre-wrap;
  word-break: break-word;
  flex: 1 1 auto;
  overflow-y: auto;
  font-size: 0.95rem;
}

.recording-summary {
  white-space: pre-line;
}

.notice.error {
  background: #3a1120;
  color: #f7a6b5;
}

.dashboard-table-wrapper {
  overflow-x: auto;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.dashboard-table th,
.dashboard-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #1f2b44;
  text-align: left;
  white-space: nowrap;
}

.dashboard-table th:last-child,
.dashboard-table td:last-child {
  text-align: right;
}

.dashboard-table tbody tr:hover {
  background: #17233d;
}

.dashboard-meta {
  margin-top: 8px;
  color: #a5bfff;
  font-size: 0.9rem;
}

.admin-detail-list {
  display: grid;
  gap: 12px;
}

@media (min-width: 900px) {
  .admin-detail-list {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }
}

.admin-detail-card {
  background: #0f1626;
  border: 1px solid #1f2b44;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-detail-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-detail-header h3 {
  margin: 0;
}

.admin-detail-meta {
  color: #a5bfff;
  font-size: 0.9rem;
}

.admin-detail-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-detail-table th,
.admin-detail-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #1f2b44;
  text-align: left;
}

.admin-detail-table th:last-child,
.admin-detail-table td:last-child {
  text-align: right;
}

.admin-detail-table tbody tr:hover {
  background: #17233d;
}

button.is-playing {
  background: #29406d;
}

@media (max-width: 1024px) {
  .recordings-layout {
    flex-direction: column;
  }

  .transcription-panel {
    min-width: 0;
  }

  .summary-panel {
    min-width: 0;
  }
}

.summary-prompts-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0;
}

.prompt-list-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0;
}

.prompt-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #1f2b44;
  border-radius: 10px;
  overflow: hidden;
  background: #0f1626;
}

.prompt-table thead {
  background: #1b2a45;
}

.prompt-table th,
.prompt-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #1f2b44;
  text-align: left;
  font-size: 0.95rem;
  color: #d6def3;
  vertical-align: top;
}

.prompt-table th {
  font-weight: 600;
  color: #b9c5e5;
}

.prompt-table .col-id {
  width: 80px;
  font-variant-numeric: tabular-nums;
}

.prompt-table .col-actions {
  width: 120px;
  text-align: right;
  white-space: nowrap;
}

.prompt-table .col-actions button + button {
  margin-left: 6px;
}

.prompt-table tbody tr {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.prompt-table tbody tr:hover {
  background: rgba(52, 85, 141, 0.25);
}

.prompt-table tbody tr.is-selected {
  background: rgba(77, 118, 196, 0.35);
}

.prompt-table td.empty {
  text-align: center;
  color: #9aacd1;
}

.summary-prompt-table {
  margin-bottom: 12px;
}

.summary-prompt-table th:last-child,
.summary-prompt-table td:last-child {
  white-space: nowrap;
}

@media (min-width: 900px) {
  .editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  .editor-section.participant-section {
    grid-column: 1 / -1;
  }
}

@media (min-width: 640px) {
  .participant-linker {
    flex-direction: row;
    align-items: stretch;
  }
  .participant-selector {
    flex: 1;
  }
  .participant-linker-actions {
    flex-direction: column;
    flex-wrap: nowrap;
    min-width: 220px;
  }
  .participant-linker-actions button {
    flex: 0 0 auto;
    width: 100%;
  }
}

@media (min-width: 720px) {
  .participant-item {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
  .participant-controls {
    justify-content: flex-end;
    min-width: 200px;
  }
}

/* Turn Detection Fieldset */
.turn-detection-fieldset {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #26324d;
  border-radius: 10px;
  background: #0f1626;
}

.turn-detection-fieldset legend {
  font-weight: 600;
  color: #d6e0f7;
  padding: 0 8px;
}

.turn-detection-fieldset label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 12px;
}

.turn-detection-fieldset label:first-of-type {
  margin-top: 8px;
}

.field-help {
  font-size: 0.85rem;
  color: #9aacd1;
  margin: 4px 0 8px;
}

.field-hint {
  font-size: 0.8rem;
  color: #7a8db5;
  line-height: 1.5;
  margin-top: 4px;
}

.field-hint strong {
  color: #a5bfff;
  font-weight: 600;
}

.turn-detection-fieldset input[type="number"],
.turn-detection-fieldset select {
  margin-top: 4px;
}

.turn-detection-fieldset input[type="number"] {
  max-width: 180px;
}

/* Analysis Page Styles */
.analysis-box {
  max-width: 1400px;
}

.analysis-layout {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.analysis-data-section {
  flex: 1 1 55%;
  min-width: 300px;
}

.analysis-settings-section {
  flex: 1 1 40%;
  min-width: 280px;
}

.analysis-filters {
  background: #0f1626;
  border: 1px solid #1f2b44;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.filter-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.filter-row:last-child {
  margin-bottom: 0;
}

.filter-field {
  flex: 1 1 160px;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 0;
}

.filter-label {
  font-size: 0.85rem;
  color: #94a3c7;
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.data-selection {
  background: #0f1626;
  border: 1px solid #1f2b44;
  border-radius: 10px;
  padding: 16px;
}

.selection-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.selection-count {
  color: #c3cdef;
  font-size: 0.95rem;
}

.recordings-select-list {
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recording-select-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #121a2b;
  border: 1px solid #26324d;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.recording-select-item:hover {
  background: #17233d;
  border-color: #3a4970;
}

.recording-select-item.selected {
  background: rgba(77, 118, 196, 0.25);
  border-color: #4d76c4;
}

.recording-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  flex: 1;
  min-width: 0;
}

.recording-name {
  font-weight: 600;
  color: #e5ecff;
}

.recording-email,
.recording-campaign,
.recording-date {
  font-size: 0.85rem;
  color: #94a3c7;
}

.recording-group {
  font-size: 0.8rem;
  color: #c7d5ff;
  background: rgba(82, 115, 179, 0.25);
  border: 1px solid rgba(82, 115, 179, 0.6);
  border-radius: 999px;
  padding: 2px 10px;
}

.prompt-selection {
  margin-bottom: 16px;
}

.prompt-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.custom-prompt-area {
  margin-bottom: 16px;
}

.output-settings {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.analysis-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.btn-primary {
  background: #3b5998;
  border-color: #3b5998;
  color: #fff;
  font-weight: 600;
  padding: 10px 20px;
}

.btn-primary:hover {
  background: #4c6baa;
  border-color: #4c6baa;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.analysis-result-box {
  max-width: 1400px;
}

.analysis-result-content {
  background: #0f1626;
  border: 1px solid #1f2b44;
  border-radius: 10px;
  padding: 16px;
  max-height: 500px;
  overflow: auto;
}

.analysis-result-content pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.9rem;
  color: #e8eefc;
}

.analysis-result-content .text-content {
  line-height: 1.6;
  color: #e8eefc;
}

.saved-results-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.saved-results-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.saved-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #0f1626;
  border: 1px solid #1f2b44;
  border-radius: 10px;
}

.result-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result-name {
  font-weight: 600;
  color: #e5ecff;
}

.result-meta {
  font-size: 0.85rem;
  color: #94a3c7;
}

.result-actions {
  display: flex;
  gap: 8px;
}

.empty-message {
  color: #94a3c7;
  font-size: 0.95rem;
  padding: 12px;
  text-align: center;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #121a2b;
  border: 1px solid #26324d;
  border-radius: 14px;
  padding: 24px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content.modal-large {
  max-width: 900px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-header h3 {
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: #94a3c7;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
}

.modal-close:hover {
  color: #e8eefc;
}

.modal-body {
  margin-bottom: 16px;
}

.modal-body label {
  display: block;
  margin-bottom: 12px;
}

.modal-footer {
  display: flex;
  align-items: center;
  gap: 12px;
}

@media (max-width: 900px) {
  .analysis-layout {
    flex-direction: column;
  }
  
  .analysis-data-section,
  .analysis-settings-section {
    flex: 1 1 100%;
  }
}

/* Date Picker Styles */
.date-picker-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.date-picker-input {
  cursor: pointer;
  background: #0f1626 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%2394a3c7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>') no-repeat right 10px center;
  padding-right: 36px;
}

.date-picker-input:hover {
  border-color: #4d76c4;
}

.date-picker-hidden {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  width: 24px;
  height: 24px;
  cursor: pointer;
  padding: 0;
}

.date-picker-hidden::-webkit-calendar-picker-indicator {
  width: 100%;
  height: 100%;
  cursor: pointer;
  opacity: 0;
}

/* HTML Preview Styles */
.html-preview {
  padding: 16px;
  background: #fff;
  border-radius: 8px;
  color: #333;
  line-height: 1.6;
}

.html-preview h1,
.html-preview h2,
.html-preview h3,
.html-preview h4,
.html-preview h5,
.html-preview h6 {
  color: #1a1a2e;
  margin-top: 1em;
  margin-bottom: 0.5em;
}

.html-preview h1 {
  font-size: 1.75rem;
  border-bottom: 2px solid #3b5998;
  padding-bottom: 8px;
}

.html-preview h2 {
  font-size: 1.5rem;
  border-bottom: 1px solid #ddd;
  padding-bottom: 6px;
}

.html-preview h3 {
  font-size: 1.25rem;
}

.html-preview p {
  margin: 0.75em 0;
}

.html-preview ul,
.html-preview ol {
  margin: 0.75em 0;
  padding-left: 24px;
}

.html-preview li {
  margin: 0.5em 0;
}

.html-preview table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
}

.html-preview th,
.html-preview td {
  border: 1px solid #ddd;
  padding: 10px 12px;
  text-align: left;
}

.html-preview th {
  background: #f5f5f5;
  font-weight: 600;
}

.html-preview tr:nth-child(even) {
  background: #fafafa;
}

.html-preview blockquote {
  margin: 1em 0;
  padding: 12px 16px;
  border-left: 4px solid #3b5998;
  background: #f5f7fa;
  color: #555;
}

.html-preview code {
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.9em;
}

.html-preview pre {
  background: #2d2d2d;
  color: #f8f8f2;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
}

.html-preview pre code {
  background: transparent;
  padding: 0;
}

.html-preview strong {
  font-weight: 600;
}

.html-preview em {
  font-style: italic;
}
