/*
 * Application stylesheet — Premium, modern craftsman aesthetic
 */

:root {
  --app-bg: #FAF9F6; /* Premium soft plaster white */
  --app-surface: #ffffff;
  --app-surface-muted: #F5F3EF;
  --app-border: #E8E5DF;
  --app-border-strong: #D5CFB9;
  --app-text: #1C1917; /* Rich deep slate charcoal */
  --app-muted: #57534E;
  --app-faint: #A8A29E;
  --app-primary: #1b4d79; /* Premium glowing warm steel blue */
  --app-primary-dark: #113250;
  --app-primary-light: #f1f6fa;
  --app-primary-glow: rgba(27, 77, 121, 0.12);
  --app-success: #10B981; /* Fresh emerald */
  --app-success-dark: #059669;
  --app-success-light: #ECFDF5;
  --app-warning-bg: #FFFBEB;
  --app-warning-border: #FCD34D;
  --app-warning-text: #B45309;
  --app-danger-bg: #FEF2F2;
  --app-danger-border: #FCA5A5;
  --app-danger-text: #991B1B;
  --app-shadow: 0 20px 40px -15px rgba(28, 25, 23, 0.08);
  --app-shadow-soft: 0 4px 20px -2px rgba(28, 25, 23, 0.04);
  --app-shadow-premium: 0 10px 25px -5px rgba(27, 77, 121, 0.25);
  --app-radius: 16px;
  --app-radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  color: var(--app-text);
  background: radial-gradient(circle at 100% 0%, #EBF3F9 0%, var(--app-bg) 60%);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  margin: 0;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

/* ── Topbar ──────────────────────────────────────────────────────── */

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(232, 229, 223, 0.8);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.app-topbar-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 1.1rem;
  background: linear-gradient(135deg, var(--app-primary) 0%, var(--app-primary-dark) 100%);
  box-shadow: 0 4px 14px rgba(27, 77, 121, 0.35);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--app-text);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.nav-link {
  border-radius: var(--app-radius-sm);
  padding: 8px 14px;
  color: var(--app-muted);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link-active {
  background: var(--app-primary-light);
  color: var(--app-primary-dark);
}

/* ── Main layout ─────────────────────────────────────────────────── */

.app-main {
  width: min(1000px, 100%);
  margin: 0 auto;
  padding: 40px 20px 80px;
}

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

.page-title {
  color: var(--app-text);
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0;
}

.page-subtitle {
  color: var(--app-muted);
  margin-top: 10px;
  margin-bottom: 0;
  max-width: 52rem;
  font-size: 1rem;
  line-height: 1.5;
}

.eyebrow {
  color: var(--app-primary);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  color: var(--app-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.crumbs a {
  color: var(--app-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.crumbs a:hover {
  color: var(--app-primary);
}

/* ── Cards ───────────────────────────────────────────────────────── */

.app-card,
.list-panel {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-soft);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.app-card {
  padding: 32px;
}

.app-card:hover {
  box-shadow: var(--app-shadow);
}

.app-card.p-0 {
  padding: 0;
}

.app-card.p-10 {
  padding: 2.5rem;
}

.list-panel {
  overflow: hidden;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--app-border);
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}

.list-row:last-child {
  border-bottom: 0;
}

.list-row:hover {
  background: var(--app-primary-light);
}

.list-title {
  color: var(--app-text);
  font-weight: 800;
  line-height: 1.25;
  margin: 0;
  font-size: 1.1rem;
}

.list-meta {
  color: var(--app-muted);
  font-size: 0.92rem;
  margin-top: 6px;
  margin-bottom: 0;
}

/* ── Empty state ─────────────────────────────────────────────────── */

.empty-state {
  background: var(--app-surface);
  border: 2px dashed var(--app-border-strong);
  border-radius: var(--app-radius);
  padding: 64px 32px;
  text-align: center;
  color: var(--app-muted);
  box-shadow: var(--app-shadow-soft);
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--app-primary-light);
  color: var(--app-primary);
  font-size: 1.8rem;
  font-weight: 800;
}

/* ── Buttons ─────────────────────────────────────────────────────── */

.btn {
  min-height: 46px;
  border-radius: 11px;
  padding: 11px 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--app-shadow-soft);
}

.btn.py-4 {
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(28, 25, 23, 0.08);
}

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

.btn-primary {
  background: var(--app-primary);
  color: white;
  border-color: var(--app-primary-dark);
}

.btn-primary:hover {
  background: var(--app-primary-dark);
  box-shadow: var(--app-shadow-premium);
}

.btn-success {
  background: var(--app-success);
  color: white;
  border-color: var(--app-success-dark);
}

.btn-success:hover {
  background: var(--app-success-dark);
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.25);
}

.btn-danger {
  background: var(--app-danger-text);
  color: white;
  border-color: #7f1d1d;
}

.btn-danger:hover {
  background: #7f1d1d;
  box-shadow: 0 8px 22px rgba(153, 27, 27, 0.25);
}

.btn-secondary {
  background: white;
  border-color: var(--app-border-strong);
  color: var(--app-text);
}

.btn-secondary:hover {
  background: var(--app-surface-muted);
  border-color: var(--app-muted);
}

.btn-ghost {
  background: transparent;
  color: var(--app-muted);
  box-shadow: none;
}

.btn-ghost:hover {
  background: var(--app-surface-muted);
  color: var(--app-text);
  box-shadow: none;
}

.btn-disabled {
  background: #ede8e2;
  color: #9b8a80;
  cursor: not-allowed;
  box-shadow: none;
  border-color: transparent;
}

.btn-disabled:hover {
  transform: none;
  box-shadow: none;
}

.btn-danger-link {
  color: var(--app-danger-text);
  font-size: 0.85rem;
  font-weight: 700;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.15s ease;
  padding: 4px 8px;
  border-radius: 6px;
}

.btn-danger-link:hover {
  background: var(--app-danger-bg);
  color: #7f1d1d;
}

/* ── Forms ───────────────────────────────────────────────────────── */

.form-stack {
  display: grid;
  gap: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  color: var(--app-text);
  font-size: 0.94rem;
  font-weight: 700;
}

.form-help {
  color: var(--app-faint);
  font-weight: 500;
  font-size: 0.85rem;
}

.form-input {
  width: 100%;
  min-height: 48px;
  border: 1.5px solid var(--app-border-strong);
  border-radius: var(--app-radius-sm);
  background: white;
  color: var(--app-text);
  padding: 12px 16px;
  outline: none;
  transition: all 0.2s ease;
}

.form-input.w-16 {
  width: 4rem;
}

.form-input.w-20 {
  width: 5rem;
}

.form-input.w-24 {
  width: 6rem;
}

.form-input:focus {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 3px var(--app-primary-glow);
}

/* Search bar styling */
.search-container {
  margin-bottom: 20px;
}

.search-form {
  display: flex;
  gap: 8px;
}

.search-input {
  flex: 1;
  min-height: 42px;
  border: 1.5px solid var(--app-border-strong);
  border-radius: var(--app-radius-sm);
  background: white;
  color: var(--app-text);
  padding: 8px 14px;
  outline: none;
  transition: all 0.2s ease;
  font-size: 0.94rem;
}

.search-input:focus {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 3px var(--app-primary-glow);
}

.search-btn {
  padding: 8px 16px;
  min-height: 42px;
}

.form-section {
  border-top: 1px solid var(--app-border);
  padding-top: 24px;
}

.contact-group {
  background: var(--app-surface-muted);
  border: 1.5px solid var(--app-border-strong);
  border-radius: var(--app-radius-sm);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contact-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.contact-group-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--app-text);
  margin: 0;
}

.contact-group-badge {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #FFFBEB;
  color: #B45309;
  border: 1.5px solid #FCD34D;
}

.contact-group-help {
  font-size: 0.84rem;
  color: var(--app-muted);
  margin: -6px 0 2px 0;
  line-height: 1.4;
}

/* ── Dashboard Stats ─────────────────────────────────────────────── */

.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

@media (max-width: 768px) {
  .dashboard-stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
  }
}

