/* =========================================================
   Toolkit Digital — Cards Netflix com Elegância Clean
   Centralizado · Padding generoso · Azul sóbrio
   ========================================================= */

   * { box-sizing: border-box; }

   html, body {
       height: 100%;
       margin: 0;
       padding: 0;
   }
   
   body {
       -webkit-font-smoothing: antialiased;
       font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
       color: #0f172a;
       background: #f8fafc;
       display: flex;
       flex-direction: column;
       min-height: 100vh;
   }
   
   ::-webkit-scrollbar { width: 8px; height: 8px; }
   ::-webkit-scrollbar-track { background: #f1f5f9; }
   ::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
   
   :focus-visible {
       outline: 2px solid #1e40af;
       outline-offset: 2px;
       border-radius: 8px;
   }
   
   @keyframes fadeIn {
       from { opacity: 0; transform: translateY(6px); }
       to   { opacity: 1; transform: translateY(0); }
   }
   @keyframes spin { to { transform: rotate(360deg); } }
   @keyframes toastIn {
       from { opacity: 0; transform: translateY(-12px); }
       to   { opacity: 1; transform: translateY(0); }
   }
   @keyframes toastOut {
       from { opacity: 1; transform: translateY(0); }
       to   { opacity: 0; transform: translateY(-12px); }
   }
   @keyframes pulse {
       0%, 100% { box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18); }
       50%      { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.04); }
   }
   
   /* ---------- HEADER (fino, branco, sticky) ---------- */
   header.app-header {
       flex: 0 0 auto;
       padding: 0.85rem 2rem;
       background: rgba(255, 255, 255, 0.92);
       backdrop-filter: saturate(180%) blur(12px);
       -webkit-backdrop-filter: saturate(180%) blur(12px);
       border-bottom: 1px solid #e2e8f0;
       display: flex;
       justify-content: space-between;
       align-items: center;
       position: sticky;
       top: 0;
       z-index: 20;
   }
   .brand-wrap {
       display: flex;
       align-items: center;
       gap: 0.65rem;
   }
   .brand-icon {
       display: inline-flex;
       align-items: center;
       justify-content: center;
       width: 34px;
       height: 34px;
       border-radius: 8px;
       background: #1e40af;
       color: #ffffff;
       font-size: 1rem;
       box-shadow: 0 2px 6px rgba(30, 64, 175, 0.25);
   }
   .brand-name {
       font-size: 1rem;
       font-weight: 800;
       letter-spacing: -0.02em;
       color: #0f172a;
   }
   .brand-name .dot { color: #1e40af; }
   .status-pill {
       display: inline-flex;
       align-items: center;
       gap: 0.4rem;
       padding: 0.3rem 0.75rem;
       border-radius: 6px;
       background: #f0fdf4;
       border: 1px solid #bbf7d0;
       color: #166534;
       font-size: 0.7rem;
       font-weight: 600;
   }
   .status-dot {
       display: inline-block;
       width: 6px; height: 6px;
       border-radius: 50%;
       background: #22c55e;
       animation: pulse 2.5s infinite;
   }
   .status-dot.offline { background: #ef4444; animation: none; }
   
   /* ---------- MAIN (centralizado, padding generoso) ---------- */
   main.app-main {
       flex: 1 1 auto;
       max-width: 1180px;
       width: 100%;
       margin: 0 auto;
       padding: 3rem 2rem 4rem;
       animation: fadeIn 0.4s ease-out both;
   }
   
   /* ---------- HERO centralizado ---------- */
   .hero {
       text-align: center;
       margin-bottom: 3rem;
       max-width: 680px;
       margin-left: auto;
       margin-right: auto;
   }
   .hero-eyebrow {
       display: inline-block;
       font-size: 0.7rem;
       font-weight: 700;
       letter-spacing: 0.1em;
       text-transform: uppercase;
       color: #1e40af;
       margin-bottom: 1rem;
       padding: 0.3rem 0.75rem;
       background: #eff6ff;
       border: 1px solid #dbeafe;
       border-radius: 999px;
   }
   .hero h1 {
       font-size: clamp(1.85rem, 3.4vw, 2.5rem);
       font-weight: 800;
       letter-spacing: -0.03em;
       line-height: 1.15;
       color: #0f172a;
       margin: 0 0 0.85rem;
   }
   .hero h1 .accent { color: #1e40af; }
   .hero p {
       font-size: clamp(0.9rem, 1.1vw, 1rem);
       color: #475569;
       line-height: 1.65;
       margin: 0;
   }
   
   /* ---------- SEÇÃO header ---------- */
   .section-header {
       display: flex;
       align-items: baseline;
       justify-content: space-between;
       padding-bottom: 1rem;
       margin-bottom: 1.75rem;
       border-bottom: 1px solid #e2e8f0;
   }
   .section-title {
       font-size: 0.85rem;
       font-weight: 700;
       letter-spacing: 0.08em;
       text-transform: uppercase;
       color: #64748b;
       margin: 0;
   }
   .section-count {
       font-size: 0.75rem;
       font-weight: 500;
       color: #94a3b8;
   }
   
   /* ---------- GRID centralizado (3 por linha; última linha centralizada) ---------- */
   .tools-grid {
       --gap: 1.25rem;
       display: flex;
       flex-wrap: wrap;
       justify-content: center;
       gap: var(--gap);
       max-width: 1020px;
       margin: 0 auto;
   }
   .tools-grid .tool-card {
       flex: 0 0 calc((100% - 2 * var(--gap)) / 3);
   }

   @media (max-width: 780px) {
       .tools-grid { --gap: 1rem; }
       .tools-grid .tool-card { flex-basis: calc((100% - var(--gap)) / 2); }
       main.app-main { padding: 2rem 1.25rem 3rem; }
   }
   @media (max-width: 480px) {
       .tools-grid .tool-card { flex-basis: 100%; }
   }

   /* ---------- CARD NETFLIX (16:9 horizontal) ---------- */
   .tool-card {
       position: relative;
       display: block;
       aspect-ratio: 16 / 10;
       border-radius: 12px;
       overflow: hidden;
       cursor: pointer;
       background: #e2e8f0;
       border: 1px solid #e2e8f0;
   
       /* Sombra em 2 camadas: profundidade sutil */
       box-shadow:
           0 1px 2px rgba(15, 23, 42, 0.04),
           0 6px 16px -8px rgba(15, 23, 42, 0.08);
   
       transition:
           transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
           box-shadow 0.28s ease,
           border-color 0.28s ease;
   }
   
   .tool-card:hover {
       transform: translateY(-4px);
       border-color: rgba(30, 64, 175, 0.5);
       box-shadow:
           0 2px 4px rgba(15, 23, 42, 0.06),
           0 16px 32px -10px rgba(30, 64, 175, 0.25);
   }
   
   /* ---------- CAPA (fundo gradiente pastel) ---------- */
   .tool-cover {
       position: absolute;
       inset: 0;
       display: flex;
       align-items: center;
       justify-content: center;
       overflow: hidden;
   }
   .tool-emoji {
       font-size: clamp(2.4rem, 4vw, 3.4rem);
       filter: drop-shadow(0 4px 12px rgba(0,0,0,0.12));
       transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
   }
   .tool-card:hover .tool-emoji {
       transform: scale(1.15) rotate(-5deg);
   }
   
   /* Paleta pastel (formal, não berrante) */
   .cover-blue    { background: linear-gradient(140deg, #dbeafe 0%, #93c5fd 100%); }
   .cover-emerald { background: linear-gradient(140deg, #d1fae5 0%, #6ee7b7 100%); }
   .cover-pink    { background: linear-gradient(140deg, #fce7f3 0%, #f9a8d4 100%); }
   .cover-cyan    { background: linear-gradient(140deg, #cffafe 0%, #67e8f9 100%); }
   
   /* Overlay escuro no rodapé (para texto legível) */
   .tool-card::after {
       content: '';
       position: absolute;
       inset: 0;
       background: linear-gradient(
           to top,
           rgba(15, 23, 42, 0.82) 0%,
           rgba(15, 23, 42, 0.5) 35%,
           transparent 70%
       );
       pointer-events: none;
       z-index: 1;
   }
   
   /* ---------- BADGE (canto superior esquerdo) ---------- */
   .tool-badge {
       position: absolute;
       top: 0.6rem;
       left: 0.6rem;
       padding: 0.15rem 0.55rem;
       font-size: 0.55rem;
       font-weight: 800;
       text-transform: uppercase;
       letter-spacing: 0.06em;
       border-radius: 4px;
       z-index: 3;
       backdrop-filter: blur(8px);
       line-height: 1.4;
   }
   .badge-hot  { background: rgba(239, 68, 68, 0.95); color: #ffffff; }
   .badge-new  { background: rgba(34, 197, 94, 0.95); color: #ffffff; }
   .badge-beta { background: rgba(245, 158, 11, 0.95); color: #ffffff; }
   
   /* ---------- CORPO (sobreposto no rodapé da capa) ---------- */
   .tool-body {
       position: absolute;
       bottom: 0;
       left: 0;
       right: 0;
       padding: 0.75rem 0.9rem 0.85rem;
       z-index: 2;
       color: #ffffff;
       display: flex;
       flex-direction: column;
       gap: 0.15rem;
   }
   .tool-title {
       font-size: 0.95rem;
       font-weight: 800;
       line-height: 1.2;
       margin: 0;
       letter-spacing: -0.01em;
       text-shadow: 0 1px 3px rgba(0,0,0,0.5);
   }
   .tool-desc {
       font-size: 0.75rem;
       line-height: 1.3;
       color: rgba(255, 255, 255, 0.88);
       margin: 0;
       text-shadow: 0 1px 2px rgba(0,0,0,0.4);
       display: -webkit-box;
       -webkit-line-clamp: 1;
       -webkit-box-orient: vertical;
       overflow: hidden;
   }
   
   /* ---------- SETA (aparece no hover) ---------- */
   .tool-arrow {
       position: absolute;
       top: 0.7rem;
       right: 0.7rem;
       z-index: 4;
       display: inline-flex;
       align-items: center;
       justify-content: center;
       width: 28px;
       height: 28px;
       border-radius: 50%;
       background: rgba(255, 255, 255, 0.95);
       color: #1e40af;
       font-size: 0.85rem;
       font-weight: 700;
       opacity: 0;
       transform: scale(0.8);
       transition: opacity 0.2s ease, transform 0.2s ease;
       box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
   }
   .tool-card:hover .tool-arrow {
       opacity: 1;
       transform: scale(1);
   }
   
   /* ---------- WORKSPACE (overlay branco) ---------- */
   #tool-workspace {
       position: fixed;
       inset: 0;
       z-index: 50;
       background: #ffffff;
       padding: 1.5rem;
       overflow-y: auto;
       animation: fadeIn 0.2s ease-out both;
   }
   #tool-workspace.hidden { display: none; }
   #tool-workspace .workspace-header {
       display: flex;
       justify-content: space-between;
       align-items: center;
       padding-bottom: 1rem;
       border-bottom: 1px solid #e2e8f0;
       margin-bottom: 1.5rem;
       max-width: 900px;
       margin-left: auto;
       margin-right: auto;
   }
   #workspace-title {
       font-size: 1.1rem;
       font-weight: 700;
       color: #0f172a;
       margin: 0;
       letter-spacing: -0.01em;
   }
   #workspace-content {
       max-width: 900px;
       margin: 0 auto;
   }
   
   /* ---------- Botões ---------- */
   .btn-secondary {
       display: inline-flex;
       align-items: center;
       gap: 0.35rem;
       padding: 0.45rem 0.85rem;
       border-radius: 6px;
       font-weight: 500;
       font-size: 0.8rem;
       background: #ffffff;
       color: #0f172a;
       border: 1px solid #e2e8f0;
       cursor: pointer;
       transition: all 0.15s ease;
   }
   .btn-secondary:hover { background: #f8fafc; border-color: #cbd5e1; }
   
   /* ---------- Inputs ---------- */
   input[type="text"],
   input[type="password"],
   input[type="number"],
   select {
       background: #ffffff;
       border: 1px solid #e2e8f0;
       border-radius: 8px;
       padding: 0.55rem 0.8rem;
       font-size: 0.88rem;
       color: #0f172a;
       width: 100%;
       transition: border-color 0.15s ease, box-shadow 0.15s ease;
   }
   input:focus, select:focus {
       outline: none;
       border-color: #1e40af;
       box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
   }
   input[type="file"] {
       background: #ffffff;
       border: 1px solid #e2e8f0;
       border-radius: 10px;
       padding: 1rem;
       font-size: 0.85rem;
       color: #64748b;
       width: 100%;
       cursor: pointer;
       transition: border-color 0.15s ease, background 0.15s ease;
   }
   input[type="file"]:hover {
       border-color: #1e40af;
       background: #f8faff;
   }
   input[type="file"]::file-selector-button {
       background: #1e40af;
       color: #ffffff;
       border: 0;
       border-radius: 6px;
       padding: 0.45rem 0.9rem;
       font-weight: 600;
       font-size: 0.8rem;
       margin-right: 0.9rem;
       cursor: pointer;
   }
   input[type="file"]::file-selector-button:hover { background: #1e3a8a; }
   label {
       display: block;
       font-size: 0.75rem;
       font-weight: 600;
       color: #475569;
       margin-bottom: 0.4rem;
   }
   
   /* ---------- Spinner ---------- */
   .btn-loading {
       position: relative;
       color: transparent !important;
       pointer-events: none;
   }
   .btn-loading::after {
       content: "";
       position: absolute;
       top: 50%; left: 50%;
       width: 16px; height: 16px;
       margin: -8px 0 0 -8px;
       border: 2px solid rgba(30, 64, 175, 0.3);
       border-top-color: #1e40af;
       border-radius: 50%;
       animation: spin 0.7s linear infinite;
   }
   
   /* ---------- Toasts ---------- */
   #toast-container {
       position: fixed;
       top: 1rem; right: 1rem;
       z-index: 9999;
       display: flex;
       flex-direction: column;
       gap: 0.4rem;
       max-width: calc(100vw - 2rem);
       width: 340px;
   }
   .toast {
       display: flex;
       align-items: flex-start;
       gap: 0.6rem;
       padding: 0.7rem 0.95rem;
       border-radius: 8px;
       border: 1px solid;
       background: #ffffff;
       box-shadow: 0 8px 20px -6px rgba(15, 23, 42, 0.12);
       animation: toastIn 0.25s ease-out both;
       font-size: 0.82rem;
       line-height: 1.4;
   }
   .toast.toast-out { animation: toastOut 0.2s ease-in both; }
   .toast-success { border-color: #86efac; color: #166534; background: #f0fdf4; }
   .toast-error   { border-color: #fca5a5; color: #991b1b; background: #fef2f2; }
   .toast-warn    { border-color: #fcd34d; color: #92400e; background: #fffbeb; }
   .toast-info    { border-color: #93c5fd; color: #1e40af; background: #eff6ff; }
   .toast-close {
       margin-left: auto;
       background: transparent;
       border: 0;
       color: inherit;
       opacity: 0.5;
       cursor: pointer;
       font-size: 1rem;
   }
   .toast-close:hover { opacity: 1; }
   
   /* ---------- Loader inicial ---------- */
   #skeleton-loader {
       position: fixed;
       inset: 0;
       z-index: 9998;
       background: #ffffff;
       display: flex;
       align-items: center;
       justify-content: center;
       transition: opacity 0.2s ease, visibility 0.2s ease;
   }
   #skeleton-loader.hidden { opacity: 0; visibility: hidden; }
   .loader-logo { font-size: 2rem; color: #1e40af; }
   
   /* ---------- Impressão ---------- */
   @media print {
       .no-print, #toast-container, header, footer, #skeleton-loader { display: none !important; }
       body { background: #fff !important; color: #000 !important; }
       #tool-workspace { position: static !important; padding: 0 !important; }
       .print-number {
           display: inline-flex !important;
           align-items: center;
           justify-content: center;
           width: 36px; height: 36px;
           border-radius: 50%;
           background: #000 !important;
           color: #fff !important;
           font-weight: bold;
           margin: 2px;
           -webkit-print-color-adjust: exact;
           print-color-adjust: exact;
       }
   }

   /* Skip link (a11y) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 8px;
    background: #1e40af;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 99999;
    text-decoration: none;
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: 8px;
}


/* =========================================================
   EDITOR DE PDF — Lista de arquivos (juntar)
   ========================================================= */

   .pdf-upload-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8fafc;
}
.pdf-upload-zone:hover {
    border-color: #1e40af;
    background: #eff6ff;
}
.pdf-upload-zone.dragover {
    border-color: #1e40af;
    background: #eff6ff;
}

.pdf-lista-wrap {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
}
.pdf-lista-wrap.ativa {
    display: flex;
}

.pdf-lista-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
}

.pdf-lista {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.pdf-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.65rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.pdf-item:hover {
    border-color: #93c5fd;
    box-shadow: 0 2px 6px rgba(30, 64, 175, 0.08);
}

.pdf-item-numero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 0.7rem;
    font-weight: 800;
    flex-shrink: 0;
}

.pdf-item-icone {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.pdf-item-info {
    flex: 1;
    min-width: 0;
}

.pdf-item-nome {
    font-size: 0.8rem;
    font-weight: 600;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-item-tamanho {
    font-size: 0.68rem;
    color: #94a3b8;
}

.pdf-item-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #f1f5f9;
    color: #475569;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s ease;
}
.pdf-item-btn:hover:not(:disabled) {
    background: #e2e8f0;
}
.pdf-item-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pdf-item-btn.remove {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
    font-size: 0.95rem;
}
.pdf-item-btn.remove:hover {
    background: #fee2e2;
}

/* Barra de progresso (reutilizável) */
.pdf-progresso-wrap {
    display: none;
    flex-direction: column;
    gap: 0.3rem;
}
.pdf-progresso-wrap.ativa {
    display: flex;
}

.pdf-progresso-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 600;
}

.pdf-progresso-texto {
    color: #475569;
}

.pdf-progresso-pct {
    color: #1e40af;
    font-weight: 700;
}

.pdf-progresso-trilha {
    background: #e2e8f0;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}

.pdf-progresso-barra {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #1e40af, #3b82f6);
    border-radius: 999px;
    transition: width 0.3s ease;
}

/* Ações */
.pdf-acoes {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Status */
.pdf-status {
    font-size: 0.72rem;
    color: #64748b;
}
.pdf-status.erro { color: #dc2626; }
.pdf-status.sucesso { color: #059669; }
.pdf-status.aviso { color: #d97706; }



















