/* ============================================================
   Recorded calls — styled with the Genesys Cloud Design System.
   Tokens live in genesys-tokens.css.
   ============================================================ */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-body);
  background: var(--surface-subtle);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

.material-symbols-rounded {
  font-size: 20px;
  line-height: 1;
  vertical-align: middle;
  flex: none;
}

/* ---------- Buttons ---------- */
.btn-primary,
.btn-secondary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--text-body-sm);
  font-weight: var(--weight-medium);
  line-height: 1;
  padding: 9px 18px;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard),
    transform var(--duration-fast) var(--ease-standard);
}
.btn-primary {
  background: var(--color-primary);
  color: var(--text-on-primary);
  border-color: var(--color-primary);
  box-shadow: 0 1px 2px rgba(255, 79, 31, 0.3);
}
.btn-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }
.btn-primary:active { background: var(--color-primary-active); transform: scale(0.98); }

.btn-secondary {
  background: var(--white);
  color: var(--text-strong);
  border-color: var(--border-strong);
}
.btn-secondary:hover:not(:disabled) { background: var(--gray-50); border-color: var(--gray-400); }
.btn-secondary:active:not(:disabled) { background: var(--gray-100); transform: scale(0.98); }

.btn-ghost { background: transparent; color: var(--text-body); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-ghost:active { background: var(--gray-200); }

.btn-icon { padding: 0; width: 40px; min-height: 40px; }
.btn-sm { padding: 7px 12px; min-height: 32px; font-size: var(--text-caption); }
.btn-sm .material-symbols-rounded { font-size: 18px; }
.btn-lg { padding: 13px 24px; min-height: 48px; font-size: var(--text-body); }

.btn-secondary:disabled {
  background: var(--gray-50);
  color: var(--text-muted);
  border-color: var(--border-default);
  cursor: not-allowed;
}

.btn-link {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-sans);
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
  color: var(--text-link);
  cursor: pointer;
}
.btn-link:hover { text-decoration: underline; color: var(--blue-700); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  height: 60px;
  padding: 0 var(--space-6);
  background: var(--white);
  border-bottom: 1px solid var(--border-default);
}
.brand { display: inline-flex; align-items: center; gap: var(--space-3); text-decoration: none; }
.brand-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-snug);
  color: var(--text-strong);
}
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: var(--space-4); }
.identity { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.3; }
.identity #userLabel { font-size: var(--text-caption); font-weight: var(--weight-semibold); color: var(--text-strong); }
.identity .org { font-size: var(--text-micro); color: var(--text-secondary); }
.identity .org:empty { display: none; }

/* ---------- Page ---------- */
.page { width: 100%; padding: var(--space-6); }

/* ---------- Login gate ---------- */
.login-gate {
  max-width: 420px;
  margin: 56px auto;
  padding: var(--space-8);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.login-mark { margin-bottom: var(--space-4); }
.login-gate h2 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-snug);
  color: var(--text-strong);
}
.login-gate p { margin: 0 0 var(--space-6); color: var(--text-secondary); font-size: var(--text-body-sm); }
.login-form { display: flex; flex-direction: column; gap: var(--space-2); text-align: left; }
.login-form .field { font-size: var(--text-caption); font-weight: var(--weight-semibold); color: var(--text-strong); }
.login-form select {
  font-family: var(--font-sans);
  font-size: var(--text-body-sm);
  color: var(--text-body);
  padding: 9px 12px;
  min-height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--white);
  margin-bottom: var(--space-4);
}
.login-form select:focus-visible { outline: none; border-color: var(--blue-500); box-shadow: var(--focus-ring); }
.login-form .btn-primary { width: 100%; }