.stat-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  padding: 18px 20px;
  box-shadow: var(--app-shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--app-shadow);
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.stat-card-sent::before {
  background: var(--app-primary);
}

.stat-card-accepted::before {
  background: var(--app-success);
}

.stat-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--app-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.stat-value-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
}

.stat-number {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--app-text);
  line-height: 1.1;
}

.stat-meta {
  font-size: 0.85rem;
  color: var(--app-muted);
  font-weight: 600;
  margin-right: auto;
}

.stat-revenue-row {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid var(--app-border);
  padding-top: 10px;
}

.stat-revenue-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--app-muted);
}

.stat-revenue {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--app-text);
}

.stat-revenue.success-text {
  color: var(--app-success-dark);
}

/* ── Status badges ───────────────────────────────────────────────── */

.status-badge {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  border: 1.5px solid transparent;
  text-transform: uppercase;
}

.status-draft {
  background: #f0ebe4;
  color: #5a4d43;
  border-color: #ddd5cb;
}

.status-sent {
  background: #FFFBEB;
  color: #B45309;
  border-color: #FCD34D;
}

.status-accepted {
  background: var(--app-success-light);
  color: var(--app-success-dark);
  border-color: #A7F3D0;
}

.status-rejected {
  background: var(--app-danger-bg);
  color: var(--app-danger-text);
  border-color: var(--app-danger-border);
}

