:root {
      --bg-dark: #0b0f19;
      --bg-surface: #111827;
      --bg-surface-elevated: #1f2937;
      --bg-card: rgba(17, 24, 39, 0.7);
      --border-subtle: rgba(255, 255, 255, 0.08);
      --border-focus: rgba(99, 102, 241, 0.5);
      --primary: #6366f1;
      --primary-hover: #4f46e5;
      --primary-glow: rgba(99, 102, 241, 0.25);
      --emerald: #10b981;
      --emerald-glow: rgba(16, 185, 129, 0.2);
      --cyan: #06b6d4;
      --cyan-glow: rgba(6, 182, 212, 0.2);
      --rose: #f43f5e;
      --rose-hover: #e11d48;
      --rose-glow: rgba(244, 63, 94, 0.25);
      --amber: #f59e0b;
      --text-main: #f9fafb;
      --text-muted: #9ca3af;
      --text-subtle: #6b7280;
      --radius-sm: 8px;
      --radius-md: 12px;
      --radius-lg: 16px;
      --radius-xl: 24px;
      --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    body {
      background-color: var(--bg-dark);
      background-image:
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.08) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(6, 182, 212, 0.05) 0px, transparent 50%);
      background-attachment: fixed;
      color: var(--text-main);
      font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      -webkit-font-smoothing: antialiased;
    }

    /* Container */
    .container {
      max-width: 1180px;
      margin: 0 auto;
      padding: 2rem 1.5rem;
      width: 100%;
      flex: 1;
    }

    /* Header */
    header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 2rem;
      padding-bottom: 1.5rem;
      border-bottom: 1px solid var(--border-subtle);
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 1rem;
    }

    .brand-icon {
      width: 44px;
      height: 44px;
      background: linear-gradient(135deg, var(--primary), var(--cyan));
      border-radius: var(--radius-md);
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 8px 16px var(--primary-glow);
    }

    .brand-icon svg {
      width: 24px;
      height: 24px;
      fill: white;
    }

    .brand-title h1 {
      font-size: 1.35rem;
      font-weight: 800;
      letter-spacing: -0.02em;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .brand-title p {
      font-size: 0.85rem;
      color: var(--text-muted);
    }

    .header-actions {
      display: flex;
      align-items: center;
      gap: 1rem;
    }

    .status-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.4rem 0.85rem;
      background: rgba(16, 185, 129, 0.1);
      border: 1px solid rgba(16, 185, 129, 0.2);
      border-radius: 9999px;
      font-size: 0.78rem;
      font-weight: 600;
      color: var(--emerald);
    }

    .status-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--emerald);
      box-shadow: 0 0 10px var(--emerald);
      animation: pulse-dot 2s infinite;
    }

    @keyframes pulse-dot {

      0%,
      100% {
        opacity: 1;
        transform: scale(1);
      }

      50% {
        opacity: 0.4;
        transform: scale(0.85);
      }
    }

    /* Layout Grid */
    .dashboard-grid {
      display: grid;
      grid-template-columns: 1fr 1.35fr;
      gap: 2rem;
      align-items: start;
    }

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

    /* Glass Cards */
    .glass-card {
      background: var(--bg-card);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-xl);
      padding: 1.75rem;
      box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.5);
      position: relative;
      overflow: hidden;
    }

    .glass-card::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 1px;
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    }

    .card-title {
      font-size: 1.15rem;
      font-weight: 700;
      margin-bottom: 0.35rem;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .card-subtitle {
      font-size: 0.82rem;
      color: var(--text-muted);
      margin-bottom: 1.5rem;
    }

    /* Form Elements */
    .form-group {
      margin-bottom: 1.25rem;
    }

    label {
      display: block;
      font-size: 0.82rem;
      font-weight: 600;
      margin-bottom: 0.5rem;
      color: var(--text-main);
    }

    label span {
      color: var(--rose);
    }

    .input-wrapper {
      position: relative;
      display: flex;
      align-items: center;
    }

    .input-icon {
      position: absolute;
      left: 1rem;
      color: var(--text-subtle);
      pointer-events: none;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    input[type="text"],
    input[type="password"] {
      width: 100%;
      background: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-md);
      padding: 0.85rem 1rem 0.85rem 2.75rem;
      color: var(--text-main);
      font-size: 0.92rem;
      font-family: inherit;
      transition: var(--transition);
    }

    input:focus {
      outline: none;
      border-color: var(--primary);
      box-shadow: 0 0 0 3px var(--primary-glow);
      background: var(--bg-surface-elevated);
    }

    .input-hint {
      font-size: 0.75rem;
      color: var(--text-subtle);
      margin-top: 0.4rem;
    }

    select.custom-select {
      width: 100%;
      background: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-md);
      padding: 0.85rem 2.25rem 0.85rem 2.75rem;
      color: var(--text-main);
      font-size: 0.92rem;
      font-family: inherit;
      transition: var(--transition);
      cursor: pointer;
      appearance: none;
      background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
      background-repeat: no-repeat;
      background-position: right 1rem center;
      background-size: 1rem;
    }

    select.custom-select:focus {
      outline: none;
      border-color: var(--primary);
      box-shadow: 0 0 0 3px var(--primary-glow);
      background-color: var(--bg-surface-elevated);
    }

    select.custom-select option {
      background: #111827;
      color: #f3f4f6;
      padding: 0.6rem;
    }

    /* Filename Preview Box */
    .filename-preview-box {
      margin: 1.1rem 0 1.35rem 0;
      padding: 0.9rem 1.15rem;
      background: linear-gradient(135deg, rgba(30, 41, 59, 0.75), rgba(15, 23, 42, 0.9));
      border: 1px solid rgba(99, 102, 241, 0.35);
      border-radius: var(--radius-md);
      display: flex;
      align-items: center;
      gap: 0.85rem;
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
      transition: var(--transition);
    }

    .filename-preview-box:hover {
      border-color: var(--primary);
      box-shadow: 0 6px 18px var(--primary-glow);
    }

    .preview-badge {
      background: rgba(99, 102, 241, 0.2);
      border: 1px solid rgba(99, 102, 241, 0.4);
      color: #a5b4fc;
      font-size: 0.72rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      padding: 0.3rem 0.55rem;
      border-radius: 6px;
      white-space: nowrap;
      display: flex;
      align-items: center;
      gap: 0.3rem;
      flex-shrink: 0;
    }

    .preview-content {
      display: flex;
      flex-direction: column;
      gap: 0.15rem;
      min-width: 0;
      flex: 1;
    }

    .preview-label {
      font-size: 0.7rem;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: var(--text-subtle);
      font-weight: 600;
    }

    .preview-filename {
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.84rem;
      font-weight: 700;
      color: #38bdf8;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    /* Collapsible */
    .collapsible-trigger {
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 100%;
      background: none;
      border: none;
      color: var(--text-muted);
      font-size: 0.82rem;
      font-weight: 600;
      padding: 0.75rem 0;
      cursor: pointer;
      border-top: 1px dashed var(--border-subtle);
      margin-top: 0.5rem;
    }

    .collapsible-trigger:hover {
      color: var(--text-main);
    }

    .collapsible-content {
      display: none;
      padding-top: 0.75rem;
      margin-bottom: 1rem;
    }

    .collapsible-content.open {
      display: block;
    }

    .grid-2 {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 1rem;
    }

    /* Buttons */
    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.5rem;
      padding: 0.85rem 1.5rem;
      border-radius: var(--radius-md);
      font-size: 0.92rem;
      font-weight: 700;
      font-family: inherit;
      cursor: pointer;
      transition: var(--transition);
      border: none;
      text-decoration: none;
    }

    .btn-primary {
      width: 100%;
      background: linear-gradient(135deg, var(--primary), var(--primary-hover));
      color: white;
      box-shadow: 0 6px 18px var(--primary-glow);
    }

    .btn-primary:hover:not(:disabled) {
      transform: translateY(-2px);
      box-shadow: 0 10px 24px var(--primary-glow);
    }

    .btn-primary:disabled {
      opacity: 0.5;
      cursor: not-allowed;
      transform: none;
    }

    .btn-stop {
      background: linear-gradient(135deg, var(--rose), var(--rose-hover));
      color: white;
      box-shadow: 0 4px 14px var(--rose-glow);
      padding: 0.65rem 1.1rem;
      font-size: 0.82rem;
      border-radius: var(--radius-md);
      animation: pulse-stop 2s infinite;
    }

    @keyframes pulse-stop {

      0%,
      100% {
        box-shadow: 0 0 10px rgba(244, 63, 94, 0.4);
      }

      50% {
        box-shadow: 0 0 20px rgba(244, 63, 94, 0.8);
      }
    }

    .btn-stop:hover:not(:disabled) {
      background: #be123c;
      transform: translateY(-1px);
    }

    .btn-drive {
      background: linear-gradient(135deg, var(--emerald), #059669);
      color: white;
      box-shadow: 0 4px 12px var(--emerald-glow);
      padding: 0.6rem 1rem;
      font-size: 0.82rem;
      font-weight: 700;
    }

    .btn-drive:hover {
      background: #047857;
      transform: translateY(-1px);
    }

    .btn-secondary {
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid var(--border-subtle);
      color: var(--text-main);
      padding: 0.5rem 0.85rem;
      font-size: 0.78rem;
    }

    .btn-secondary:hover {
      background: rgba(255, 255, 255, 0.1);
    }

    /* ═════════════════════════════════════════════════════════════
       PIPELINE PROGRESS BAR (5 STEPS: UX SUPERIOR)
       1. Conectando...
       2. Conectado
       3. Gravando...
       4. Salvando...
       5. Vídeo salvo no Google Drive ✓
       ═════════════════════════════════════════════════════════════ */
    .progress-pipeline {
      margin: 1.25rem 0 1rem 0;
      padding: 1.2rem;
      background: rgba(11, 15, 25, 0.85);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-lg);
    }

    .pipeline-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 1.15rem;
    }

    .pipeline-title {
      font-size: 0.85rem;
      font-weight: 700;
      display: flex;
      align-items: center;
      gap: 0.5rem;
      color: var(--text-main);
    }

    .pipeline-steps {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      position: relative;
      gap: 0.5rem;
    }

    .pipeline-step {
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      position: relative;
    }

    .step-indicator {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background: var(--bg-surface);
      border: 2px solid var(--border-subtle);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.78rem;
      font-weight: 700;
      color: var(--text-subtle);
      margin-bottom: 0.5rem;
      transition: var(--transition);
      z-index: 2;
    }

    .step-label {
      font-size: 0.72rem;
      font-weight: 600;
      color: var(--text-subtle);
      line-height: 1.2;
    }

    /* Step States */
    .pipeline-step.active .step-indicator {
      background: var(--primary);
      border-color: var(--cyan);
      color: white;
      box-shadow: 0 0 14px var(--primary-glow);
      animation: pulse-step 1.5s infinite;
    }

    .pipeline-step.active .step-label {
      color: var(--text-main);
      font-weight: 700;
    }

    .pipeline-step.completed .step-indicator {
      background: var(--emerald);
      border-color: var(--emerald);
      color: white;
      box-shadow: 0 0 10px var(--emerald-glow);
    }

    .pipeline-step.completed .step-label {
      color: var(--emerald);
    }

    .pipeline-step.recording-live .step-indicator {
      background: var(--rose);
      border-color: #fda4af;
      color: white;
      box-shadow: 0 0 16px rgba(244, 63, 94, 0.6);
      animation: pulse-recording 1.2s infinite;
    }

    .pipeline-step.recording-live .step-label {
      color: #fb7185;
      font-weight: 800;
    }

    @keyframes pulse-step {

      0%,
      100% {
        transform: scale(1);
        box-shadow: 0 0 12px var(--primary-glow);
      }

      50% {
        transform: scale(1.08);
        box-shadow: 0 0 20px var(--cyan-glow);
      }
    }

    @keyframes pulse-recording {

      0%,
      100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(244, 63, 94, 0.5);
      }

      50% {
        transform: scale(1.1);
        box-shadow: 0 0 22px rgba(244, 63, 94, 0.9);
      }
    }

    /* Drive Success Banner */
    .drive-banner {
      margin-top: 1rem;
      padding: 1.15rem;
      background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(6, 182, 212, 0.1));
      border: 1px solid rgba(16, 185, 129, 0.35);
      border-radius: var(--radius-md);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
      box-shadow: 0 8px 24px -6px rgba(16, 185, 129, 0.2);
    }

    .drive-banner-info {
      display: flex;
      align-items: center;
      gap: 0.85rem;
    }

    .drive-icon {
      width: 40px;
      height: 40px;
      background: var(--emerald);
      border-radius: var(--radius-sm);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }

    .drive-icon svg {
      width: 22px;
      height: 22px;
      fill: white;
    }

    .drive-banner-text h4 {
      font-size: 0.92rem;
      font-weight: 700;
      color: #34d399;
      margin-bottom: 0.2rem;
    }

    .drive-banner-text p {
      font-size: 0.78rem;
      color: var(--text-muted);
    }

    /* Recordings List */
    .recordings-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 1.25rem;
    }

    .recordings-list {
      display: flex;
      flex-direction: column;
      gap: 1rem;
      max-height: 680px;
      overflow-y: auto;
      padding-right: 0.25rem;
    }

    .recordings-list::-webkit-scrollbar {
      width: 6px;
    }

    .recordings-list::-webkit-scrollbar-track {
      background: transparent;
    }

    .recordings-list::-webkit-scrollbar-thumb {
      background: var(--border-subtle);
      border-radius: 3px;
    }

    .recording-card {
      background: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-lg);
      padding: 1.25rem;
      transition: var(--transition);
      position: relative;
    }

    .recording-card:hover {
      border-color: rgba(255, 255, 255, 0.15);
      background: rgba(31, 41, 55, 0.6);
    }

    .recording-card.active-card {
      border-color: rgba(99, 102, 241, 0.4);
      background: rgba(17, 24, 39, 0.95);
      box-shadow: 0 8px 24px -6px var(--primary-glow);
    }

    .rec-top {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 0.75rem;
      margin-bottom: 0.75rem;
    }

    .rec-title-group h3 {
      font-size: 0.95rem;
      font-weight: 700;
      margin-bottom: 0.25rem;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .rec-link {
      font-size: 0.78rem;
      color: var(--cyan);
      text-decoration: none;
      font-family: 'JetBrains Mono', monospace;
    }

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

    .rec-status-tag {
      font-size: 0.72rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      padding: 0.3rem 0.65rem;
      border-radius: 9999px;
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
    }

    .tag-queued {
      background: rgba(245, 158, 11, 0.15);
      color: var(--amber);
      border: 1px solid rgba(245, 158, 11, 0.3);
    }

    .tag-running {
      background: rgba(244, 63, 94, 0.15);
      color: var(--rose);
      border: 1px solid rgba(244, 63, 94, 0.3);
    }

    .tag-finalizing {
      background: rgba(6, 182, 212, 0.15);
      color: var(--cyan);
      border: 1px solid rgba(6, 182, 212, 0.3);
    }

    .tag-uploading {
      background: rgba(99, 102, 241, 0.15);
      color: var(--primary);
      border: 1px solid rgba(99, 102, 241, 0.3);
    }

    .tag-done {
      background: rgba(16, 185, 129, 0.15);
      color: var(--emerald);
      border: 1px solid rgba(16, 185, 129, 0.3);
    }

    .tag-error {
      background: rgba(239, 68, 68, 0.15);
      color: #f87171;
      border: 1px solid rgba(239, 68, 68, 0.3);
    }

    .rec-meta {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 1.25rem;
      font-size: 0.76rem;
      color: var(--text-muted);
      margin-top: 0.5rem;
    }

    .rec-meta-item {
      display: flex;
      align-items: center;
      gap: 0.35rem;
    }

    .rec-actions {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      margin-top: 1rem;
      padding-top: 0.85rem;
      border-top: 1px solid var(--border-subtle);
    }

    /* Modal */
    .modal-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.75);
      backdrop-filter: blur(8px);
      z-index: 1000;
      align-items: center;
      justify-content: center;
      padding: 1.5rem;
    }

    .modal-overlay.open {
      display: flex;
    }

    .modal-card {
      background: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-xl);
      max-width: 720px;
      width: 100%;
      max-height: 85vh;
      display: flex;
      flex-direction: column;
      box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.7);
    }

    .modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 1.25rem 1.5rem;
      border-bottom: 1px solid var(--border-subtle);
    }

    .modal-body {
      padding: 1.5rem;
      overflow-y: auto;
      flex: 1;
    }

    .logs-terminal {
      background: #030712;
      border: 1px solid rgba(255, 255, 255, 0.05);
      border-radius: var(--radius-md);
      padding: 1rem;
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.78rem;
      line-height: 1.6;
      color: #93c5fd;
      max-height: 480px;
      overflow-y: auto;
      white-space: pre-wrap;
      word-break: break-all;
    }

    .empty-state {
      text-align: center;
      padding: 3rem 1.5rem;
      color: var(--text-subtle);
    }

    .empty-state svg {
      width: 48px;
      height: 48px;
      stroke: var(--text-subtle);
      margin-bottom: 1rem;
    }

    /* Toast */
    .toast {
      position: fixed;
      bottom: 2rem;
      right: 2rem;
      background: var(--bg-surface-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-md);
      padding: 0.85rem 1.25rem;
      font-size: 0.85rem;
      font-weight: 600;
      color: var(--text-main);
      box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
      display: flex;
      align-items: center;
      gap: 0.75rem;
      z-index: 2000;
      opacity: 0;
      transform: translateY(10px);
      transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
      pointer-events: none;
    }

    .toast.show {
      opacity: 1;
      transform: translateY(0);
    }

    .toast.success {
      border-color: var(--emerald);
      color: var(--emerald);
    }

    .toast.error {
      border-color: var(--rose);
      color: var(--rose);
    }

    /* Shimmer loader */
    .shimmer {
      background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.03) 100%);
      background-size: 200% 100%;
      animation: shimmer 2s infinite;
    }

    @keyframes shimmer {
      0% {
        background-position: 200% 0;
      }

      100% {
        background-position: -200% 0;
      }
    }

    /* Live Activity Monitor */
    .live-activity-banner {
      background: rgba(17, 24, 39, 0.85);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-lg);
      padding: 1.15rem 1.5rem;
      margin-bottom: 2rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1.5rem;
      box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
      backdrop-filter: blur(16px);
      transition: var(--transition);
    }

    .live-activity-banner.recording {
      border-color: rgba(244, 63, 94, 0.5);
      background: linear-gradient(135deg, rgba(244, 63, 94, 0.15), rgba(17, 24, 39, 0.95));
      box-shadow: 0 0 30px rgba(244, 63, 94, 0.25);
    }

    .live-activity-banner.idle {
      border-color: rgba(16, 185, 129, 0.25);
      background: linear-gradient(135deg, rgba(16, 185, 129, 0.06), rgba(17, 24, 39, 0.8));
    }

    .activity-left {
      display: flex;
      align-items: center;
      gap: 1rem;
    }

    .activity-pulse-indicator {
      width: 14px;
      height: 14px;
      border-radius: 50%;
      flex-shrink: 0;
    }

    .live-activity-banner.idle .activity-pulse-indicator {
      background: var(--emerald);
      box-shadow: 0 0 10px var(--emerald);
    }

    .live-activity-banner.recording .activity-pulse-indicator {
      background: var(--rose);
      box-shadow: 0 0 16px var(--rose);
      animation: pulse-recording 1s infinite;
    }

    .activity-text h3 {
      font-size: 0.98rem;
      font-weight: 800;
      margin-bottom: 0.2rem;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .activity-text p {
      font-size: 0.82rem;
      color: var(--text-muted);
    }

    .activity-actions {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      flex-shrink: 0;
    }

    /* ─── Logo Anarriê no header ─── */
    .header-partner {
      display: flex;
      align-items: center;
      justify-content: center;
      padding-left: 0.85rem;
      border-left: 1px solid var(--border-subtle);
      margin-left: 0.25rem;
    }

    .logo-anarrie {
      height: 46px;
      width: auto;
      max-width: 160px;
      object-fit: contain;
      filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
      transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), filter 0.2s ease;
      cursor: default;
    }

    .logo-anarrie:hover {
      transform: translateY(-1px) scale(1.04);
      filter: drop-shadow(0 4px 14px rgba(99, 102, 241, 0.3));
    }

    /* ─── Botões inline Gravar + Ajuda ─── */
    .form-actions-inline {
      display: flex;
      gap: 0.75rem;
      align-items: stretch;
      width: 100%;
    }

    .form-actions-inline .btn-primary {
      flex: 1;
      width: auto;
    }

    .btn-help {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.45rem;
      padding: 0.85rem 1.2rem;
      border-radius: var(--radius-md);
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid var(--border-subtle);
      color: var(--text-main);
      font-size: 0.88rem;
      font-weight: 700;
      letter-spacing: 0.04em;
      cursor: pointer;
      transition: var(--transition);
      white-space: nowrap;
      font-family: inherit;
    }

    .btn-help:hover {
      background: rgba(99, 102, 241, 0.15);
      border-color: rgba(99, 102, 241, 0.4);
      color: #fff;
      transform: translateY(-2px);
      box-shadow: 0 4px 12px var(--primary-glow);
    }

    .btn-help.active {
      background: rgba(99, 102, 241, 0.25);
      border-color: var(--primary);
      color: #fff;
      box-shadow: 0 0 14px var(--primary-glow);
    }

    /* ─── Caixa de ajuda: hidden by default ─── */
    .how-it-works-box {
      display: none;
      margin-top: 1.25rem;
      padding: 1.1rem 1.25rem;
      background: rgba(17, 24, 39, 0.9);
      border: 1px solid rgba(99, 102, 241, 0.3);
      border-radius: var(--radius-md);
      font-size: 0.82rem;
      box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.5);
    }

    .how-it-works-box.open {
      display: block;
      animation: fadeInHelp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    }

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

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .how-it-works-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 0.6rem;
    }

    .how-it-works-box h4 {
      font-size: 0.88rem;
      font-weight: 700;
      color: var(--cyan);
      margin-bottom: 0;
      display: flex;
      align-items: center;
      gap: 0.4rem;
    }

    .btn-close-help {
      background: none;
      border: none;
      color: var(--text-subtle);
      font-size: 1.3rem;
      line-height: 1;
      cursor: pointer;
      padding: 2px 6px;
      border-radius: 4px;
      transition: var(--transition);
    }

    .btn-close-help:hover {
      color: var(--text-main);
      background: rgba(255, 255, 255, 0.1);
    }

    .how-it-works-steps {
      display: flex;
      flex-direction: column;
      gap: 0.4rem;
      color: var(--text-muted);
      line-height: 1.45;
    }

    .how-it-works-steps strong {
      color: var(--text-main);
    }

    /* ─── Footer com XCapital ─── */
    .app-footer {
      margin-top: 3rem;
      padding: 1.5rem 0 2rem 0;
      border-top: 1px solid var(--border-subtle);
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 1.25rem;
    }

    .footer-left {
      display: flex;
      align-items: center;
      gap: 1.25rem;
      flex-wrap: wrap;
    }

    .footer-partner-box {
      display: flex;
      flex-direction: column;
      gap: 0.3rem;
    }

    .footer-partner-label {
      font-size: 0.62rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.1em;
      color: var(--text-subtle);
    }

    .logo-xcapital {
      height: 36px;
      width: auto;
      max-width: 140px;
      object-fit: contain;
      border-radius: 7px;
      filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
      transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .logo-xcapital:hover {
      transform: translateY(-1px) scale(1.03);
    }

    .footer-info {
      border-left: 1px solid var(--border-subtle);
      padding-left: 1.1rem;
    }

    .footer-copy {
      font-size: 0.82rem;
      font-weight: 700;
      color: var(--text-main);
      margin-bottom: 0.15rem;
    }

    .footer-subcopy {
      font-size: 0.7rem;
      color: var(--text-muted);
    }

    .footer-right {
      display: flex;
      align-items: center;
    }

    .footer-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.4rem 0.85rem;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-sm);
      font-size: 0.72rem;
      color: var(--text-muted);
      font-family: 'JetBrains Mono', monospace;
    }

    @media (max-width: 768px) {
      .header-partner {
        border-left: none;
        padding-left: 0;
        margin-left: 0;
      }

      .logo-anarrie {
        height: 36px;
      }

      .app-footer {
        flex-direction: column;
        align-items: flex-start;
      }

      .footer-info {
        border-left: none;
        padding-left: 0;
      }

      .form-actions-inline {
        flex-direction: column;
      }
    }

    /* ── Header User Badge & Logout ── */
    .header-user-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.6rem;
      padding: 0.35rem 0.85rem;
      background: rgba(99, 102, 241, 0.12);
      border: 1px solid rgba(99, 102, 241, 0.3);
      border-radius: 9999px;
      font-size: 0.78rem;
      color: var(--text-main);
    }

    .user-avatar-tag {
      font-size: 0.85rem;
    }

    .user-name-tag {
      font-weight: 600;
      color: #e0e7ff;
    }

    .btn-logout-header {
      background: transparent;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 0.3rem;
      font-size: 0.74rem;
      font-weight: 500;
      padding: 0.2rem 0.5rem;
      border-radius: 6px;
      transition: var(--transition);
    }

    .btn-logout-header:hover {
      color: var(--rose);
      background: rgba(244, 63, 94, 0.15);
    }

    /* ── Custom Modal de Confirmação (Visual Premium) ── */