/* ---------- Toolbar / filters ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: var(--space-6); align-items: flex-start; margin-bottom: var(--space-5); }
.day-nav { display: flex; align-items: center; gap: var(--space-2); }

input[type="date"] {
  font-family: var(--font-sans);
  font-size: var(--text-body-sm);
  color: var(--text-body);
  padding: 8px 12px;
  min-height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--white);
}
input[type="date"]:focus-visible { outline: none; border-color: var(--blue-500); box-shadow: var(--focus-ring); }

.filters { display: flex; flex-direction: column; min-width: 320px; max-width: 460px; }
.filter-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-2); }
.filter-head label { font-size: var(--text-caption); font-weight: var(--weight-semibold); color: var(--text-strong); }

.queue-field {
  background: var(--white);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  transition: border-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}
.queue-field:focus-within { border-color: var(--blue-500); box-shadow: var(--focus-ring); }

.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chips:not(:empty) { margin-bottom: var(--space-2); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--orange-50);
  color: var(--orange-800);
  border: 1px solid var(--orange-200);
  border-radius: var(--radius-sm);
  padding: 3px 6px 3px 10px;
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
}
.chip-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--orange-700);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard);
}
.chip-x:hover { background: var(--orange-100); }

.combo { position: relative; }
.combo-icon { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
#queueInput {
  width: 100%;
  border: none;
  outline: none;
  padding: 6px 6px 6px 34px;
  font-family: var(--font-sans);
  font-size: var(--text-body-sm);
  color: var(--text-body);
  background: transparent;
}
#queueInput::placeholder { color: var(--text-muted); }

.suggest {
  position: absolute;
  z-index: 1000;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: var(--space-1);
  list-style: none;
  background: var(--white);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  max-height: 240px;
  overflow-y: auto;
}
.suggest-item { padding: 8px 10px; border-radius: var(--radius-sm); font-size: var(--text-body-sm); color: var(--text-body); cursor: pointer; }
.suggest-item:hover, .suggest-item.active { background: var(--orange-50); color: var(--orange-800); }
.suggest-empty { padding: 8px 10px; font-size: var(--text-caption); color: var(--text-muted); }

.muted { color: var(--text-secondary); font-size: var(--text-caption); display: block; margin-top: var(--space-2); }

.recorded-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
  font-size: var(--text-caption);
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.recorded-toggle input { accent-color: var(--orange-500); cursor: pointer; }

.rec-badge {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-caption);
  font-weight: 600;
  color: var(--green-600);
  white-space: nowrap;
}
.rec-badge.rec-no { color: var(--text-muted); font-weight: 400; }

/* ---------- Status / alerts ---------- */
.status { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-4) 0; color: var(--text-secondary); font-size: var(--text-body-sm); }
.loader {
  width: 22px; height: 22px;
  border: 3px solid var(--gray-200); border-top-color: var(--color-primary);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.alert { margin: var(--space-4) 0; padding: 12px 14px; border-radius: var(--radius-md); font-size: var(--text-caption); border: 1px solid transparent; }
.alert-danger { background: var(--color-danger-subtle); color: var(--red-600); border-color: rgba(224, 43, 39, 0.25); }

/* ---------- Results / table ---------- */
.summary { color: var(--text-secondary); font-size: var(--text-caption); margin-bottom: var(--space-3); }

.card { background: var(--surface-card); border: 1px solid var(--border-default); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.table-card { overflow: hidden; }
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-family: var(--font-sans); }
thead th {
  text-align: left;
  background: var(--gray-50);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
}
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border-subtle); color: var(--text-body); font-size: var(--text-body-sm); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--gray-50); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.summary-cell { min-width: 260px; max-width: 420px; color: var(--text-body); font-size: var(--text-caption); line-height: 1.45; white-space: normal; }
.summary-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 10;
  line-clamp: 10;
  overflow: hidden;
}
.summary-text.expanded {
  display: block;
  -webkit-line-clamp: none;
  line-clamp: none;
  overflow: visible;
}
.summary-toggle { margin-top: var(--space-2); }

.pager { display: flex; align-items: center; justify-content: center; gap: var(--space-4); padding: 14px 16px; border-top: 1px solid var(--border-subtle); }
.pager #pageInfo { color: var(--text-secondary); font-size: var(--text-caption); }

/* ---------- A11y / motion ---------- */
:focus-visible { outline: none; }
.btn-primary:focus-visible, .btn-secondary:focus-visible, .btn-ghost:focus-visible,
.btn-link:focus-visible, .chip-x:focus-visible, #queueInput:focus-visible { box-shadow: var(--focus-ring); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