.status-withdrawn {
  background: #f3f4f6;
  color: #374151;
  border-color: #d1d5db;
}

/* ── Notices / alerts ────────────────────────────────────────────── */

.notice-bar,
.alert-bar {
  border-bottom: 1px solid;
  padding: 12px 20px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
}

.notice-bar {
  background: var(--app-success-light);
  border-color: #A7F3D0;
  color: var(--app-success-dark);
}

.alert-bar {
  background: var(--app-danger-bg);
  border-color: var(--app-danger-border);
  color: var(--app-danger-text);
}

/* ── Toast ───────────────────────────────────────────────────────── */

.toast-container {
  position: fixed;
  top: 88px;
  right: 24px;
  z-index: 60;
  display: grid;
  gap: 12px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  min-height: 56px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  padding: 14px 16px;
  background: white;
  color: var(--app-text);
  box-shadow: 0 10px 30px rgba(28, 25, 23, 0.12);
  font-size: 0.95rem;
  font-weight: 700;
  pointer-events: auto;
  animation: toast-enter 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.1);
}

.toast-success {
  border-left: 4px solid var(--app-success);
}

.toast-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--app-success);
}

.toast-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--app-muted);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-close:hover {
  background: var(--app-surface-muted);
  color: var(--app-text);
}

.toast-leaving {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Messages ────────────────────────────────────────────────────── */

.message-error {
  background: var(--app-danger-bg);
  border: 1px solid var(--app-danger-border);
  color: var(--app-danger-text);
  border-radius: var(--app-radius-sm);
  padding: 16px 20px;
  font-size: 0.95rem;
  font-weight: 600;
}

.message-warning {
  background: var(--app-warning-bg);
  border: 1px solid var(--app-warning-border);
  color: var(--app-warning-text);
  border-radius: var(--app-radius-sm);
  padding: 16px 20px;
}

/* ── Offer table ─────────────────────────────────────────────────── */

.offer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.96rem;
}

.offer-table th {
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 0 12px;
  border-bottom: 1.5px solid var(--app-border);
}

.offer-table td {
  padding: 16px 0;
  border-bottom: 1px solid var(--app-border);
  vertical-align: middle;
}

.offer-table tbody tr {
  transition: background 0.15s ease;
}

.offer-table tbody tr:hover td {
  background: rgba(254, 253, 252, 0.7);
}

.offer-table tbody tr:last-child td {
  border-bottom: 0;
}

.offer-table tfoot td {
  border-bottom: 0;
  padding: 8px 0;
}

/* ── Record card & button ────────────────────────────────────────── */

