/* ═══════════════════════════════════════════════════════════
   Console Layout — Soniox-style Account Dashboard
   ═══════════════════════════════════════════════════════════ */

/* ─── Layout ─── */
.console-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ─── Sidebar ─── */
.console-sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
}

.sidebar-logo img {
  border-radius: 6px;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 400;
  transition: all 0.15s;
  border-left: 3px solid transparent;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  font-family: inherit;
  text-align: left;
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-item.active {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
  border-left: 3px solid #3b82f6;
  font-weight: 500;
}

.nav-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item.active svg {
  opacity: 1;
  stroke: #3b82f6;
}

.nav-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 8px 18px;
}

.nav-section-label {
  padding: 8px 18px 4px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.project-selector {
  padding: 6px 18px 4px;
  font-size: 0.82rem;
  color: var(--text-primary);
  font-weight: 500;
}

.project-name {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

/* Sidebar footer (user) */
.sidebar-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border-subtle);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #3b82f6;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-user-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-email {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-actions {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.sidebar-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-decoration: none;
  cursor: pointer;
}

.sidebar-action-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

/* ─── Main Content ─── */
.console-main {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-primary);
  padding: 0;
}

.console-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  color: var(--text-secondary);
  gap: 12px;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border-light);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ─── Sections ─── */
.console-section {
  display: none;
  padding: 28px 32px;
  max-width: 960px;
}

.console-section.active {
  display: block;
}

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

.section-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.header-back-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.82rem;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.15s;
}

.header-back-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* ─── Dashboard Cards ─── */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.dash-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.dash-card.plan-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.02));
  border-color: rgba(59, 130, 246, 0.2);
}

.dash-card-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
}

.dash-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.dash-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.dash-value.accent-green {
  color: var(--success);
}

.dash-value.plan-free { color: var(--text-secondary); }
.dash-value.plan-starter { color: #60a5fa; }
.dash-value.plan-pro { color: #a78bfa; }
.dash-value.plan-business { color: #f59e0b; }

.dash-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ─── Dashboard Row ─── */
.dashboard-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ─── Panel ─── */
.panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.panel-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

/* ─── Usage Bars ─── */
.usage-bars {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.usage-bar-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.usage-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.usage-bar-track {
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
}

.usage-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.usage-bar-fill.stt-fill {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.usage-bar-fill.tts-fill {
  background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}

/* ─── Info Rows ─── */
.info-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.info-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.info-value {
  font-size: 0.82rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* ─── Limits ─── */
.limits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.limit-item {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}

.limit-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.limit-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.limit-value.accent-green {
  color: var(--success);
}

/* ─── Badge ─── */
.badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.provider-badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.provider-badge.soniox {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.provider-badge.elevenlabs {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}

.status-badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}

.status-badge.active {
  background: rgba(74, 222, 128, 0.15);
  color: var(--success);
}

.status-badge.inactive {
  background: rgba(248, 113, 113, 0.15);
  color: var(--error);
}

.service-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}

.service-badge.stt {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.service-badge.tts {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}

/* ─── Tables ─── */
.table-wrap {
  overflow-x: auto;
}

.console-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.console-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-subtle);
}

.console-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

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

.console-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.empty-cell {
  text-align: center;
  color: var(--text-muted);
  padding: 24px 12px !important;
}

/* ─── Pagination ─── */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* ─── Settings Forms ─── */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 400px;
}

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

.form-field label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.form-field input {
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-field input:focus {
  border-color: #3b82f6;
}

.form-field input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.appearance-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.appearance-row input[type="color"] {
  width: 42px;
  height: 30px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: transparent;
  padding: 0;
}
}

.form-msg {
  font-size: 0.8rem;
}

.form-msg.success {
  color: var(--success);
}

.form-msg.error {
  color: var(--error);
}

/* ─── Buttons ─── */
.btn-primary {
  padding: 9px 20px;
  background: #3b82f6;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 0.82rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover {
  background: #2563eb;
}

.btn-secondary {
  padding: 6px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

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

/* ─── Usage Filters ─── */
.usage-filters select {
  padding: 6px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.82rem;
  outline: none;
}

/* ─── Nav Group (expandable sub-items) ─── */
.nav-group {
  display: flex;
  flex-direction: column;
}

.nav-parent {
  position: relative;
}

.nav-parent .nav-chevron {
  margin-left: auto;
  opacity: 0.5;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.nav-parent.expanded .nav-chevron {
  transform: rotate(90deg);
}

.nav-sub-items {
  display: none;
  flex-direction: column;
}

.nav-sub-items.open {
  display: flex;
}

.nav-item.nav-sub {
  padding-left: 48px;
  font-size: 0.82rem;
}

.nav-item.nav-sub.active {
  border-left: 3px solid #3b82f6;
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
  font-weight: 500;
}

/* ─── Date Range Picker ─── */
.date-range-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-glass);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 4px 10px;
}

.date-range-picker input[type="date"] {
  background: transparent;
  border: none;
  color: #3b82f6;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  padding: 2px 0;
}

.date-range-picker input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.5;
  cursor: pointer;
  filter: invert(0.5);
}

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

/* ─── Chart Section ─── */
.chart-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 24px 0 12px;
}

.chart-section-title:first-of-type {
  margin-top: 8px;
}

.chart-group {
  display: grid;
  gap: 14px;
  margin-bottom: 8px;
}

.chart-group.chart-row-2 {
  grid-template-columns: 1fr 1fr;
}

.chart-group.chart-row-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.chart-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px;
}

