/* -----------------------------------------------------------------------
   Sirpi Meeting Portal — Slate Blue & White theme
----------------------------------------------------------------------- */

:root {
  --slate-50: #f5f7fb;
  --slate-100: #eaeef7;
  --slate-200: #d7deed;
  --slate-300: #b6c1dc;
  --slate-400: #8b9ac2;
  --slate-500: #5b6ea3;
  --slate-600: #45527f;
  --slate-700: #333c60;
  --slate-800: #232a44;
  --slate-900: #171b2e;

  --accent: #5b6ee1;
  --accent-dark: #4854c4;
  --accent-light: #eef0fd;

  --success: #1f9d6b;
  --success-bg: #e7f8f1;
  --error: #d64545;
  --error-bg: #fdecec;

  --white: #ffffff;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(23, 27, 46, 0.06);
  --shadow-md: 0 8px 24px rgba(23, 27, 46, 0.08);
  --shadow-lg: 0 20px 48px rgba(23, 27, 46, 0.14);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: var(--slate-50);
  color: var(--slate-800);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--slate-900);
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

/* ---------------------------------------------------------------------
   Shared elements
--------------------------------------------------------------------- */

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: var(--white);
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 14.5px;
  color: var(--slate-800);
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input::placeholder {
  color: var(--slate-400);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

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

.btn-primary {
  background: var(--accent);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--slate-600);
  border: 1px solid var(--slate-200);
}

.btn-ghost:hover {
  background: var(--slate-100);
  color: var(--slate-800);
}

.btn-block {
  width: 100%;
}

.btn.is-loading .btn-label::after {
  content: '…';
}

.btn-spinner {
  width: 16px;
  height: 16px;
  display: none;
  flex-shrink: 0;
}

.btn.is-loading .btn-spinner {
  display: inline-block;
  animation: spin 0.8s linear infinite;
}

/* ---------------------------------------------------------------------
   Navbar
--------------------------------------------------------------------- */

.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--slate-200);
  position: sticky;
  top: 0;
  z-index: 20;
}

.navbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--slate-900);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.navbar-user {
  font-size: 13.5px;
  color: var(--slate-500);
  font-weight: 500;
}

/* ---------------------------------------------------------------------
   Page layout
--------------------------------------------------------------------- */

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card-heading h2 {
  font-size: 18px;
}

.card-subtitle {
  color: var(--slate-500);
  font-size: 14px;
  margin-top: 4px;
}

/* ---------------------------------------------------------------------
   Section 1: Live bot card
--------------------------------------------------------------------- */

.live-card {
  background: linear-gradient(145deg, var(--white) 60%, var(--accent-light));
}

.live-form {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.live-form .input {
  flex: 1;
}

@media (max-width: 560px) {
  .live-form {
    flex-direction: column;
  }
}

.live-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
}

.live-status-icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.live-status-icon svg {
  width: 100%;
  height: 100%;
}

.live-status.is-processing {
  background: var(--slate-100);
  color: var(--slate-600);
}

.live-status.is-processing .live-status-icon svg {
  animation: spin 0.8s linear infinite;
}

.live-status.is-success {
  background: var(--success-bg);
  color: var(--success);
}

.live-status.is-error {
  background: var(--error-bg);
  color: var(--error);
}

/* ---------------------------------------------------------------------
   Section 1b: Live Now
--------------------------------------------------------------------- */

.live-now-card {
  border-color: var(--slate-200);
}

.live-meetings-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.live-meeting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: var(--slate-50);
}

.live-meeting-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.live-meeting-title {
  font-size: 14px;
  font-weight: 650;
  color: var(--slate-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-meeting-state {
  font-size: 12.5px;
  color: var(--slate-500);
  margin-top: 2px;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  animation: pulse-dot 1.6s ease-in-out infinite;
}

.live-meeting-item.is-paused .live-dot {
  background: var(--slate-400);
  animation: none;
}

@keyframes pulse-dot {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(31, 157, 107, 0.35);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(31, 157, 107, 0);
  }
}

.live-meeting-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.live-meeting-action {
  flex-shrink: 0;
  padding: 8px 16px;
  font-size: 13px;
}

.live-meeting-open {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--slate-500);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.live-meeting-open:hover {
  color: var(--accent-dark);
}

.live-meeting-open svg {
  width: 13px;
  height: 13px;
}

/* ---------------------------------------------------------------------
   Section 2: Meeting feed
--------------------------------------------------------------------- */

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

.feed-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-input {
  max-width: 280px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--slate-200);
  background: var(--white);
  color: var(--slate-500);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover:not(:disabled) {
  background: var(--slate-100);
  color: var(--accent-dark);
  border-color: var(--slate-300);
}

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

.icon-refresh {
  width: 18px;
  height: 18px;
}

.icon-btn.is-loading .icon-refresh {
  animation: spin 0.8s linear infinite;
}

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

.feed-status {
  color: var(--slate-500);
  font-size: 14.5px;
  padding: 40px 0;
  text-align: center;
}

.feed-status-error {
  color: var(--error);
}

.meetings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.meeting-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.meeting-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--slate-300);
}