.record-card {
  padding: 48px 36px;
  text-align: center;
  background: linear-gradient(135deg, #FBFDFF 0%, #EDF4F9 100%);
  border-color: #C8D7E3;
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-soft);
}

/* Dynamic State Recording Wrapper */
.recorder-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.record-button {
  width: 130px;
  height: 130px;
  border-radius: 999px;
  background: white;
  border: 4px solid var(--app-border);
  color: var(--app-primary);
  font-size: 2.8rem;
  display: inline-block;
  box-shadow: 0 10px 25px rgba(28, 25, 23, 0.08);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.15);
  cursor: pointer;
  position: relative;
  outline: none;
}

.record-button-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.record-button:focus-visible {
  outline: 3px solid var(--app-primary-glow);
  outline-offset: 2px;
}

.record-button:hover {
  transform: scale(1.05);
  border-color: var(--app-primary);
  box-shadow: 0 12px 30px rgba(27, 77, 121, 0.15);
}

.record-button:active {
  transform: scale(0.97);
}

/* Outer pulsing ripple ring when active */
.record-button::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 999px;
  border: 2px dashed var(--app-primary);
  opacity: 0;
  transition: all 0.25s ease;
  transform-origin: center;
}

/* Active Recording Style */
.recording .record-button {
  background: #DC2626; /* Deep crimson red */
  color: white;
  border-color: #B91C1C;
  animation: recording-button-pulse 1.8s infinite ease-in-out;
}

/* Multi-layered ripple rings using ::after and ::before */
.recording .record-button::before,
.recording .record-button::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  border: 3px solid #DC2626;
  opacity: 0;
  pointer-events: none;
  transition: none;
  transform-origin: center;
  box-sizing: border-box;
}

.recording .record-button::before {
  animation: recording-ripple 1.8s infinite cubic-bezier(0.25, 0, 0, 1);
}

.recording .record-button::after {
  animation: recording-ripple 1.8s infinite cubic-bezier(0.25, 0, 0, 1);
  animation-delay: 0.6s;
}

@keyframes recording-button-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4), 0 10px 25px rgba(28, 25, 23, 0.08);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 14px rgba(220, 38, 38, 0), 0 15px 35px rgba(220, 38, 38, 0.2);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0), 0 10px 25px rgba(28, 25, 23, 0.08);
  }
}

@keyframes recording-ripple {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* Processing / Analyzing Style */
.processing .record-button {
  background: var(--app-primary-glow);
  color: var(--app-primary);
  border-color: var(--app-primary);
  box-shadow: 0 0 0 15px rgba(27, 77, 121, 0.1);
  cursor: wait;
}

.processing .record-button::after {
  opacity: 1;
  border-style: solid;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

.processing .record-button svg {
  animation: voice-pulse 1.2s ease-in-out infinite;
}

@keyframes voice-pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.85); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

/* Hands-free mode */
.hands-free .record-button {
  background: #059669;
  color: white;
  border-color: #047857;
  box-shadow: 0 10px 25px rgba(5, 150, 105, 0.25);
}

.handsfree-label {
  display: none;
  font-size: 0.72rem;
  font-weight: 800;
  color: #059669;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 6px;
  animation: handsfree-pulse 2s ease-in-out infinite;
}

.hands-free .handsfree-label {
  display: block;
}

@keyframes handsfree-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.handsfree-exit-btn {
  display: none;
  margin-top: 12px;
}

.hands-free .handsfree-exit-btn {
  display: inline-flex;
}

/* Small recorder inside options grid */
.record-button-small {
  width: 64px;
  height: 64px;
  border-width: 3px;
  font-size: 1.6rem;
}
.record-button-small:hover {
  box-shadow: 0 6px 16px rgba(27, 77, 121, 0.15);
}
.recording .record-button-small {
  animation: recording-button-pulse-small 1.8s infinite ease-in-out;
}
.recording .record-button-small::before,
.recording .record-button-small::after {
  border-width: 2px;
}
.processing .record-button-small {
  box-shadow: 0 0 0 8px rgba(27, 77, 121, 0.08);
}
.processing .record-button-small::after {
  inset: -5px;
}

@keyframes recording-button-pulse-small {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4), 0 6px 16px rgba(27, 77, 121, 0.15);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 8px rgba(220, 38, 38, 0), 0 10px 20px rgba(220, 38, 38, 0.2);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0), 0 6px 16px rgba(27, 77, 121, 0.15);
  }
}