.chart-panel.chart-panel-full {
  grid-column: 1 / -1;
}

.chart-panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.chart-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

.chart-title strong {
  color: var(--text-primary);
  font-weight: 700;
}

.chart-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

.chart-container {
  position: relative;
  height: 180px;
}

.chart-container canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-yaxis-label {
  position: absolute;
  top: 0;
  right: 4px;
  font-size: 0.65rem;
  color: #9ca3af;
  font-weight: 500;
}

/* ─── Mobile ─── */
.mobile-topbar {
  display: none;
}

@media (max-width: 768px) {
  .console-sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s ease;
    box-shadow: none;
  }

  .console-sidebar.open {
    left: 0;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
  }

  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .mobile-menu-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
  }

  .mobile-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
  }

  .mobile-back {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1rem;
    padding: 4px 8px;
  }

  .console-section {
    padding: 16px;
  }

  .dashboard-cards {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-row {
    grid-template-columns: 1fr;
  }

  .chart-group.chart-row-2,
  .chart-group.chart-row-3 {
    grid-template-columns: 1fr;
  }

  .chart-container {
    height: 140px;
  }

  .date-range-picker {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .dashboard-cards {
    grid-template-columns: 1fr;
  }
}

/* ═══════════ Transcribe Section ═══════════ */
.section-desc {
  color: var(--text-secondary, #94a3b8);
  font-size: 0.9rem;
  margin-top: -8px;
}

.transcribe-upload-area {
  border: 2px dashed var(--border, #334155);
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}
.transcribe-upload-area:hover,
.transcribe-upload-area.drag-over {
  border-color: var(--accent, #3b82f6);
  background: rgba(59, 130, 246, 0.05);
}
.transcribe-upload-area p {
  margin: 8px 0 0;
  color: var(--text-secondary, #94a3b8);
}
.upload-link {
  color: var(--accent, #3b82f6);
  cursor: pointer;
  text-decoration: underline;
}
.upload-hint {
  font-size: 0.8rem;
  opacity: 0.6;
}

.transcribe-options {
  margin-top: 16px;
}
.transcribe-file-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface, #1e293b);
  border-radius: 8px;
  margin-bottom: 12px;
}
.transcribe-file-preview .file-icon { font-size: 1.3rem; }
.transcribe-file-preview .file-name {
  flex: 1;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.transcribe-file-preview .file-size {
  color: var(--text-secondary, #94a3b8);
  font-size: 0.85rem;
}
.btn-icon {
  background: none;
  border: none;
  color: var(--text-secondary, #94a3b8);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 4px;
}
.btn-icon:hover { background: rgba(255,255,255,0.1); }

.transcribe-form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.transcribe-form-row .form-group {
  flex: 1;
}
.transcribe-form-row label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary, #94a3b8);
  margin-bottom: 4px;
}
.transcribe-form-row select {
  width: 100%;
  padding: 8px 12px;
  background: var(--surface, #1e293b);
  border: 1px solid var(--border, #334155);
  border-radius: 6px;
  color: var(--text-primary, #e2e8f0);
  font-size: 0.9rem;
}

.panel-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.btn-sm {
  font-size: 0.8rem;
  padding: 4px 10px;
}

.transcribe-result-text {
  background: var(--surface, #1e293b);
  border: 1px solid var(--border, #334155);
  border-radius: 8px;
  padding: 16px;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.6;
  max-height: 400px;
  overflow-y: auto;
  color: var(--text-primary, #e2e8f0);
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 500;
}
.status-pending   { background: #f59e0b22; color: #f59e0b; }
.status-processing{ background: #3b82f622; color: #3b82f6; }
.status-completed { background: #22c55e22; color: #22c55e; }
.status-failed    { background: #ef444422; color: #ef4444; }

/* Transcribe action buttons */
.tj-actions { display: flex; gap: 4px; }
.tj-actions button {
  background: none;
  border: 1px solid var(--border, #334155);
  color: var(--text-secondary, #94a3b8);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.78rem;
  cursor: pointer;
}
.tj-actions button:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary, #e2e8f0);
}

@media (max-width: 640px) {
  .transcribe-form-row { flex-direction: column; }
}

.file-name-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ═══ Dashboard info cards row ═══ */
.dashboard-info-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.info-card-highlight {
  position: relative;
  border: 1.5px solid rgba(16, 185, 129, 0.55);
  background:
    radial-gradient(circle at 0% 0%, rgba(34,197,94,0.18), transparent 55%),
    linear-gradient(135deg, rgba(16,185,129,0.14), rgba(34,197,94,0.06) 60%, rgba(59,130,246,0.05));
  box-shadow:
    0 0 0 1px rgba(16, 185, 129, 0.15),
    0 8px 24px -6px rgba(16, 185, 129, 0.35),
    0 2px 8px -2px rgba(34, 197, 94, 0.20);
  overflow: hidden;
}
.info-card-highlight::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(135deg, #10b981, #22c55e 45%, #3b82f6);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0.85;
  pointer-events: none;
}
.info-card-highlight::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -30%;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(34,197,94,0.35), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
  animation: glowPulse 4s ease-in-out infinite;
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.15); }
}
.info-card-highlight:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(16, 185, 129, 0.25),
    0 14px 32px -8px rgba(16, 185, 129, 0.45),
    0 4px 12px -2px rgba(34, 197, 94, 0.30);
}
.info-card-highlight .info-card-label {
  color: rgba(16, 185, 129, 0.95);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.74rem;
}

/* ─── Language-aware currency emphasis (inside highlight cards) ───
   The PRIMARY currency for the active language gets the big gradient
   treatment; the OTHER currency shrinks to a muted line. */

/* Shared "big primary number" style — applied to whichever <span> is primary */
.info-card-highlight .info-card-big-value[id$="-usd"],
.info-card-highlight .info-card-big-value[id$="-vnd"],
.info-card-highlight .info-card-sub-value[id$="-usd"],
.info-card-highlight .info-card-sub-value[id$="-vnd"] {
  /* reset so language rules can take over deterministically */
  -webkit-text-fill-color: initial;
}

/* VI: VND big & gradient, USD small & muted */
body.lang-vi .info-card-highlight [id$="-vnd"] {
  font-size: 2.2rem !important;
  font-weight: 800 !important;
  background: linear-gradient(135deg, #10b981, #22c55e 55%, #34d399);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 24px rgba(34, 197, 94, 0.20);
  letter-spacing: -0.02em;
  line-height: 1.1;
  order: -1;
}
body.lang-vi .info-card-highlight [id$="-usd"] {
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  color: rgba(16, 185, 129, 0.7) !important;
  -webkit-text-fill-color: rgba(16, 185, 129, 0.7);
  order: 1;
}

/* EN: USD big & gradient, VND small & muted */
body.lang-en .info-card-highlight [id$="-usd"] {
  font-size: 2.2rem !important;
  font-weight: 800 !important;
  background: linear-gradient(135deg, #10b981, #22c55e 55%, #34d399);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 24px rgba(34, 197, 94, 0.20);
  letter-spacing: -0.02em;
  line-height: 1.1;
  order: -1;
}
body.lang-en .info-card-highlight [id$="-vnd"] {
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  color: rgba(16, 185, 129, 0.7) !important;
  -webkit-text-fill-color: rgba(16, 185, 129, 0.7);
  order: 1;
}
.info-card-label {
  font-size: 0.82rem;
  color: var(--text2);
  margin-bottom: 8px;
  font-weight: 500;
}
.info-card-value-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.info-card-big-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
}
.info-card-sub-value {
  font-size: 0.9rem;
  color: var(--text2);
}
.info-card-detail {
  font-size: 0.85rem;
  color: var(--text2);
  margin-top: 4px;
}
.info-card-body {
  margin-top: 8px;
}
.info-card-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(148,163,184,0.1);
}
.info-card-row:last-child { border-bottom: none; }
.info-card-key { color: var(--text2); }

/* ═══ Payment methods grid ═══ */
.payment-methods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.pm-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  transition: border-color 0.2s;
}
.pm-card:hover { border-color: var(--accent, #4f46e5); }
.pm-card-icon { font-size: 1.5rem; flex-shrink: 0; }
.pm-card-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}
.pm-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.pm-card-info strong { font-size: 0.9rem; }
.pm-card-detail { font-size: 0.78rem; color: var(--text2); }
.pm-card-status {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text2);
}

/* ═══ Payment tab button ═══ */
.pm-tab-btn {
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 8px 16px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}
.pm-tab-btn:hover { border-color: var(--accent, #4f46e5); }
.pm-tab-btn.active {
  background: var(--accent, #4f46e5);
  color: #fff;
  border-color: var(--accent, #4f46e5);
}

@media (max-width: 640px) {
  .dashboard-info-row { grid-template-columns: 1fr; }
  .payment-methods-grid { grid-template-columns: 1fr; }
}

/* ═══ Sidebar language switcher ═══ */
.sidebar-lang-switcher {
  display: flex;
  gap: 6px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border, #334155);
  margin-bottom: 8px;
}
.lang-btn {
  flex: 1;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border, #334155);
  background: transparent;
  color: var(--text2, #94a3b8);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.lang-btn:hover { border-color: var(--accent, #4f46e5); color: var(--text, #e2e8f0); }
.lang-btn.active {
  background: var(--accent, #4f46e5);
  color: #fff;
  border-color: var(--accent, #4f46e5);
  font-weight: 600;
}

/* ═══ Sidebar theme switcher ═══ */
.sidebar-theme-switcher {
  display: flex;
  gap: 8px;
  padding: 6px 16px;
  align-items: center;
}
.sidebar-theme-switcher::before {
  content: '🎨';
  font-size: 0.8rem;
  margin-right: 2px;
}
.theme-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  padding: 0;
  outline: none;
}
.theme-dot:hover {
  border-color: rgba(255,255,255,0.3);
}
.theme-dot.active {
  border-color: var(--accent, #6366f1);
  box-shadow: 0 0 8px rgba(99,102,241,0.5);
}
.theme-reset-btn {
  margin-left: auto;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border, rgba(255,255,255,0.14));
  background: transparent;
  color: var(--text2, #94a3b8);
  font-size: 0.74rem;
  cursor: pointer;
}
.theme-reset-btn:hover {
  border-color: var(--accent, #6366f1);
  color: var(--text, #e2e8f0);
}

/* ═══ Currency emphasis by language ═══ */
/* Vietnamese: VND is primary (big), USD is secondary */
body.lang-vi .info-card-big-value[id$="-vnd"],
body.lang-vi .info-card-big-value.currency-vnd {
  font-size: 1.6rem;
  font-weight: 700;
  order: -1;
}
body.lang-vi .info-card-big-value[id$="-usd"],
body.lang-vi .info-card-sub-value[id$="-usd"] {
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--text2, #94a3b8);
  order: 1;
}
body.lang-vi .info-card-sub-value[id$="-vnd"] {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text, #e2e8f0);
  order: -1;
}

/* English: USD is primary (big), VND is secondary (default) */
body.lang-en .info-card-big-value[id$="-usd"] {
  font-size: 1.6rem;
  font-weight: 700;
  order: -1;
}
body.lang-en .info-card-sub-value[id$="-vnd"],
body.lang-en .info-card-sub-value.currency-vnd {
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--text2, #94a3b8);
  order: 1;
}
body.lang-en .info-card-sub-value[id$="-usd"] {
  font-size: 0.88rem;
  order: 1;
}

/* ─── Subscription tab balance card — currency primacy follows language ─── */
.sub-balance-panel .info-card-value-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sub-balance-primary,
.sub-balance-secondary {
  display: block;
  text-align: center;
  line-height: 1.15;
}
/* VI: VND big & vivid green, USD small & muted */
body.lang-vi #sub-balance-vnd {
  font-size: 2.2rem; font-weight: 800; color: var(--green, #22c55e); order: -1;
}
body.lang-vi #sub-balance-usd {
  font-size: 0.95rem; font-weight: 500; color: var(--text2, #94a3b8); order: 1;
}
body.lang-vi #sub-topup-vnd {
  font-weight: 700; color: var(--text);
}
body.lang-vi #sub-topup-usd {
  display: none;
}
/* EN: USD big & vivid green, VND small & muted */
body.lang-en #sub-balance-usd {
  font-size: 2.2rem; font-weight: 800; color: var(--green, #22c55e); order: -1;
}
body.lang-en #sub-balance-vnd {
  font-size: 0.95rem; font-weight: 500; color: var(--text2, #94a3b8); order: 1;
}
body.lang-en #sub-topup-usd {
  font-weight: 700; color: var(--text);
}
body.lang-en #sub-topup-vnd {
  display: none;
}

/* ═══════════════════════════════════════════════════════════
   Meetings — Bien ban cuoc hop
   ═══════════════════════════════════════════════════════════ */

/* Full-screen detail overlay */
.meeting-detail-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-body, #f8fafc);
  z-index: 200;
  overflow-y: auto;
  padding: 16px;
}
.meeting-detail-fullscreen {
  max-width: 1280px;
  margin: 0 auto;
  background: var(--bg-primary, #ffffff);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
}
.meeting-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  background: var(--bg-primary, #ffffff);
  z-index: 1;
}
.meeting-detail-header .panel-title {
  font-size: 1.2rem;
  margin: 0;
}

/* Template chooser shown BEFORE generation */
.meeting-template-chooser {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  padding: 14px 16px;
  margin: 12px 0;
  background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(34,197,94,0.04));
  border: 1px solid rgba(99,102,241,0.18);
  border-radius: 10px;
}
.meeting-template-row { display: flex; flex-direction: column; gap: 4px; }
.meeting-template-row label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary, #475569);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.meeting-template-row select { padding: 8px 10px; }
.meeting-template-actions { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 800px) {
  .meeting-template-chooser { grid-template-columns: 1fr; }
}


.meeting-create-form .form-input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-tertiary, rgba(255,255,255,0.04));
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.875rem;
}
.meeting-create-form .form-input:focus {
  outline: none;
  border-color: var(--accent, #60a5fa);
}
.meeting-create-form label {
  display: block;
  font-size: 0.8rem;
  color: var(--text2, #94a3b8);
  margin-bottom: 4px;
}

.meeting-info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 8px 0;
  font-size: 0.85rem;
  color: var(--text2, #94a3b8);
}
.meeting-info-item:empty { display: none; }

.panel-subtitle {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}
.panel-desc {
  font-size: 0.8rem;
  color: var(--text2, #94a3b8);
}

/* Speaker cards */
.meeting-speakers-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.speaker-card {
  background: var(--bg-tertiary, rgba(255,255,255,0.03));
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 14px 16px;
}
.speaker-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.speaker-card-badge {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}
.speaker-card-stats {
  font-size: 0.75rem;
  color: var(--text3, #64748b);
}
.speaker-samples {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.speaker-sample {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.btn-play-sample {
  flex-shrink: 0;
  padding: 4px 10px;
  font-size: 0.75rem;
  background: var(--accent, #60a5fa);
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-play-sample:hover {
  background: #3b82f6;
}
.btn-play-sample.playing {
  background: #ef4444;
  animation: pulse-play 1s infinite;
}
@keyframes pulse-play {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
.sample-time {
  opacity: 0.7;
  font-size: 0.7rem;
}
.sample-text {
  font-size: 0.78rem;
  color: var(--text2, #94a3b8);
  line-height: 1.4;
  font-style: italic;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.speaker-card-input {
  display: flex;
  align-items: center;
  gap: 8px;
}
.speaker-card-input label {
  font-size: 0.8rem;
  color: var(--text2, #94a3b8);
  white-space: nowrap;
}
.speaker-card-input .speaker-name-input {
  flex: 1;
  padding: 6px 10px;
  background: var(--bg-secondary, rgba(255,255,255,0.06));
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.85rem;
}
.speaker-card-input .speaker-name-input:focus {
  outline: none;
  border-color: var(--accent, #60a5fa);
}

/* Minutes textarea editor */
.minutes-textarea {
  width: 100%;
  min-height: 400px;
  padding: 16px 20px;
  background: var(--bg-primary, #ffffff);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'Times New Roman', serif;
  font-size: 0.95rem;
  line-height: 1.8;
  resize: vertical;
  tab-size: 4;
  white-space: pre-wrap;
}
.minutes-textarea::placeholder {
  color: var(--text-muted);
}
.minutes-textarea:focus {
  outline: none;
  border-color: var(--accent, #60a5fa);
  box-shadow: 0 0 0 2px rgba(96,165,250,0.15);
}
.btn-has-minutes {
  background: rgba(34,197,94,0.15);
  border-radius: 4px;
}

.minutes-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.minutes-actions-left {
  display: flex;
  gap: 8px;
}

.meeting-transcript {
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.7;
}

.meeting-summary-block {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--bg-tertiary, rgba(255,255,255,0.03));
  border-radius: 8px;
  border-left: 3px solid var(--accent, #60a5fa);
}
.meeting-summary-block h5 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent, #60a5fa);
  margin: 0 0 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.meeting-summary-text {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
}
.meeting-summary-block ul {
  margin: 0;
  padding-left: 20px;
}
.meeting-summary-block li {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.meeting-summary-block li strong {
  color: var(--accent, #60a5fa);
}

.meeting-ai-meta {
  font-size: 0.75rem;
  color: var(--text3, #64748b);
  margin-top: 8px;
  text-align: right;
}

.text-muted {
  color: var(--text3, #64748b);
  font-size: 0.85rem;
  font-style: italic;
}