.meeting-card-header {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 18px 20px 6px;
  cursor: pointer;
  font-family: inherit;
}

.meeting-card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.meeting-title {
  font-size: 15.5px;
  font-weight: 650;
  line-height: 1.35;
}

.chevron {
  color: var(--slate-400);
  font-size: 20px;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.meeting-card.is-expanded .chevron {
  transform: rotate(90deg);
}

.meeting-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--slate-500);
  font-size: 13px;
}

.meta-dot {
  color: var(--slate-300);
}

.meeting-audio {
  padding: 10px 20px 16px;
}

.meeting-audio audio {
  width: 100%;
  height: 34px;
}

.no-audio {
  color: var(--slate-400);
  font-size: 13px;
  font-style: italic;
}

.meeting-details {
  border-top: 1px solid var(--slate-100);
  padding: 16px 20px 20px;
  background: var(--slate-50);
}

.tabs {
  display: flex;
  gap: 4px;
  background: var(--slate-100);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 14px;
}

.tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-500);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab-btn.is-active {
  background: var(--white);
  color: var(--accent-dark);
  box-shadow: var(--shadow-sm);
}

.tab-panel {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--slate-700);
}

.overview-text {
  white-space: pre-line;
}

.action-items-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.keywords-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-chip {
  background: var(--accent-light);
  color: var(--accent-dark);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
}

.empty-item {
  color: var(--slate-400);
  font-style: italic;
}

.transcript-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.transcript-link:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------------------------
   Transcript detail page
--------------------------------------------------------------------- */

.transcript-page {
  gap: 20px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--slate-500);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  width: fit-content;
}

.back-link:hover {
  color: var(--accent-dark);
}

.back-link svg {
  width: 16px;
  height: 16px;
}

.transcript-header-card .transcript-title {
  font-size: 22px;
  margin-bottom: 8px;
}

.transcript-header-card .meeting-audio {
  padding: 16px 0 0;
}

.transcript-log {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 4px;
  margin-top: 6px;
}

.transcript-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.transcript-speaker {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.transcript-line {
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-size: 14px;
  line-height: 1.6;
  color: var(--slate-700);
}

.transcript-time {
  flex-shrink: 0;
  width: 42px;
  color: var(--slate-400);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.transcript-text {
  flex: 1;
}

/* ---------------------------------------------------------------------
   Toasts
--------------------------------------------------------------------- */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
}

.toast {
  min-width: 240px;
  max-width: 360px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #c6ecdb;
}

.toast-error {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid #f5cccc;
}

/* ---------------------------------------------------------------------
   Auth pages (login)
--------------------------------------------------------------------- */

.auth-body {
  background: linear-gradient(160deg, var(--slate-900), var(--slate-700) 60%, var(--accent-dark));
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px;
  width: 100%;
  max-width: 380px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.auth-brand-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--slate-900);
}

.auth-brand-sub {
  font-size: 12.5px;
  color: var(--slate-500);
}

.auth-title {
  font-size: 22px;
  margin-bottom: 6px;
}

.auth-subtitle {
  color: var(--slate-500);
  font-size: 14px;
  margin-bottom: 24px;
  line-height: 1.5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-600);
}

.auth-error {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid #f5cccc;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
}

.auth-footnote {
  color: var(--slate-300);
  font-size: 12.5px;
}

/* ---------------------------------------------------------------------
   Responsive
--------------------------------------------------------------------- */

@media (max-width: 640px) {
  .navbar-user {
    display: none;
  }
  .page {
    padding: 24px 16px 60px;
  }
  .feed-header {
    align-items: stretch;
  }
  .search-input {
    max-width: none;
  }
  .live-meeting-item {
    flex-wrap: wrap;
  }
  .live-meeting-actions {
    width: 100%;
    justify-content: space-between;
  }
}