/* Simulated Audio Waveform */
.audio-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 32px;
  margin: 18px 0;
  opacity: 0.3;
  transition: opacity 0.2s ease;
}

.recording .audio-wave {
  opacity: 1;
}

.audio-wave span {
  display: block;
  width: 3px;
  height: 8px;
  background: var(--app-primary);
  border-radius: 99px;
}

.recording .audio-wave span {
  background: #DC2626;
  animation: wave-bounce 0.7s ease-in-out infinite alternate;
}

.recording .audio-wave span:nth-child(2) { animation-delay: 0.1s; }
.recording .audio-wave span:nth-child(3) { animation-delay: 0.2s; }
.recording .audio-wave span:nth-child(4) { animation-delay: 0.3s; }
.recording .audio-wave span:nth-child(5) { animation-delay: 0.4s; }
.recording .audio-wave span:nth-child(6) { animation-delay: 0.5s; }

@keyframes wave-bounce {
  from { height: 8px; }
  to { height: 32px; }
}

/* Spinner for Processing State */
.processing-spinner {
  width: 32px;
  height: 32px;
  border: 4px solid var(--app-primary-glow);
  border-top-color: var(--app-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 14px auto;
}

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

.tip-box {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #F3DEC9;
  border-radius: var(--app-radius-sm);
  padding: 18px 20px;
  color: var(--app-muted);
  text-align: left;
  line-height: 1.5;
}

/* ── Open Action Layout Grid (Side-by-side or Stacked) ─────────────── */

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 32px 0;
}

.option-card {
  background: white;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  padding: 24px;
  box-shadow: var(--app-shadow-soft);
  transition: all 0.2s ease;
}

.option-card:hover {
  border-color: var(--app-border-strong);
  box-shadow: var(--app-shadow);
}

.option-card-voice {
  background: linear-gradient(180deg, white 0%, #F6FAFD 100%);
  border-color: #E2ECF3;
}
.option-card-voice:hover {
  border-color: #C8D7E3;
}

.option-card-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin-top: 0;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--app-text);
}

.option-card-voice .option-card-title {
  color: var(--app-primary-dark);
}

.option-card-desc {
  font-size: 0.88rem;
  color: var(--app-muted);
  margin-bottom: 18px;
  line-height: 1.4;
}

/* ── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .app-topbar-inner {
    align-items: center;
    flex-direction: row;
  }

  .app-main {
    padding: 28px 16px 56px;
  }

  .toast-container {
    top: 16px;
    right: 16px;
    left: 16px;
    width: auto;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
  }

  .page-header .btn {
    width: 100%;
  }

  .app-card {
    padding: 24px 16px;
  }

  .list-row {
    padding: 16px 20px;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .offer-table {
    font-size: 0.9rem;
  }

  .offer-table th:nth-child(3),
  .offer-table td:nth-child(3),
  .offer-table th:nth-child(4),
  .offer-table td:nth-child(4) {
    display: none;
  }

  .record-card {
    padding: 32px 20px;
  }

  .record-button {
    width: 110px;
    height: 110px;
  }

  .options-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

details summary::-webkit-details-marker {
  display: none;
}
details summary {
  list-style: none;
}

/* ── User Dropdown Menu ───────────────────────────────────────────── */

.user-menu-details {
  position: relative;
}

.user-menu-details[open] {
  z-index: 50;
}

.user-menu-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--app-text);
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--app-radius-sm);
  transition: background-color 0.2s ease;
  user-select: none;
}

.user-menu-summary:hover {
  background-color: var(--app-surface-muted);
}

.user-menu-summary svg {
  width: 16px;
  height: 16px;
  color: var(--app-muted);
  transition: transform 0.2s ease;
}

.user-menu-details[open] .user-menu-summary svg {
  transform: rotate(180deg);
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 180px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  box-shadow: var(--app-shadow);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: dropdownFadeIn 0.15s ease-out;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.user-menu-dropdown a {
  display: block;
  padding: 10px 14px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--app-muted);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.user-menu-dropdown a:hover {
  background-color: var(--app-primary-light);
  color: var(--app-primary-dark);
}

.user-menu-dropdown a.text-danger:hover {
  background-color: var(--app-danger-bg);
  color: var(--app-danger-text);
}

/* Suggested Price Badge */
.price-suggested-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background-color: #fef3c7; /* amber-100 */
  color: #b45309; /* amber-700 */
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.125rem 0.375rem;
  border-radius: 9999px;
  cursor: help;
  user-select: none;
}

/* Offer Type Switcher and Badges */
.offer-type-selector {
  border-bottom: 1px solid var(--app-border);
  padding-bottom: 1.25rem;
}

.type-toggle-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: white;
  border: 1.5px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  box-shadow: var(--app-shadow-soft);
}

.type-toggle-btn:hover {
  border-color: var(--app-border-strong);
  background: var(--app-surface-muted);
  transform: translateY(-1px);
}

.type-toggle-btn.active {
  border-color: var(--app-primary);
  background: var(--app-primary-light);
  box-shadow: 0 0 0 1px var(--app-primary);
}

.type-toggle-btn.active .font-bold {
  color: var(--app-primary-dark);
}

.type-toggle-btn .type-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 9999px;
  background: var(--app-primary-light);
  color: var(--app-primary-dark);
  border: 1px solid rgba(27, 77, 121, 0.25);
  line-height: 1;
}

.type-badge-alt {
  background: var(--app-surface-muted);
  color: var(--app-muted);
  border: 1px solid var(--app-border);
}

/* ── Voice Assistant ──────────────────────────────────────────────── */

.voice-assistant-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 900px) {
  .voice-assistant-grid {
    grid-template-columns: 1fr;
  }
}

.chat-history {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 420px;
  overflow-y: auto;
  padding: 12px;
  background: var(--app-surface-muted);
  border-radius: var(--app-radius-sm);
  border: 1px solid var(--app-border);
}

.chat-bubble-container {
  display: flex;
  width: 100%;
  margin-bottom: 4px;
}

.chat-bubble-container.user-container {
  justify-content: flex-end;
}

.chat-bubble-container.assistant-container {
  justify-content: flex-start;
  gap: 10px;
}

.chat-bubble {
  max-width: 75%;
  padding: 12px 18px;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.45;
  box-shadow: var(--app-shadow-soft);
  position: relative;
}

.user-bubble {
  background: var(--app-primary);
  color: white;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}

.assistant-bubble {
  background: white;
  color: var(--app-text);
  border-top-left-radius: 4px;
  border: 1px solid var(--app-border);
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--app-primary-light);
  border: 1.5px solid var(--app-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.voice-widget-card {
  background: white;
  border: 1.5px solid var(--app-border-strong);
  border-radius: var(--app-radius);
  padding: 24px;
  box-shadow: var(--app-shadow-soft);
}

/* Speaking State for Assistant */
.speaking .record-button {
  background: var(--app-success-light);
  color: var(--app-success-dark);
  border-color: var(--app-success);
  box-shadow: 0 0 0 15px rgba(16, 185, 129, 0.15);
}

.speaking .record-button::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 999px;
  border: 2px dotted var(--app-success);
  opacity: 1;
  animation: spin-pulse-speaking 3s linear infinite;
  transform-origin: center;
}

@keyframes spin-pulse-speaking {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.06); }
  100% { transform: rotate(360deg) scale(1); }
}

/* Idle State (when assistant is on but nothing is happening) */
.voice-assistant-grid:not(.recording):not(.speaking):not(.processing) .record-button:not(.record-button-small)::before,
.voice-assistant-grid:not(.recording):not(.speaking):not(.processing) .record-button:not(.record-button-small)::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  border: 3px solid var(--app-primary);
  background: rgba(27, 77, 121, 0.05); /* Premium soft steel blue fill */
  opacity: 0;
  pointer-events: none;
  box-sizing: border-box;
  transform-origin: center;
}

.voice-assistant-grid:not(.recording):not(.speaking):not(.processing) .record-button:not(.record-button-small)::before {
  animation: idle-wave 3s infinite cubic-bezier(0.25, 0, 0, 1);
}

.voice-assistant-grid:not(.recording):not(.speaking):not(.processing) .record-button:not(.record-button-small)::after {
  animation: idle-wave 3s infinite cubic-bezier(0.25, 0, 0, 1);
  animation-delay: 1.5s;
}

@keyframes idle-wave {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* ── Turbo Native Mobile App Styles ────────────────────────────────── */


body.turbo-native .app-main {
  padding: 16px;
  width: 100%;
  max-width: 100%;
  margin: 0;
}

body.turbo-native .crumbs {
  display: none;
}

body.turbo-native .page-header {
  display: none;
}

/* Container */
.turbo-native-container {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 32px);
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
}

/* Native Header Actions */
.native-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 24px;
}

.native-btn-reset, .native-btn-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem !important;
  border-radius: 12px !important;
  padding: 12px 20px !important;
  box-shadow: var(--app-shadow-soft);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  border: 1.5px solid transparent;
}

.native-btn-reset {
  background: var(--app-surface-muted) !important;
  color: var(--app-muted) !important;
  border-color: var(--app-border) !important;
}

.native-btn-reset:hover {
  background: var(--app-border) !important;
}

.native-btn-view {
  background: linear-gradient(135deg, var(--app-primary), #4F46E5) !important;
  color: white !important;
}

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

/* Centered Recording Widget */
.native-recording-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  margin: 40px 0;
}

.native-record-button-wrapper {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.native-record-button {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--app-primary), #4F46E5);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  z-index: 2;
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.35);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.native-record-button:active {
  transform: scale(0.92);
}

.native-mic-icon {
  width: 44px;
  height: 44px;
}

.native-record-pulse {
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  border-radius: 50%;
  background: var(--app-primary);
  opacity: 0;
  z-index: 1;
  transition: all 0.3s ease;
}

/* Speaking/Processing States */
.recording .native-record-pulse {
  animation: nativePulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

.speaking .native-record-button {
  background: linear-gradient(135deg, #10B981, #059669);
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.35);
}

.speaking .native-record-pulse {
  background: #10B981;
  animation: nativePulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

.processing .native-record-button {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.35);
}

.processing .native-record-pulse {
  background: #F59E0B;
  animation: nativePulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes nativePulse {
  0% {
    transform: scale(0.9);
    opacity: 0.5;
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

/* Audio Waves */
.native-audio-wave {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  height: 36px;
  margin-top: 32px;
}

.native-audio-wave span {
  width: 4px;
  height: 6px;
  background: var(--app-primary);
  border-radius: 2px;
  transition: all 0.15s ease;
}

.recording .native-audio-wave span {
  background: var(--app-primary);
  animation: nativeWave 1.2s infinite ease-in-out;
}

.speaking .native-audio-wave span {
  background: #10B981;
  animation: nativeWave 1.2s infinite ease-in-out;
}

.native-audio-wave span:nth-child(2) { animation-delay: 0.1s; }
.native-audio-wave span:nth-child(3) { animation-delay: 0.2s; }
.native-audio-wave span:nth-child(4) { animation-delay: 0.3s; }
.native-audio-wave span:nth-child(5) { animation-delay: 0.4s; }
.native-audio-wave span:nth-child(6) { animation-delay: 0.5s; }
.native-audio-wave span:nth-child(7) { animation-delay: 0.6s; }

@keyframes nativeWave {
  0%, 100% { height: 6px; }
  50% { height: 32px; }
}

.native-status-text {
  color: var(--app-text);
  font-weight: 800;
  font-size: 1.35rem;
  margin-top: 20px;
  margin-bottom: 6px;
  text-align: center;
}

.native-timer-text {
  color: var(--app-muted);
  font-size: 1.15rem;
  font-family: monospace;
  font-weight: 700;
  margin: 0;
  height: 28px;
}

/* Beautiful iOS switches & container at bottom */
.native-toggles-area {
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 18px;
  border: 1.5px solid var(--app-border);
  padding: 4px 20px;
  box-shadow: var(--app-shadow-soft);
  margin-top: auto;
}

.native-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
  cursor: pointer;
}

.native-toggle-row:not(:last-child) {
  border-bottom: 1.5px solid var(--app-surface-muted);
}

.native-toggle-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.native-toggle-icon {
  font-size: 1.5rem;
}

.native-toggle-labels {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.native-toggle-title {
  font-weight: 800;
  color: var(--app-text);
  font-size: 1.05rem;
}

.native-toggle-desc {
  font-size: 0.82rem;
  color: var(--app-muted);
}

/* iOS Toggle Switch Styles */
.ios-switch {
  position: relative;
  display: inline-block;
  width: 51px;
  height: 31px;
}

.ios-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ios-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--app-border-strong);
  transition: .3s cubic-bezier(0.25, 0.8, 0.25, 1);
  border-radius: 34px;
}

.ios-slider:before {
  position: absolute;
  content: "";
  height: 27px;
  width: 27px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .3s cubic-bezier(0.25, 0.8, 0.25, 1);
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.ios-switch input:checked + .ios-slider {
  background-color: #34C759; /* iOS Native Green */
}

.ios-switch input:checked + .ios-slider:before {
  transform: translateX(20px);
}

/* ── Burger Menu & Mobile Sidebar ───────────────────────────────────── */

.hidden-toggle-input {
  display: none;
}

.burger-menu-btn {
  display: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  color: var(--app-text);
  transition: background 0.2s ease;
  align-items: center;
  justify-content: center;
}

.burger-menu-btn:hover {
  background: var(--app-surface-muted);
}

.mobile-sidebar-drawer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  pointer-events: none;
  visibility: hidden;
  transition: all 0.3s ease;
}

.drawer-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
  cursor: pointer;
}

.drawer-content {
  position: absolute;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100%;
  background: white;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  padding: 0;
  box-sizing: border-box;
}

.hidden-toggle-input:checked ~ .mobile-sidebar-drawer {
  pointer-events: auto;
  visibility: visible;
}

.hidden-toggle-input:checked ~ .mobile-sidebar-drawer .drawer-overlay {
  opacity: 1;
}

.hidden-toggle-input:checked ~ .mobile-sidebar-drawer .drawer-content {
  right: 0;
}

/* Drawer Header */
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--app-border);
}

.close-drawer-btn {
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  color: var(--app-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.close-drawer-btn:hover {
  background: var(--app-surface-muted);
  color: var(--app-text);
}

/* Drawer Body */
.drawer-body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding: 24px;
  justify-content: space-between;
}

.drawer-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1.5px solid var(--app-surface-muted);
  margin-bottom: 24px;
}

.avatar-placeholder {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--app-primary), #4F46E5);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
}

.user-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-name {
  font-weight: 800;
  color: var(--app-text);
  font-size: 1rem;
}

.user-email {
  font-size: 0.8rem;
  color: var(--app-muted);
}

/* Navigation inside Drawer */
.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.drawer-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--app-muted);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.drawer-nav-link span {
  font-size: 1.2rem;
}

.drawer-nav-link:hover,
.drawer-nav-link.active {
  background: var(--app-primary-light);
  color: var(--app-primary-dark);
}

/* Drawer Footer */
.drawer-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1.5px solid var(--app-surface-muted);
}

.drawer-logout-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--app-danger);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: background 0.2s ease;
}

.drawer-logout-btn:hover {
  background: #FEF2F2;
}

/* Responsive visibility rules */
@media (max-width: 768px) {
  .desktop-nav-links {
    display: none !important;
  }
  
  .desktop-user-menu {
    display: none !important;
  }
  
  .burger-menu-btn {
    display: flex !important;
  }
}

.pending-audio {
  display: none !important;
}





